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 */ |
Madan Mohan Koyyalamudi | dfd6aa8 | 2012-10-18 20:18:43 -0700 | [diff] [blame] | 103 | static tWlanFeatCaps *gpHostWlanFeatCaps; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 104 | /* FW capability bitmap global */ |
Madan Mohan Koyyalamudi | dfd6aa8 | 2012-10-18 20:18:43 -0700 | [diff] [blame] | 105 | static tWlanFeatCaps *gpFwWlanFeatCaps; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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*/ |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 144 | WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1043 | __func__, wdiStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1055 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1066 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1079 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1080 | goto fail_timer; |
| 1081 | } |
| 1082 | |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1083 | wptStatus = wpalTimerInit( &gWDICb.ssrTimer, |
| 1084 | WDI_SsrTimerCB, |
| 1085 | &gWDICb); |
| 1086 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1087 | { |
| 1088 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1089 | "%s: Failed to init SSR timer, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1090 | __func__, wptStatus); |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1091 | goto fail_timer2; |
| 1092 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1093 | /* Initialize the WDI Pending Request Queue*/ |
| 1094 | wptStatus = wpal_list_init(&(gWDICb.wptPendingQueue)); |
| 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 pending request queue, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1099 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1100 | goto fail_pend_queue; |
| 1101 | } |
| 1102 | |
| 1103 | /*Init WDI Pending Assoc Id Queue */ |
| 1104 | wptStatus = wpal_list_init(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1105 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1106 | { |
| 1107 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1108 | "%s: Failed to init assoc session queue, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1109 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1110 | goto fail_assoc_queue; |
| 1111 | } |
| 1112 | |
| 1113 | /*Initialize the BSS sessions pending Queue */ |
| 1114 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1115 | { |
| 1116 | wptStatus = wpal_list_init(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1117 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1118 | { |
| 1119 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1120 | "%s: Failed to init BSS %d pending queue, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1121 | __func__, i, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1122 | goto fail_bss_queue; |
| 1123 | } |
| 1124 | } |
| 1125 | |
| 1126 | /*Indicate the control block is sufficiently initialized for callbacks*/ |
| 1127 | gWDICb.magic = WDI_CONTROL_BLOCK_MAGIC; |
| 1128 | |
| 1129 | /*------------------------------------------------------------------------ |
| 1130 | Initialize the Data Path Utility Module |
| 1131 | ------------------------------------------------------------------------*/ |
| 1132 | wdiStatus = WDI_DP_UtilsInit(&gWDICb); |
| 1133 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 1134 | { |
| 1135 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1136 | "%s: Failed to initialize the DP Util Module, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1137 | __func__, wdiStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1138 | goto fail_dp_util_init; |
| 1139 | } |
| 1140 | |
| 1141 | /* Init Set power state event */ |
| 1142 | wptStatus = wpalEventInit(&gWDICb.setPowerStateEvent); |
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 power state event, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1147 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1148 | goto fail_power_event; |
| 1149 | } |
| 1150 | |
| 1151 | /* Init WCTS action event */ |
| 1152 | wptStatus = wpalEventInit(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1153 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1154 | { |
| 1155 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1156 | "%s: Failed to initialize WCTS action event, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1157 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1158 | goto fail_wcts_event; |
| 1159 | } |
| 1160 | |
| 1161 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1162 | Open the Transport Services for Control and Data |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1163 | ------------------------------------------------------------------------*/ |
| 1164 | wctsCBs.wctsNotifyCB = WDI_NotifyMsgCTSCB; |
| 1165 | wctsCBs.wctsNotifyCBData = &gWDICb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1166 | wctsCBs.wctsRxMsgCB = WDI_RXMsgCTSCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1167 | wctsCBs.wctsRxMsgCBData = &gWDICb; |
| 1168 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1169 | gWDICb.bCTOpened = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1170 | gWDICb.wctsHandle = WCTS_OpenTransport( szTransportChName , |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1171 | WDI_CT_CHANNEL_SIZE, |
| 1172 | &wctsCBs ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1173 | |
| 1174 | if ( NULL == gWDICb.wctsHandle ) |
| 1175 | { |
| 1176 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1177 | "%s: Failed to open WCTS transport", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1178 | goto fail_wcts_open; |
| 1179 | } |
| 1180 | |
| 1181 | gWDICb.driverMode = (tDriverType)driverType; |
| 1182 | /* FTM mode not need to open Transport Driver */ |
| 1183 | if(eDRIVER_TYPE_MFG != (tDriverType)driverType) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1184 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1185 | /*------------------------------------------------------------------------ |
| 1186 | Open the Data Transport |
| 1187 | ------------------------------------------------------------------------*/ |
| 1188 | if(eWLAN_PAL_STATUS_SUCCESS != WDTS_openTransport(&gWDICb)) |
| 1189 | { |
| 1190 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1191 | "%s: Failed to open the DT Transport", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1192 | goto fail_wdts_open; |
| 1193 | } |
| 1194 | } |
| 1195 | |
| 1196 | /*The WDI is initialized - set state to init */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1197 | gWDICb.uGlobalState = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1198 | |
| 1199 | /*Send the context as a ptr to the global WDI Control Block*/ |
| 1200 | *ppWDIGlobalCtx = &gWDICb; |
| 1201 | |
| 1202 | /*Fill in the device capabilities*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1203 | pWdiDevCapability->bFrameXtlSupported = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1204 | pWdiDevCapability->ucMaxSTASupported = gWDICb.ucMaxStations; |
| 1205 | pWdiDevCapability->ucMaxBSSSupported = gWDICb.ucMaxBssids; |
| 1206 | return WDI_STATUS_SUCCESS; |
| 1207 | |
| 1208 | /* ERROR handlers |
| 1209 | Undo everything that completed successfully */ |
| 1210 | |
| 1211 | fail_wdts_open: |
| 1212 | { |
| 1213 | wpt_status eventStatus; |
| 1214 | |
| 1215 | /* Closing WCTS in this scenario is tricky since it has to close |
| 1216 | the SMD channel and then we get notified asynchronously when |
| 1217 | the channel has been closed. So we take some of the logic from |
| 1218 | the "normal" close procedure in WDI_Close() |
| 1219 | */ |
| 1220 | |
| 1221 | eventStatus = wpalEventReset(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1222 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1223 | { |
| 1224 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1225 | "%s: Failed to reset WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1226 | } |
| 1227 | |
| 1228 | WCTS_CloseTransport(gWDICb.wctsHandle); |
| 1229 | |
| 1230 | /* Wait for WCTS to close the control transport. If we were able |
| 1231 | to reset the event flag, then we'll wait for the event, |
| 1232 | otherwise we'll wait for a maximum amount of time required for |
| 1233 | the channel to be closed */ |
| 1234 | if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus ) |
| 1235 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1236 | eventStatus = wpalEventWait(&gWDICb.wctsActionEvent, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1237 | WDI_WCTS_ACTION_TIMEOUT); |
| 1238 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
| 1239 | { |
| 1240 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1241 | "%s: Failed to wait on WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1242 | } |
| 1243 | } |
| 1244 | else |
| 1245 | { |
| 1246 | wpalSleep(WDI_WCTS_ACTION_TIMEOUT); |
| 1247 | } |
| 1248 | } |
| 1249 | fail_wcts_open: |
| 1250 | wpalEventDelete(&gWDICb.wctsActionEvent); |
| 1251 | fail_wcts_event: |
| 1252 | wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1253 | fail_power_event: |
| 1254 | WDI_DP_UtilsExit(&gWDICb); |
| 1255 | fail_dp_util_init: |
| 1256 | gWDICb.magic = 0; |
| 1257 | fail_bss_queue: |
| 1258 | /* entries 0 thru i-1 were successfully initialized */ |
| 1259 | while (0 < i) |
| 1260 | { |
| 1261 | i--; |
| 1262 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1263 | } |
| 1264 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1265 | fail_assoc_queue: |
| 1266 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
| 1267 | fail_pend_queue: |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1268 | wpalTimerDelete(&gWDICb.ssrTimer); |
| 1269 | fail_timer2: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1270 | wpalTimerDelete(&gWDICb.wptResponseTimer); |
| 1271 | fail_timer: |
| 1272 | wpalMutexDelete(&gWDICb.wptMutex); |
| 1273 | fail_mutex: |
| 1274 | wpalClose(gWDICb.pPALContext); |
| 1275 | fail_wpalOpen: |
| 1276 | WDI_STATableClose(&gWDICb); |
| 1277 | fail_STATableInit: |
| 1278 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 1279 | |
| 1280 | return WDI_STATUS_E_FAILURE; |
| 1281 | |
| 1282 | }/*WDI_Init*/; |
| 1283 | |
| 1284 | /** |
| 1285 | @brief WDI_Start will be called when the upper MAC is ready to |
| 1286 | commence operation with the WLAN Device. Upon the call |
| 1287 | of this API the WLAN DAL will pack and send a HAL Start |
| 1288 | message to the lower RIVA sub-system if the SMD channel |
| 1289 | has been fully opened and the RIVA subsystem is up. |
| 1290 | |
| 1291 | If the RIVA sub-system is not yet up and running DAL |
| 1292 | will queue the request for Open and will wait for the |
| 1293 | SMD notification before attempting to send down the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1294 | message to HAL. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1295 | |
| 1296 | WDI_Init must have been called. |
| 1297 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1298 | @param wdiStartParams: the start parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1299 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1300 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1301 | wdiStartRspCb: callback for passing back the response of |
| 1302 | the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1303 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1304 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1305 | callback |
| 1306 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1307 | @see WDI_Start |
| 1308 | @return Result of the function call |
| 1309 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1310 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1311 | WDI_Start |
| 1312 | ( |
| 1313 | WDI_StartReqParamsType* pwdiStartParams, |
| 1314 | WDI_StartRspCb wdiStartRspCb, |
| 1315 | void* pUserData |
| 1316 | ) |
| 1317 | { |
| 1318 | WDI_EventInfoType wdiEventData; |
| 1319 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1320 | |
| 1321 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1322 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1323 | ------------------------------------------------------------------------*/ |
| 1324 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1325 | { |
| 1326 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1327 | "WDI API call before module is initialized - Fail request"); |
| 1328 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1329 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1330 | } |
| 1331 | |
| 1332 | /*------------------------------------------------------------------------ |
| 1333 | Fill in Event data and post to the Main FSM |
| 1334 | ------------------------------------------------------------------------*/ |
| 1335 | wdiEventData.wdiRequest = WDI_START_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1336 | wdiEventData.pEventData = pwdiStartParams; |
| 1337 | wdiEventData.uEventDataSize = sizeof(*pwdiStartParams); |
| 1338 | wdiEventData.pCBfnc = wdiStartRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1339 | wdiEventData.pUserData = pUserData; |
| 1340 | |
| 1341 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1342 | |
| 1343 | }/*WDI_Start*/ |
| 1344 | |
| 1345 | /** |
| 1346 | @brief WDI_Stop will be called when the upper MAC is ready to |
| 1347 | stop any operation with the WLAN Device. Upon the call |
| 1348 | of this API the WLAN DAL will pack and send a HAL Stop |
| 1349 | message to the lower RIVA sub-system if the DAL Core is |
| 1350 | in started state. |
| 1351 | |
| 1352 | In state BUSY this request will be queued. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1353 | |
| 1354 | Request will not be accepted in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1355 | |
| 1356 | WDI_Start must have been called. |
| 1357 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1358 | @param wdiStopParams: the stop parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1359 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1360 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1361 | wdiStopRspCb: callback for passing back the response of |
| 1362 | the stop operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1363 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1364 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1365 | callback |
| 1366 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1367 | @see WDI_Start |
| 1368 | @return Result of the function call |
| 1369 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1370 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1371 | WDI_Stop |
| 1372 | ( |
| 1373 | WDI_StopReqParamsType* pwdiStopParams, |
| 1374 | WDI_StopRspCb wdiStopRspCb, |
| 1375 | void* pUserData |
| 1376 | ) |
| 1377 | { |
| 1378 | WDI_EventInfoType wdiEventData; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1379 | WDI_ControlBlockType* pWDICtx = &gWDICb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1380 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1381 | |
| 1382 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1383 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1384 | ------------------------------------------------------------------------*/ |
| 1385 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1386 | { |
| 1387 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1388 | "WDI API call before module is initialized - Fail request"); |
| 1389 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1390 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1391 | } |
| 1392 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1393 | /*Access to the global state must be locked before cleaning */ |
| 1394 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 1395 | |
| 1396 | /*Clear all pending request*/ |
| 1397 | WDI_ClearPendingRequests(pWDICtx); |
| 1398 | |
| 1399 | /*We have completed cleaning unlock now*/ |
| 1400 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 1401 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1402 | /* Free the global variables */ |
| 1403 | wpalMemoryFree(gpHostWlanFeatCaps); |
| 1404 | wpalMemoryFree(gpFwWlanFeatCaps); |
Madan Mohan Koyyalamudi | 3352adb | 2012-09-28 14:57:24 -0700 | [diff] [blame] | 1405 | gpHostWlanFeatCaps = NULL; |
| 1406 | gpFwWlanFeatCaps = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1407 | |
| 1408 | /*------------------------------------------------------------------------ |
| 1409 | Fill in Event data and post to the Main FSM |
| 1410 | ------------------------------------------------------------------------*/ |
| 1411 | wdiEventData.wdiRequest = WDI_STOP_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1412 | wdiEventData.pEventData = pwdiStopParams; |
| 1413 | wdiEventData.uEventDataSize = sizeof(*pwdiStopParams); |
| 1414 | wdiEventData.pCBfnc = wdiStopRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1415 | wdiEventData.pUserData = pUserData; |
| 1416 | |
| 1417 | return WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, &wdiEventData); |
| 1418 | |
| 1419 | }/*WDI_Stop*/ |
| 1420 | |
| 1421 | |
| 1422 | |
| 1423 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1424 | @brief WDI_Close will be called when the upper MAC no longer |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1425 | needs to interact with DAL. DAL will free its control |
| 1426 | block. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1427 | |
| 1428 | It is only accepted in state STOPPED. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1429 | |
| 1430 | WDI_Stop must have been called. |
| 1431 | |
| 1432 | @param none |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1433 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1434 | @see WDI_Stop |
| 1435 | @return Result of the function call |
| 1436 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1437 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1438 | WDI_Close |
| 1439 | ( |
| 1440 | void |
| 1441 | ) |
| 1442 | { |
| 1443 | wpt_uint8 i; |
| 1444 | WDI_EventInfoType wdiEventData; |
| 1445 | wpt_status wptStatus; |
| 1446 | wpt_status eventStatus; |
| 1447 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1448 | |
| 1449 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1450 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1451 | ------------------------------------------------------------------------*/ |
| 1452 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1453 | { |
| 1454 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1455 | "WDI API call before module is initialized - Fail request"); |
| 1456 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1457 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1458 | } |
| 1459 | |
| 1460 | /*Reset WCTS action event prior to posting the WDI_CLOSE_REQ |
| 1461 | (the control transport will be closed by the FSM and we'll want |
| 1462 | to wait until that completes)*/ |
| 1463 | eventStatus = wpalEventReset(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1464 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1465 | { |
| 1466 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1467 | "%s: Failed to reset WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1468 | /* fall through and try to finish closing via the FSM */ |
| 1469 | } |
| 1470 | |
| 1471 | /*------------------------------------------------------------------------ |
| 1472 | Fill in Event data and post to the Main FSM |
| 1473 | ------------------------------------------------------------------------*/ |
| 1474 | wdiEventData.wdiRequest = WDI_CLOSE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1475 | wdiEventData.pEventData = NULL; |
| 1476 | wdiEventData.uEventDataSize = 0; |
| 1477 | wdiEventData.pCBfnc = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1478 | wdiEventData.pUserData = NULL; |
| 1479 | |
| 1480 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 1481 | |
| 1482 | wptStatus = WDI_PostMainEvent(&gWDICb, WDI_CLOSE_EVENT, &wdiEventData); |
| 1483 | |
| 1484 | /*Wait for WCTS to close the control transport |
| 1485 | (but only if we were able to reset the event flag*/ |
| 1486 | if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus ) |
| 1487 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1488 | eventStatus = wpalEventWait(&gWDICb.wctsActionEvent, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1489 | WDI_WCTS_ACTION_TIMEOUT); |
| 1490 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
| 1491 | { |
| 1492 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1493 | "%s: Failed to wait on WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1494 | } |
| 1495 | } |
| 1496 | |
| 1497 | /* Destroy the WCTS action event */ |
| 1498 | wptStatus = wpalEventDelete(&gWDICb.wctsActionEvent); |
| 1499 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1500 | { |
| 1501 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1502 | "WDI Close failed to destroy an event"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1503 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1504 | } |
| 1505 | |
| 1506 | /* Destroy the Set Power State event */ |
| 1507 | wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1508 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1509 | { |
| 1510 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1511 | "WDI Close failed to destroy an event"); |
| 1512 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1513 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1514 | } |
| 1515 | |
| 1516 | /*------------------------------------------------------------------------ |
| 1517 | Closes the Data Path Utility Module |
| 1518 | ------------------------------------------------------------------------*/ |
| 1519 | if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb)) |
| 1520 | { |
| 1521 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1522 | "WDI Init failed to close the DP Util Module"); |
| 1523 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1524 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1525 | } |
| 1526 | |
| 1527 | /*destroy the BSS sessions pending Queue */ |
| 1528 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1529 | { |
| 1530 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1531 | } |
| 1532 | |
| 1533 | /* destroy the WDI Pending Assoc Id Request Queue*/ |
| 1534 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1535 | |
| 1536 | /* destroy the WDI Pending Request Queue*/ |
| 1537 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1538 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1539 | /*destroy the response timer */ |
| 1540 | wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer); |
| 1541 | |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1542 | /*destroy the SSR timer */ |
| 1543 | wptStatus = wpalTimerDelete( &gWDICb.ssrTimer); |
| 1544 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1545 | /*invalidate the main synchro mutex */ |
| 1546 | wptStatus = wpalMutexDelete(&gWDICb.wptMutex); |
| 1547 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1548 | { |
| 1549 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1550 | "Failed to delete mutex %d", wptStatus); |
| 1551 | WDI_ASSERT(0); |
| 1552 | } |
| 1553 | |
| 1554 | /*Clear control block. note that this will clear the "magic" |
| 1555 | which will inhibit all asynchronous callbacks*/ |
| 1556 | WDI_CleanCB(&gWDICb); |
| 1557 | |
| 1558 | return wptStatus; |
| 1559 | |
| 1560 | }/*WDI_Close*/ |
| 1561 | |
| 1562 | /** |
| 1563 | @brief WDI_Shutdown will be called during 'SSR shutdown' operation. |
| 1564 | This will do most of the WDI stop & close |
| 1565 | operations without doing any handshake with Riva |
| 1566 | |
| 1567 | This will also make sure that the control transport |
| 1568 | will NOT be closed. |
| 1569 | |
| 1570 | This request will not be queued. |
| 1571 | |
| 1572 | |
| 1573 | WDI_Start must have been called. |
| 1574 | |
| 1575 | @param closeTransport: Close control channel if this is set |
| 1576 | |
| 1577 | @return Result of the function call |
| 1578 | */ |
| 1579 | WDI_Status |
| 1580 | WDI_Shutdown |
| 1581 | ( |
| 1582 | wpt_boolean closeTransport |
| 1583 | ) |
| 1584 | { |
| 1585 | WDI_EventInfoType wdiEventData; |
| 1586 | wpt_status wptStatus; |
| 1587 | int i = 0; |
| 1588 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1589 | |
| 1590 | /*------------------------------------------------------------------------ |
| 1591 | Sanity Check |
| 1592 | ------------------------------------------------------------------------*/ |
| 1593 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1594 | { |
| 1595 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1596 | "WDI API call before module is initialized - Fail request"); |
| 1597 | |
| 1598 | return WDI_STATUS_E_NOT_ALLOWED; |
| 1599 | } |
| 1600 | |
| 1601 | /*------------------------------------------------------------------------ |
| 1602 | Fill in Event data and post to the Main FSM |
| 1603 | ------------------------------------------------------------------------*/ |
| 1604 | wdiEventData.wdiRequest = WDI_SHUTDOWN_REQ; |
| 1605 | wdiEventData.pEventData = NULL; |
| 1606 | wdiEventData.uEventDataSize = 0; |
| 1607 | |
| 1608 | /* Shutdown will not be queued, if the state is busy timer will be |
| 1609 | * stopped & this message will be processed.*/ |
| 1610 | wptStatus = WDI_PostMainEvent(&gWDICb, WDI_SHUTDOWN_EVENT, &wdiEventData); |
| 1611 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1612 | { |
| 1613 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1614 | "%s: Failed to process shutdown event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1615 | } |
| 1616 | /* Destroy the Set Power State event */ |
| 1617 | wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1618 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1619 | { |
| 1620 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1621 | "WDI Close failed to destroy an event"); |
| 1622 | |
| 1623 | WDI_ASSERT(0); |
| 1624 | } |
| 1625 | /*------------------------------------------------------------------------ |
| 1626 | Closes the Data Path Utility Module |
| 1627 | ------------------------------------------------------------------------*/ |
| 1628 | if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb)) |
| 1629 | { |
| 1630 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1631 | "WDI Init failed to close the DP Util Module"); |
| 1632 | |
| 1633 | WDI_ASSERT(0); |
| 1634 | } |
| 1635 | if ( closeTransport ) |
| 1636 | { |
| 1637 | /* Close control transport, called from module unload */ |
| 1638 | WCTS_CloseTransport(gWDICb.wctsHandle); |
| 1639 | } |
Madan Mohan Koyyalamudi | fab2a7e | 2012-09-28 15:20:00 -0700 | [diff] [blame] | 1640 | else |
| 1641 | { |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 1642 | /* Riva is crashed then SMD is already closed so cleaning all |
Madan Mohan Koyyalamudi | fab2a7e | 2012-09-28 15:20:00 -0700 | [diff] [blame] | 1643 | the pending messages in the transport queue */ |
| 1644 | WCTS_ClearPendingQueue(gWDICb.wctsHandle); |
| 1645 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1646 | /*destroy the BSS sessions pending Queue */ |
| 1647 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1648 | { |
| 1649 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1650 | } |
| 1651 | |
| 1652 | /* destroy the WDI Pending Assoc Id Request Queue*/ |
| 1653 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1654 | /* destroy the WDI Pending Request Queue*/ |
| 1655 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
| 1656 | /*destroy the response timer */ |
| 1657 | wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer); |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1658 | /*destroy the SSR timer */ |
| 1659 | wptStatus = wpalTimerDelete( &gWDICb.ssrTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1660 | |
| 1661 | /*invalidate the main synchro mutex */ |
| 1662 | wptStatus = wpalMutexDelete(&gWDICb.wptMutex); |
| 1663 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1664 | { |
| 1665 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1666 | "%s: Failed to delete mutex %d", __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1667 | WDI_ASSERT(0); |
| 1668 | } |
Madan Mohan Koyyalamudi | 3513bf5 | 2012-09-18 17:35:53 -0700 | [diff] [blame] | 1669 | /* Free the global variables */ |
| 1670 | wpalMemoryFree(gpHostWlanFeatCaps); |
| 1671 | wpalMemoryFree(gpFwWlanFeatCaps); |
Madan Mohan Koyyalamudi | 3352adb | 2012-09-28 14:57:24 -0700 | [diff] [blame] | 1672 | gpHostWlanFeatCaps = NULL; |
| 1673 | gpFwWlanFeatCaps = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1674 | /*Clear control block. note that this will clear the "magic" |
| 1675 | which will inhibit all asynchronous callbacks*/ |
| 1676 | WDI_CleanCB(&gWDICb); |
| 1677 | return wptStatus; |
| 1678 | |
| 1679 | }/*WDI_Shutdown*/ |
| 1680 | |
| 1681 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1682 | /*======================================================================== |
| 1683 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1684 | SCAN APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1685 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1686 | ==========================================================================*/ |
| 1687 | |
| 1688 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1689 | @brief WDI_InitScanReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1690 | the WLAN Device to get ready for a scan procedure. Upon |
| 1691 | the call of this API the WLAN DAL will pack and send a |
| 1692 | HAL Init Scan request message to the lower RIVA |
| 1693 | sub-system if DAL is in state STARTED. |
| 1694 | |
| 1695 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1696 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1697 | |
| 1698 | WDI_Start must have been called. |
| 1699 | |
| 1700 | @param wdiInitScanParams: the init scan parameters as specified |
| 1701 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1702 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1703 | wdiInitScanRspCb: callback for passing back the response |
| 1704 | of the init scan operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1705 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1706 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1707 | callback |
| 1708 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1709 | @see WDI_Start |
| 1710 | @return Result of the function call |
| 1711 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1712 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1713 | WDI_InitScanReq |
| 1714 | ( |
| 1715 | WDI_InitScanReqParamsType* pwdiInitScanParams, |
| 1716 | WDI_InitScanRspCb wdiInitScanRspCb, |
| 1717 | void* pUserData |
| 1718 | ) |
| 1719 | { |
| 1720 | WDI_EventInfoType wdiEventData; |
| 1721 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1722 | |
| 1723 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1724 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1725 | ------------------------------------------------------------------------*/ |
| 1726 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1727 | { |
| 1728 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1729 | "WDI API call before module is initialized - Fail request"); |
| 1730 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1731 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1732 | } |
| 1733 | |
| 1734 | /*------------------------------------------------------------------------ |
| 1735 | Fill in Event data and post to the Main FSM |
| 1736 | ------------------------------------------------------------------------*/ |
| 1737 | wdiEventData.wdiRequest = WDI_INIT_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1738 | wdiEventData.pEventData = pwdiInitScanParams; |
| 1739 | wdiEventData.uEventDataSize = sizeof(*pwdiInitScanParams); |
| 1740 | wdiEventData.pCBfnc = wdiInitScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1741 | wdiEventData.pUserData = pUserData; |
| 1742 | |
| 1743 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1744 | |
| 1745 | }/*WDI_InitScanReq*/ |
| 1746 | |
| 1747 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1748 | @brief WDI_StartScanReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1749 | wishes to change the Scan channel on the WLAN Device. |
| 1750 | Upon the call of this API the WLAN DAL will pack and |
| 1751 | send a HAL Start Scan request message to the lower RIVA |
| 1752 | sub-system if DAL is in state STARTED. |
| 1753 | |
| 1754 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1755 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1756 | |
| 1757 | WDI_InitScanReq must have been called. |
| 1758 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1759 | @param wdiStartScanParams: the start scan parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1760 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1761 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1762 | wdiStartScanRspCb: callback for passing back the |
| 1763 | response of the start scan operation received from the |
| 1764 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1765 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1766 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1767 | callback |
| 1768 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1769 | @see WDI_InitScanReq |
| 1770 | @return Result of the function call |
| 1771 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1772 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1773 | WDI_StartScanReq |
| 1774 | ( |
| 1775 | WDI_StartScanReqParamsType* pwdiStartScanParams, |
| 1776 | WDI_StartScanRspCb wdiStartScanRspCb, |
| 1777 | void* pUserData |
| 1778 | ) |
| 1779 | { |
| 1780 | WDI_EventInfoType wdiEventData; |
| 1781 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1782 | |
| 1783 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1784 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1785 | ------------------------------------------------------------------------*/ |
| 1786 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1787 | { |
| 1788 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1789 | "WDI API call before module is initialized - Fail request"); |
| 1790 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1791 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1792 | } |
| 1793 | |
| 1794 | /*------------------------------------------------------------------------ |
| 1795 | Fill in Event data and post to the Main FSM |
| 1796 | ------------------------------------------------------------------------*/ |
| 1797 | wdiEventData.wdiRequest = WDI_START_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1798 | wdiEventData.pEventData = pwdiStartScanParams; |
| 1799 | wdiEventData.uEventDataSize = sizeof(*pwdiStartScanParams); |
| 1800 | wdiEventData.pCBfnc = wdiStartScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1801 | wdiEventData.pUserData = pUserData; |
| 1802 | |
| 1803 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1804 | |
| 1805 | }/*WDI_StartScanReq*/ |
| 1806 | |
| 1807 | |
| 1808 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1809 | @brief WDI_EndScanReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1810 | wants to end scanning for a particular channel that it |
| 1811 | had set before by calling Scan Start on the WLAN Device. |
| 1812 | Upon the call of this API the WLAN DAL will pack and |
| 1813 | send a HAL End Scan request message to the lower RIVA |
| 1814 | sub-system if DAL is in state STARTED. |
| 1815 | |
| 1816 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1817 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1818 | |
| 1819 | WDI_StartScanReq must have been called. |
| 1820 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1821 | @param wdiEndScanParams: the end scan parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1822 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1823 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1824 | wdiEndScanRspCb: callback for passing back the response |
| 1825 | of the end scan operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1826 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1827 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1828 | callback |
| 1829 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1830 | @see WDI_StartScanReq |
| 1831 | @return Result of the function call |
| 1832 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1833 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1834 | WDI_EndScanReq |
| 1835 | ( |
| 1836 | WDI_EndScanReqParamsType* pwdiEndScanParams, |
| 1837 | WDI_EndScanRspCb wdiEndScanRspCb, |
| 1838 | void* pUserData |
| 1839 | ) |
| 1840 | { |
| 1841 | WDI_EventInfoType wdiEventData; |
| 1842 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1843 | |
| 1844 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1845 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1846 | ------------------------------------------------------------------------*/ |
| 1847 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1848 | { |
| 1849 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1850 | "WDI API call before module is initialized - Fail request"); |
| 1851 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1852 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1853 | } |
| 1854 | |
| 1855 | /*------------------------------------------------------------------------ |
| 1856 | Fill in Event data and post to the Main FSM |
| 1857 | ------------------------------------------------------------------------*/ |
| 1858 | wdiEventData.wdiRequest = WDI_END_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1859 | wdiEventData.pEventData = pwdiEndScanParams; |
| 1860 | wdiEventData.uEventDataSize = sizeof(*pwdiEndScanParams); |
| 1861 | wdiEventData.pCBfnc = wdiEndScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1862 | wdiEventData.pUserData = pUserData; |
| 1863 | |
| 1864 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1865 | |
| 1866 | }/*WDI_EndScanReq*/ |
| 1867 | |
| 1868 | |
| 1869 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1870 | @brief WDI_FinishScanReq will be called when the upper MAC has |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1871 | completed the scan process on the WLAN Device. Upon the |
| 1872 | call of this API the WLAN DAL will pack and send a HAL |
| 1873 | Finish Scan Request request message to the lower RIVA |
| 1874 | sub-system if DAL is in state STARTED. |
| 1875 | |
| 1876 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1877 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1878 | |
| 1879 | WDI_InitScanReq must have been called. |
| 1880 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1881 | @param wdiFinishScanParams: the finish scan parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1882 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1883 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1884 | wdiFinishScanRspCb: callback for passing back the |
| 1885 | response of the finish scan operation received from the |
| 1886 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1887 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1888 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1889 | callback |
| 1890 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1891 | @see WDI_InitScanReq |
| 1892 | @return Result of the function call |
| 1893 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1894 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1895 | WDI_FinishScanReq |
| 1896 | ( |
| 1897 | WDI_FinishScanReqParamsType* pwdiFinishScanParams, |
| 1898 | WDI_FinishScanRspCb wdiFinishScanRspCb, |
| 1899 | void* pUserData |
| 1900 | ) |
| 1901 | { |
| 1902 | WDI_EventInfoType wdiEventData; |
| 1903 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1904 | |
| 1905 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1906 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1907 | ------------------------------------------------------------------------*/ |
| 1908 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1909 | { |
| 1910 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1911 | "WDI API call before module is initialized - Fail request"); |
| 1912 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1913 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1914 | } |
| 1915 | |
| 1916 | /*------------------------------------------------------------------------ |
| 1917 | Fill in Event data and post to the Main FSM |
| 1918 | ------------------------------------------------------------------------*/ |
| 1919 | wdiEventData.wdiRequest = WDI_FINISH_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1920 | wdiEventData.pEventData = pwdiFinishScanParams; |
| 1921 | wdiEventData.uEventDataSize = sizeof(*pwdiFinishScanParams); |
| 1922 | wdiEventData.pCBfnc = wdiFinishScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1923 | wdiEventData.pUserData = pUserData; |
| 1924 | |
| 1925 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1926 | |
| 1927 | }/*WDI_FinishScanReq*/ |
| 1928 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1929 | /*======================================================================== |
| 1930 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1931 | ASSOCIATION APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1932 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1933 | ==========================================================================*/ |
| 1934 | |
| 1935 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1936 | @brief WDI_JoinReq will be called when the upper MAC is ready |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1937 | to start an association procedure to a BSS. Upon the |
| 1938 | call of this API the WLAN DAL will pack and send a HAL |
| 1939 | Join request message to the lower RIVA sub-system if |
| 1940 | DAL is in state STARTED. |
| 1941 | |
| 1942 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1943 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1944 | |
| 1945 | WDI_Start must have been called. |
| 1946 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1947 | @param wdiJoinParams: the join parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1948 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1949 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1950 | wdiJoinRspCb: callback for passing back the response of |
| 1951 | the join operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1952 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1953 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1954 | callback |
| 1955 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1956 | @see WDI_Start |
| 1957 | @return Result of the function call |
| 1958 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1959 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1960 | WDI_JoinReq |
| 1961 | ( |
| 1962 | WDI_JoinReqParamsType* pwdiJoinParams, |
| 1963 | WDI_JoinRspCb wdiJoinRspCb, |
| 1964 | void* pUserData |
| 1965 | ) |
| 1966 | { |
| 1967 | WDI_EventInfoType wdiEventData; |
| 1968 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1969 | |
| 1970 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1971 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1972 | ------------------------------------------------------------------------*/ |
| 1973 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1974 | { |
| 1975 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1976 | "WDI API call before module is initialized - Fail request"); |
| 1977 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1978 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1979 | } |
| 1980 | |
| 1981 | /*------------------------------------------------------------------------ |
| 1982 | Fill in Event data and post to the Main FSM |
| 1983 | ------------------------------------------------------------------------*/ |
| 1984 | wdiEventData.wdiRequest = WDI_JOIN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1985 | wdiEventData.pEventData = pwdiJoinParams; |
| 1986 | wdiEventData.uEventDataSize = sizeof(*pwdiJoinParams); |
| 1987 | wdiEventData.pCBfnc = wdiJoinRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1988 | wdiEventData.pUserData = pUserData; |
| 1989 | |
| 1990 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1991 | |
| 1992 | }/*WDI_JoinReq*/ |
| 1993 | |
| 1994 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1995 | @brief WDI_ConfigBSSReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1996 | wishes to configure the newly acquired or in process of |
| 1997 | being acquired BSS to the HW . Upon the call of this API |
| 1998 | the WLAN DAL will pack and send a HAL Config BSS request |
| 1999 | message to the lower RIVA sub-system if DAL is in state |
| 2000 | STARTED. |
| 2001 | |
| 2002 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2003 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2004 | |
| 2005 | WDI_JoinReq must have been called. |
| 2006 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2007 | @param wdiConfigBSSParams: the config BSS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2008 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2009 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2010 | wdiConfigBSSRspCb: callback for passing back the |
| 2011 | response of the config BSS operation received from the |
| 2012 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2013 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2014 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2015 | callback |
| 2016 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2017 | @see WDI_JoinReq |
| 2018 | @return Result of the function call |
| 2019 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2020 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2021 | WDI_ConfigBSSReq |
| 2022 | ( |
| 2023 | WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams, |
| 2024 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb, |
| 2025 | void* pUserData |
| 2026 | ) |
| 2027 | { |
| 2028 | WDI_EventInfoType wdiEventData; |
| 2029 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2030 | |
| 2031 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2032 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2033 | ------------------------------------------------------------------------*/ |
| 2034 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2035 | { |
| 2036 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2037 | "WDI API call before module is initialized - Fail request"); |
| 2038 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2039 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2040 | } |
| 2041 | |
| 2042 | /*------------------------------------------------------------------------ |
| 2043 | Fill in Event data and post to the Main FSM |
| 2044 | ------------------------------------------------------------------------*/ |
| 2045 | wdiEventData.wdiRequest = WDI_CONFIG_BSS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2046 | wdiEventData.pEventData = pwdiConfigBSSParams; |
| 2047 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigBSSParams); |
| 2048 | wdiEventData.pCBfnc = wdiConfigBSSRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2049 | wdiEventData.pUserData = pUserData; |
| 2050 | |
| 2051 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2052 | |
| 2053 | }/*WDI_ConfigBSSReq*/ |
| 2054 | |
| 2055 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2056 | @brief WDI_DelBSSReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2057 | disassociating from the BSS and wishes to notify HW. |
| 2058 | Upon the call of this API the WLAN DAL will pack and |
| 2059 | send a HAL Del BSS request message to the lower RIVA |
| 2060 | sub-system if DAL is in state STARTED. |
| 2061 | |
| 2062 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2063 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2064 | |
| 2065 | WDI_ConfigBSSReq or WDI_PostAssocReq must have been called. |
| 2066 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2067 | @param wdiDelBSSParams: the del BSS parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2068 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2069 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2070 | wdiDelBSSRspCb: callback for passing back the response |
| 2071 | of the del bss operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2072 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2073 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2074 | callback |
| 2075 | |
| 2076 | @see WDI_ConfigBSSReq, WDI_PostAssocReq |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2077 | @return Result of the function call |
| 2078 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2079 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2080 | WDI_DelBSSReq |
| 2081 | ( |
| 2082 | WDI_DelBSSReqParamsType* pwdiDelBSSParams, |
| 2083 | WDI_DelBSSRspCb wdiDelBSSRspCb, |
| 2084 | void* pUserData |
| 2085 | ) |
| 2086 | { |
| 2087 | WDI_EventInfoType wdiEventData; |
| 2088 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2089 | |
| 2090 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2091 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2092 | ------------------------------------------------------------------------*/ |
| 2093 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2094 | { |
| 2095 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2096 | "WDI API call before module is initialized - Fail request"); |
| 2097 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2098 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2099 | } |
| 2100 | |
| 2101 | /*------------------------------------------------------------------------ |
| 2102 | Fill in Event data and post to the Main FSM |
| 2103 | ------------------------------------------------------------------------*/ |
| 2104 | wdiEventData.wdiRequest = WDI_DEL_BSS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2105 | wdiEventData.pEventData = pwdiDelBSSParams; |
| 2106 | wdiEventData.uEventDataSize = sizeof(*pwdiDelBSSParams); |
| 2107 | wdiEventData.pCBfnc = wdiDelBSSRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2108 | wdiEventData.pUserData = pUserData; |
| 2109 | |
| 2110 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2111 | |
| 2112 | }/*WDI_DelBSSReq*/ |
| 2113 | |
| 2114 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2115 | @brief WDI_PostAssocReq will be called when the upper MAC has |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2116 | associated to a BSS and wishes to configure HW for |
| 2117 | associated state. Upon the call of this API the WLAN DAL |
| 2118 | will pack and send a HAL Post Assoc request message to |
| 2119 | the lower RIVA sub-system if DAL is in state STARTED. |
| 2120 | |
| 2121 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2122 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2123 | |
| 2124 | WDI_JoinReq must have been called. |
| 2125 | |
| 2126 | @param wdiPostAssocReqParams: the assoc parameters as specified |
| 2127 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2128 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2129 | wdiPostAssocRspCb: callback for passing back the |
| 2130 | response of the post assoc operation received from the |
| 2131 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2132 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2133 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2134 | callback |
| 2135 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2136 | @see WDI_JoinReq |
| 2137 | @return Result of the function call |
| 2138 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2139 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2140 | WDI_PostAssocReq |
| 2141 | ( |
| 2142 | WDI_PostAssocReqParamsType* pwdiPostAssocReqParams, |
| 2143 | WDI_PostAssocRspCb wdiPostAssocRspCb, |
| 2144 | void* pUserData |
| 2145 | ) |
| 2146 | { |
| 2147 | WDI_EventInfoType wdiEventData; |
| 2148 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2149 | |
| 2150 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2151 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2152 | ------------------------------------------------------------------------*/ |
| 2153 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2154 | { |
| 2155 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2156 | "WDI API call before module is initialized - Fail request"); |
| 2157 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2158 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2159 | } |
| 2160 | |
| 2161 | /*------------------------------------------------------------------------ |
| 2162 | Fill in Event data and post to the Main FSM |
| 2163 | ------------------------------------------------------------------------*/ |
| 2164 | wdiEventData.wdiRequest = WDI_POST_ASSOC_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2165 | wdiEventData.pEventData = pwdiPostAssocReqParams; |
| 2166 | wdiEventData.uEventDataSize = sizeof(*pwdiPostAssocReqParams); |
| 2167 | wdiEventData.pCBfnc = wdiPostAssocRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2168 | wdiEventData.pUserData = pUserData; |
| 2169 | |
| 2170 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2171 | |
| 2172 | }/*WDI_PostAssocReq*/ |
| 2173 | |
| 2174 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2175 | @brief WDI_DelSTAReq will be called when the upper MAC when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2176 | association with another STA has ended and the station |
| 2177 | must be deleted from HW. Upon the call of this API the |
| 2178 | WLAN DAL will pack and send a HAL Del STA request |
| 2179 | message to the lower RIVA sub-system if DAL is in state |
| 2180 | STARTED. |
| 2181 | |
| 2182 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2183 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2184 | |
| 2185 | WDI_PostAssocReq must have been called. |
| 2186 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2187 | @param wdiDelSTAParams: the Del STA parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2188 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2189 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2190 | wdiDelSTARspCb: callback for passing back the response |
| 2191 | of the del STA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2192 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2193 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2194 | callback |
| 2195 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2196 | @see WDI_PostAssocReq |
| 2197 | @return Result of the function call |
| 2198 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2199 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2200 | WDI_DelSTAReq |
| 2201 | ( |
| 2202 | WDI_DelSTAReqParamsType* pwdiDelSTAParams, |
| 2203 | WDI_DelSTARspCb wdiDelSTARspCb, |
| 2204 | void* pUserData |
| 2205 | ) |
| 2206 | { |
| 2207 | WDI_EventInfoType wdiEventData; |
| 2208 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2209 | |
| 2210 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2211 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2212 | ------------------------------------------------------------------------*/ |
| 2213 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2214 | { |
| 2215 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2216 | "WDI API call before module is initialized - Fail request"); |
| 2217 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2218 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2219 | } |
| 2220 | |
| 2221 | /*------------------------------------------------------------------------ |
| 2222 | Fill in Event data and post to the Main FSM |
| 2223 | ------------------------------------------------------------------------*/ |
| 2224 | wdiEventData.wdiRequest = WDI_DEL_STA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2225 | wdiEventData.pEventData = pwdiDelSTAParams; |
| 2226 | wdiEventData.uEventDataSize = sizeof(*pwdiDelSTAParams); |
| 2227 | wdiEventData.pCBfnc = wdiDelSTARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2228 | wdiEventData.pUserData = pUserData; |
| 2229 | |
| 2230 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2231 | |
| 2232 | }/*WDI_DelSTAReq*/ |
| 2233 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2234 | /*======================================================================== |
| 2235 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2236 | SECURITY APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2237 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2238 | ==========================================================================*/ |
| 2239 | |
| 2240 | /** |
| 2241 | @brief WDI_SetBSSKeyReq will be called when the upper MAC wants to |
| 2242 | install a BSS encryption key on the HW. Upon the call of this |
| 2243 | API the WLAN DAL will pack and send a Set BSS Key request |
| 2244 | message to the lower RIVA sub-system if DAL is in state |
| 2245 | STARTED. |
| 2246 | |
| 2247 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2248 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2249 | |
| 2250 | WDI_PostAssocReq must have been called. |
| 2251 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2252 | @param wdiSetBSSKeyParams: the BSS Key set parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2253 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2254 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2255 | wdiSetBSSKeyRspCb: callback for passing back the |
| 2256 | response of the set BSS Key operation received from the |
| 2257 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2258 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2259 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2260 | callback |
| 2261 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2262 | @see WDI_PostAssocReq |
| 2263 | @return Result of the function call |
| 2264 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2265 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2266 | WDI_SetBSSKeyReq |
| 2267 | ( |
| 2268 | WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams, |
| 2269 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb, |
| 2270 | void* pUserData |
| 2271 | ) |
| 2272 | { |
| 2273 | WDI_EventInfoType wdiEventData; |
| 2274 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2275 | |
| 2276 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2277 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2278 | ------------------------------------------------------------------------*/ |
| 2279 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2280 | { |
| 2281 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2282 | "WDI API call before module is initialized - Fail request"); |
| 2283 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2284 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2285 | } |
| 2286 | |
| 2287 | /*------------------------------------------------------------------------ |
| 2288 | Fill in Event data and post to the Main FSM |
| 2289 | ------------------------------------------------------------------------*/ |
| 2290 | wdiEventData.wdiRequest = WDI_SET_BSS_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2291 | wdiEventData.pEventData = pwdiSetBSSKeyParams; |
| 2292 | wdiEventData.uEventDataSize = sizeof(*pwdiSetBSSKeyParams); |
| 2293 | wdiEventData.pCBfnc = wdiSetBSSKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2294 | wdiEventData.pUserData = pUserData; |
| 2295 | |
| 2296 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2297 | |
| 2298 | }/*WDI_SetBSSKeyReq*/ |
| 2299 | |
| 2300 | /** |
| 2301 | @brief WDI_RemoveBSSKeyReq will be called when the upper MAC wants to |
| 2302 | uninstall a BSS key from HW. Upon the call of this API the |
| 2303 | WLAN DAL will pack and send a HAL Remove BSS Key request |
| 2304 | message to the lower RIVA sub-system if DAL is in state |
| 2305 | STARTED. |
| 2306 | |
| 2307 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2308 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2309 | |
| 2310 | WDI_SetBSSKeyReq must have been called. |
| 2311 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2312 | @param wdiRemoveBSSKeyParams: the remove BSS key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2313 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2314 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2315 | wdiRemoveBSSKeyRspCb: callback for passing back the |
| 2316 | response of the remove BSS key operation received from |
| 2317 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2318 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2319 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2320 | callback |
| 2321 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2322 | @see WDI_SetBSSKeyReq |
| 2323 | @return Result of the function call |
| 2324 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2325 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2326 | WDI_RemoveBSSKeyReq |
| 2327 | ( |
| 2328 | WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams, |
| 2329 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb, |
| 2330 | void* pUserData |
| 2331 | ) |
| 2332 | { |
| 2333 | WDI_EventInfoType wdiEventData; |
| 2334 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2335 | |
| 2336 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2337 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2338 | ------------------------------------------------------------------------*/ |
| 2339 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2340 | { |
| 2341 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2342 | "WDI API call before module is initialized - Fail request"); |
| 2343 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2344 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2345 | } |
| 2346 | |
| 2347 | /*------------------------------------------------------------------------ |
| 2348 | Fill in Event data and post to the Main FSM |
| 2349 | ------------------------------------------------------------------------*/ |
| 2350 | wdiEventData.wdiRequest = WDI_RMV_BSS_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2351 | wdiEventData.pEventData = pwdiRemoveBSSKeyParams; |
| 2352 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveBSSKeyParams); |
| 2353 | wdiEventData.pCBfnc = wdiRemoveBSSKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2354 | wdiEventData.pUserData = pUserData; |
| 2355 | |
| 2356 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2357 | |
| 2358 | }/*WDI_RemoveBSSKeyReq*/ |
| 2359 | |
| 2360 | |
| 2361 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2362 | @brief WDI_SetSTAKeyReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2363 | ready to install a STA(ast) encryption key in HW. Upon |
| 2364 | the call of this API the WLAN DAL will pack and send a |
| 2365 | HAL Set STA Key request message to the lower RIVA |
| 2366 | sub-system if DAL is in state STARTED. |
| 2367 | |
| 2368 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2369 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2370 | |
| 2371 | WDI_PostAssocReq must have been called. |
| 2372 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2373 | @param wdiSetSTAKeyParams: the set STA key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2374 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2375 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2376 | wdiSetSTAKeyRspCb: callback for passing back the |
| 2377 | response of the set STA key operation received from the |
| 2378 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2379 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2380 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2381 | callback |
| 2382 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2383 | @see WDI_PostAssocReq |
| 2384 | @return Result of the function call |
| 2385 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2386 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2387 | WDI_SetSTAKeyReq |
| 2388 | ( |
| 2389 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams, |
| 2390 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb, |
| 2391 | void* pUserData |
| 2392 | ) |
| 2393 | { |
| 2394 | WDI_EventInfoType wdiEventData; |
| 2395 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2396 | |
| 2397 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2398 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2399 | ------------------------------------------------------------------------*/ |
| 2400 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2401 | { |
| 2402 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2403 | "WDI API call before module is initialized - Fail request"); |
| 2404 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2405 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2406 | } |
| 2407 | |
| 2408 | /*------------------------------------------------------------------------ |
| 2409 | Fill in Event data and post to the Main FSM |
| 2410 | ------------------------------------------------------------------------*/ |
| 2411 | wdiEventData.wdiRequest = WDI_SET_STA_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2412 | wdiEventData.pEventData = pwdiSetSTAKeyParams; |
| 2413 | wdiEventData.uEventDataSize = sizeof(*pwdiSetSTAKeyParams); |
| 2414 | wdiEventData.pCBfnc = wdiSetSTAKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2415 | wdiEventData.pUserData = pUserData; |
| 2416 | |
| 2417 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2418 | |
| 2419 | }/*WDI_SetSTAKeyReq*/ |
| 2420 | |
| 2421 | |
| 2422 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2423 | @brief WDI_RemoveSTAKeyReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2424 | wants to uninstall a previously set STA key in HW. Upon |
| 2425 | the call of this API the WLAN DAL will pack and send a |
| 2426 | HAL Remove STA Key request message to the lower RIVA |
| 2427 | sub-system if DAL is in state STARTED. |
| 2428 | |
| 2429 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2430 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2431 | |
| 2432 | WDI_SetSTAKeyReq must have been called. |
| 2433 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2434 | @param wdiRemoveSTAKeyParams: the remove STA key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2435 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2436 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2437 | wdiRemoveSTAKeyRspCb: callback for passing back the |
| 2438 | response of the remove STA key operation received from |
| 2439 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2440 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2441 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2442 | callback |
| 2443 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2444 | @see WDI_SetSTAKeyReq |
| 2445 | @return Result of the function call |
| 2446 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2447 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2448 | WDI_RemoveSTAKeyReq |
| 2449 | ( |
| 2450 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams, |
| 2451 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb, |
| 2452 | void* pUserData |
| 2453 | ) |
| 2454 | { |
| 2455 | WDI_EventInfoType wdiEventData; |
| 2456 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2457 | |
| 2458 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2459 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2460 | ------------------------------------------------------------------------*/ |
| 2461 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2462 | { |
| 2463 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2464 | "WDI API call before module is initialized - Fail request"); |
| 2465 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2466 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2467 | } |
| 2468 | |
| 2469 | /*------------------------------------------------------------------------ |
| 2470 | Fill in Event data and post to the Main FSM |
| 2471 | ------------------------------------------------------------------------*/ |
| 2472 | wdiEventData.wdiRequest = WDI_RMV_STA_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2473 | wdiEventData.pEventData = pwdiRemoveSTAKeyParams; |
| 2474 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTAKeyParams); |
| 2475 | wdiEventData.pCBfnc = wdiRemoveSTAKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2476 | wdiEventData.pUserData = pUserData; |
| 2477 | |
| 2478 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2479 | |
| 2480 | }/*WDI_RemoveSTAKeyReq*/ |
| 2481 | |
| 2482 | |
| 2483 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2484 | @brief WDI_SetSTABcastKeyReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2485 | wants to install a STA Bcast encryption key on the HW. |
| 2486 | Upon the call of this API the WLAN DAL will pack and |
| 2487 | send a HAL Start request message to the lower RIVA |
| 2488 | sub-system if DAL is in state STARTED. |
| 2489 | |
| 2490 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2491 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2492 | |
| 2493 | WDI_PostAssocReq must have been called. |
| 2494 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2495 | @param pwdiSetSTABcastKeyParams: the BSS Key set parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2496 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2497 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2498 | wdiSetSTABcastKeyRspCb: callback for passing back the |
| 2499 | response of the set BSS Key operation received from the |
| 2500 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2501 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2502 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2503 | callback |
| 2504 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2505 | @see WDI_PostAssocReq |
| 2506 | @return Result of the function call |
| 2507 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2508 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2509 | WDI_SetSTABcastKeyReq |
| 2510 | ( |
| 2511 | WDI_SetSTAKeyReqParamsType* pwdiSetSTABcastKeyParams, |
| 2512 | WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb, |
| 2513 | void* pUserData |
| 2514 | ) |
| 2515 | |
| 2516 | { |
| 2517 | WDI_EventInfoType wdiEventData; |
| 2518 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2519 | |
| 2520 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2521 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2522 | ------------------------------------------------------------------------*/ |
| 2523 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2524 | { |
| 2525 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2526 | "WDI API call before module is initialized - Fail request"); |
| 2527 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2528 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2529 | } |
| 2530 | |
| 2531 | /*------------------------------------------------------------------------ |
| 2532 | Fill in Event data and post to the Main FSM |
| 2533 | ------------------------------------------------------------------------*/ |
| 2534 | wdiEventData.wdiRequest = WDI_SET_STA_BCAST_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2535 | wdiEventData.pEventData = pwdiSetSTABcastKeyParams; |
| 2536 | wdiEventData.uEventDataSize = sizeof(*pwdiSetSTABcastKeyParams); |
| 2537 | wdiEventData.pCBfnc = wdiSetSTABcastKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2538 | wdiEventData.pUserData = pUserData; |
| 2539 | |
| 2540 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2541 | |
| 2542 | }/*WDI_SetSTABcastKeyReq*/ |
| 2543 | |
| 2544 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2545 | @brief WDI_RemoveSTABcastKeyReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2546 | MAC wants to uninstall a STA Bcast key from HW. Upon the |
| 2547 | call of this API the WLAN DAL will pack and send a HAL |
| 2548 | Remove STA Bcast Key request message to the lower RIVA |
| 2549 | sub-system if DAL is in state STARTED. |
| 2550 | |
| 2551 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2552 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2553 | |
| 2554 | WDI_SetSTABcastKeyReq must have been called. |
| 2555 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2556 | @param pwdiRemoveSTABcastKeyParams: the remove BSS key |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2557 | parameters as specified by the Device |
| 2558 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2559 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2560 | wdiRemoveSTABcastKeyRspCb: callback for passing back the |
| 2561 | response of the remove STA Bcast key operation received |
| 2562 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2563 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2564 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2565 | callback |
| 2566 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2567 | @see WDI_SetSTABcastKeyReq |
| 2568 | @return Result of the function call |
| 2569 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2570 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2571 | WDI_RemoveSTABcastKeyReq |
| 2572 | ( |
| 2573 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams, |
| 2574 | WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb, |
| 2575 | void* pUserData |
| 2576 | ) |
| 2577 | { |
| 2578 | WDI_EventInfoType wdiEventData; |
| 2579 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2580 | |
| 2581 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2582 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2583 | ------------------------------------------------------------------------*/ |
| 2584 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2585 | { |
| 2586 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2587 | "WDI API call before module is initialized - Fail request"); |
| 2588 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2589 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2590 | } |
| 2591 | |
| 2592 | /*------------------------------------------------------------------------ |
| 2593 | Fill in Event data and post to the Main FSM |
| 2594 | ------------------------------------------------------------------------*/ |
| 2595 | wdiEventData.wdiRequest = WDI_RMV_STA_BCAST_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2596 | wdiEventData.pEventData = pwdiRemoveSTABcastKeyParams; |
| 2597 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTABcastKeyParams); |
| 2598 | wdiEventData.pCBfnc = wdiRemoveSTABcastKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2599 | wdiEventData.pUserData = pUserData; |
| 2600 | |
| 2601 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2602 | |
| 2603 | }/*WDI_RemoveSTABcastKeyReq*/ |
| 2604 | |
| 2605 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2606 | @brief WDI_SetMaxTxPowerReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2607 | MAC wants to set Max Tx Power to HW. Upon the |
| 2608 | call of this API the WLAN DAL will pack and send a HAL |
| 2609 | Remove STA Bcast Key request message to the lower RIVA |
| 2610 | sub-system if DAL is in state STARTED. |
| 2611 | |
| 2612 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2613 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2614 | |
| 2615 | WDI_SetSTABcastKeyReq must have been called. |
| 2616 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2617 | @param pwdiRemoveSTABcastKeyParams: the remove BSS key |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2618 | parameters as specified by the Device |
| 2619 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2620 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2621 | wdiRemoveSTABcastKeyRspCb: callback for passing back the |
| 2622 | response of the remove STA Bcast key operation received |
| 2623 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2624 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2625 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2626 | callback |
| 2627 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2628 | @see WDI_SetMaxTxPowerReq |
| 2629 | @return Result of the function call |
| 2630 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2631 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2632 | WDI_SetMaxTxPowerReq |
| 2633 | ( |
| 2634 | WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams, |
| 2635 | WDA_SetMaxTxPowerRspCb wdiReqStatusCb, |
| 2636 | void* pUserData |
| 2637 | ) |
| 2638 | { |
| 2639 | WDI_EventInfoType wdiEventData; |
| 2640 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2641 | |
| 2642 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2643 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2644 | ------------------------------------------------------------------------*/ |
| 2645 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2646 | { |
| 2647 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2648 | "WDI API call before module is initialized - Fail request"); |
| 2649 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2650 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2651 | } |
| 2652 | |
| 2653 | /*------------------------------------------------------------------------ |
| 2654 | Fill in Event data and post to the Main FSM |
| 2655 | ------------------------------------------------------------------------*/ |
| 2656 | wdiEventData.wdiRequest = WDI_SET_MAX_TX_POWER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2657 | wdiEventData.pEventData = pwdiSetMaxTxPowerParams; |
| 2658 | wdiEventData.uEventDataSize = sizeof(*pwdiSetMaxTxPowerParams); |
| 2659 | wdiEventData.pCBfnc = wdiReqStatusCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2660 | wdiEventData.pUserData = pUserData; |
| 2661 | |
| 2662 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2663 | } |
| 2664 | |
| 2665 | #ifdef FEATURE_WLAN_CCX |
| 2666 | WDI_Status |
| 2667 | WDI_TSMStatsReq |
| 2668 | ( |
| 2669 | WDI_TSMStatsReqParamsType* pwdiTsmReqParams, |
| 2670 | WDI_TsmRspCb wdiReqStatusCb, |
| 2671 | void* pUserData |
| 2672 | ) |
| 2673 | { |
| 2674 | WDI_EventInfoType wdiEventData; |
| 2675 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2676 | /*------------------------------------------------------------------------ |
| 2677 | Sanity Check |
| 2678 | ------------------------------------------------------------------------*/ |
| 2679 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2680 | { |
| 2681 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2682 | "WDI API call before module is initialized - Fail request"); |
| 2683 | |
| 2684 | return WDI_STATUS_E_NOT_ALLOWED; |
| 2685 | } |
| 2686 | |
| 2687 | /*------------------------------------------------------------------------ |
| 2688 | Fill in Event data and post to the Main FSM |
| 2689 | ------------------------------------------------------------------------*/ |
| 2690 | wdiEventData.wdiRequest = WDI_TSM_STATS_REQ; |
| 2691 | wdiEventData.pEventData = pwdiTsmReqParams; |
| 2692 | wdiEventData.uEventDataSize = sizeof(*pwdiTsmReqParams); |
| 2693 | wdiEventData.pCBfnc = wdiReqStatusCb; |
| 2694 | wdiEventData.pUserData = pUserData; |
| 2695 | |
| 2696 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2697 | |
| 2698 | } |
| 2699 | #endif |
| 2700 | |
| 2701 | /*======================================================================== |
| 2702 | |
| 2703 | QoS and BA APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2704 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2705 | ==========================================================================*/ |
| 2706 | |
| 2707 | /** |
| 2708 | @brief WDI_AddTSReq will be called when the upper MAC to inform |
| 2709 | the device of a successful add TSpec negotiation. HW |
| 2710 | needs to receive the TSpec Info from the UMAC in order |
| 2711 | to configure properly the QoS data traffic. Upon the |
| 2712 | call of this API the WLAN DAL will pack and send a HAL |
| 2713 | Add TS request message to the lower RIVA sub-system if |
| 2714 | DAL is in state STARTED. |
| 2715 | |
| 2716 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2717 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2718 | |
| 2719 | WDI_PostAssocReq must have been called. |
| 2720 | |
| 2721 | @param wdiAddTsReqParams: the add TS parameters as specified by |
| 2722 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2723 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2724 | wdiAddTsRspCb: callback for passing back the response of |
| 2725 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2726 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2727 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2728 | callback |
| 2729 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2730 | @see WDI_PostAssocReq |
| 2731 | @return Result of the function call |
| 2732 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2733 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2734 | WDI_AddTSReq |
| 2735 | ( |
| 2736 | WDI_AddTSReqParamsType* pwdiAddTsReqParams, |
| 2737 | WDI_AddTsRspCb wdiAddTsRspCb, |
| 2738 | void* pUserData |
| 2739 | ) |
| 2740 | { |
| 2741 | WDI_EventInfoType wdiEventData; |
| 2742 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2743 | |
| 2744 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2745 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2746 | ------------------------------------------------------------------------*/ |
| 2747 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2748 | { |
| 2749 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2750 | "WDI API call before module is initialized - Fail request"); |
| 2751 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2752 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2753 | } |
| 2754 | |
| 2755 | /*------------------------------------------------------------------------ |
| 2756 | Fill in Event data and post to the Main FSM |
| 2757 | ------------------------------------------------------------------------*/ |
| 2758 | wdiEventData.wdiRequest = WDI_ADD_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2759 | wdiEventData.pEventData = pwdiAddTsReqParams; |
| 2760 | wdiEventData.uEventDataSize = sizeof(*pwdiAddTsReqParams); |
| 2761 | wdiEventData.pCBfnc = wdiAddTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2762 | wdiEventData.pUserData = pUserData; |
| 2763 | |
| 2764 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2765 | |
| 2766 | }/*WDI_AddTSReq*/ |
| 2767 | |
| 2768 | |
| 2769 | |
| 2770 | /** |
| 2771 | @brief WDI_DelTSReq will be called when the upper MAC has ended |
| 2772 | admission on a specific AC. This is to inform HW that |
| 2773 | QoS traffic parameters must be rest. Upon the call of |
| 2774 | this API the WLAN DAL will pack and send a HAL Del TS |
| 2775 | request message to the lower RIVA sub-system if DAL is |
| 2776 | in state STARTED. |
| 2777 | |
| 2778 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2779 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2780 | |
| 2781 | WDI_AddTSReq must have been called. |
| 2782 | |
| 2783 | @param wdiDelTsReqParams: the del TS parameters as specified by |
| 2784 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2785 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2786 | wdiDelTsRspCb: callback for passing back the response of |
| 2787 | the del TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2788 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2789 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2790 | callback |
| 2791 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2792 | @see WDI_AddTSReq |
| 2793 | @return Result of the function call |
| 2794 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2795 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2796 | WDI_DelTSReq |
| 2797 | ( |
| 2798 | WDI_DelTSReqParamsType* pwdiDelTsReqParams, |
| 2799 | WDI_DelTsRspCb wdiDelTsRspCb, |
| 2800 | void* pUserData |
| 2801 | ) |
| 2802 | { |
| 2803 | WDI_EventInfoType wdiEventData; |
| 2804 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2805 | |
| 2806 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2807 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2808 | ------------------------------------------------------------------------*/ |
| 2809 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2810 | { |
| 2811 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2812 | "WDI API call before module is initialized - Fail request"); |
| 2813 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2814 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2815 | } |
| 2816 | |
| 2817 | /*------------------------------------------------------------------------ |
| 2818 | Fill in Event data and post to the Main FSM |
| 2819 | ------------------------------------------------------------------------*/ |
| 2820 | wdiEventData.wdiRequest = WDI_DEL_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2821 | wdiEventData.pEventData = pwdiDelTsReqParams; |
| 2822 | wdiEventData.uEventDataSize = sizeof(*pwdiDelTsReqParams); |
| 2823 | wdiEventData.pCBfnc = wdiDelTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2824 | wdiEventData.pUserData = pUserData; |
| 2825 | |
| 2826 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2827 | |
| 2828 | }/*WDI_DelTSReq*/ |
| 2829 | |
| 2830 | |
| 2831 | |
| 2832 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2833 | @brief WDI_UpdateEDCAParams will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2834 | wishes to update the EDCA parameters used by HW for QoS |
| 2835 | data traffic. Upon the call of this API the WLAN DAL |
| 2836 | will pack and send a HAL Update EDCA Params request |
| 2837 | message to the lower RIVA sub-system if DAL is in state |
| 2838 | STARTED. |
| 2839 | |
| 2840 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2841 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2842 | |
| 2843 | WDI_PostAssocReq must have been called. |
| 2844 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2845 | @param wdiUpdateEDCAParams: the start parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2846 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2847 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2848 | wdiUpdateEDCAParamsRspCb: callback for passing back the |
| 2849 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2850 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2851 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2852 | callback |
| 2853 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2854 | @see WDI_PostAssocReq |
| 2855 | @return Result of the function call |
| 2856 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2857 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2858 | WDI_UpdateEDCAParams |
| 2859 | ( |
| 2860 | WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams, |
| 2861 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb, |
| 2862 | void* pUserData |
| 2863 | ) |
| 2864 | { |
| 2865 | WDI_EventInfoType wdiEventData; |
| 2866 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2867 | |
| 2868 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2869 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2870 | ------------------------------------------------------------------------*/ |
| 2871 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2872 | { |
| 2873 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2874 | "WDI API call before module is initialized - Fail request"); |
| 2875 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2876 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2877 | } |
| 2878 | |
| 2879 | /*------------------------------------------------------------------------ |
| 2880 | Fill in Event data and post to the Main FSM |
| 2881 | ------------------------------------------------------------------------*/ |
| 2882 | wdiEventData.wdiRequest = WDI_UPD_EDCA_PRMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2883 | wdiEventData.pEventData = pwdiUpdateEDCAParams; |
| 2884 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateEDCAParams); |
| 2885 | wdiEventData.pCBfnc = wdiUpdateEDCAParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2886 | wdiEventData.pUserData = pUserData; |
| 2887 | |
| 2888 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2889 | |
| 2890 | }/*WDI_UpdateEDCAParams*/ |
| 2891 | |
| 2892 | |
| 2893 | /** |
| 2894 | @brief WDI_AddBASessionReq will be called when the upper MAC has setup |
| 2895 | successfully a BA session and needs to notify the HW for |
| 2896 | the appropriate settings to take place. Upon the call of |
| 2897 | this API the WLAN DAL will pack and send a HAL Add BA |
| 2898 | request message to the lower RIVA sub-system if DAL is |
| 2899 | in state STARTED. |
| 2900 | |
| 2901 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2902 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2903 | |
| 2904 | WDI_PostAssocReq must have been called. |
| 2905 | |
| 2906 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 2907 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2908 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2909 | wdiAddBARspCb: callback for passing back the response of |
| 2910 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2911 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2912 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2913 | callback |
| 2914 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2915 | @see WDI_PostAssocReq |
| 2916 | @return Result of the function call |
| 2917 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2918 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2919 | WDI_AddBASessionReq |
| 2920 | ( |
| 2921 | WDI_AddBASessionReqParamsType* pwdiAddBASessionReqParams, |
| 2922 | WDI_AddBASessionRspCb wdiAddBASessionRspCb, |
| 2923 | void* pUserData |
| 2924 | ) |
| 2925 | { |
| 2926 | WDI_EventInfoType wdiEventData; |
| 2927 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2928 | |
| 2929 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2930 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2931 | ------------------------------------------------------------------------*/ |
| 2932 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2933 | { |
| 2934 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2935 | "WDI API call before module is initialized - Fail request"); |
| 2936 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2937 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2938 | } |
| 2939 | |
| 2940 | /*------------------------------------------------------------------------ |
| 2941 | Fill in Event data and post to the Main FSM |
| 2942 | ------------------------------------------------------------------------*/ |
| 2943 | wdiEventData.wdiRequest = WDI_ADD_BA_SESSION_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2944 | wdiEventData.pEventData = pwdiAddBASessionReqParams; |
| 2945 | wdiEventData.uEventDataSize = sizeof(*pwdiAddBASessionReqParams); |
| 2946 | wdiEventData.pCBfnc = wdiAddBASessionRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2947 | wdiEventData.pUserData = pUserData; |
| 2948 | |
| 2949 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2950 | |
| 2951 | }/*WDI_AddBASessionReq*/ |
| 2952 | |
| 2953 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2954 | @brief WDI_DelBAReq will be called when the upper MAC wants to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2955 | inform HW that it has deleted a previously created BA |
| 2956 | session. Upon the call of this API the WLAN DAL will |
| 2957 | pack and send a HAL Del BA request message to the lower |
| 2958 | RIVA sub-system if DAL is in state STARTED. |
| 2959 | |
| 2960 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2961 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2962 | |
| 2963 | WDI_AddBAReq must have been called. |
| 2964 | |
| 2965 | @param wdiDelBAReqParams: the del BA parameters as specified by |
| 2966 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2967 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2968 | wdiDelBARspCb: callback for passing back the response of |
| 2969 | the del BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2970 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2971 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2972 | callback |
| 2973 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2974 | @see WDI_AddBAReq |
| 2975 | @return Result of the function call |
| 2976 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2977 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2978 | WDI_DelBAReq |
| 2979 | ( |
| 2980 | WDI_DelBAReqParamsType* pwdiDelBAReqParams, |
| 2981 | WDI_DelBARspCb wdiDelBARspCb, |
| 2982 | void* pUserData |
| 2983 | ) |
| 2984 | { |
| 2985 | WDI_EventInfoType wdiEventData; |
| 2986 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2987 | |
| 2988 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2989 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2990 | ------------------------------------------------------------------------*/ |
| 2991 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2992 | { |
| 2993 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2994 | "WDI API call before module is initialized - Fail request"); |
| 2995 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2996 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2997 | } |
| 2998 | |
| 2999 | /*------------------------------------------------------------------------ |
| 3000 | Fill in Event data and post to the Main FSM |
| 3001 | ------------------------------------------------------------------------*/ |
| 3002 | wdiEventData.wdiRequest = WDI_DEL_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3003 | wdiEventData.pEventData = pwdiDelBAReqParams; |
| 3004 | wdiEventData.uEventDataSize = sizeof(*pwdiDelBAReqParams); |
| 3005 | wdiEventData.pCBfnc = wdiDelBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3006 | wdiEventData.pUserData = pUserData; |
| 3007 | |
| 3008 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3009 | |
| 3010 | }/*WDI_DelBAReq*/ |
| 3011 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3012 | /*======================================================================== |
| 3013 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3014 | Power Save APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3015 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3016 | ==========================================================================*/ |
| 3017 | |
| 3018 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3019 | @brief WDI_SetPwrSaveCfgReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3020 | wants to set the power save related configurations of |
| 3021 | the WLAN Device. Upon the call of this API the WLAN DAL |
| 3022 | will pack and send a HAL Update CFG request message to |
| 3023 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3024 | |
| 3025 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3026 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3027 | |
| 3028 | WDI_Start must have been called. |
| 3029 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3030 | @param pwdiPowerSaveCfg: the power save cfg parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3031 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3032 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3033 | wdiSetPwrSaveCfgCb: callback for passing back the |
| 3034 | response of the set power save cfg operation received |
| 3035 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3036 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3037 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3038 | callback |
| 3039 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3040 | @see WDI_Start |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3041 | @return Result of the function call |
| 3042 | */ |
| 3043 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3044 | WDI_SetPwrSaveCfgReq |
| 3045 | ( |
| 3046 | WDI_UpdateCfgReqParamsType* pwdiPowerSaveCfg, |
| 3047 | WDI_SetPwrSaveCfgCb wdiSetPwrSaveCfgCb, |
| 3048 | void* pUserData |
| 3049 | ) |
| 3050 | { |
| 3051 | WDI_EventInfoType wdiEventData; |
| 3052 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3053 | |
| 3054 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3055 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3056 | ------------------------------------------------------------------------*/ |
| 3057 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3058 | { |
| 3059 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3060 | "WDI API call before module is initialized - Fail request"); |
| 3061 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3062 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3063 | } |
| 3064 | |
| 3065 | /*------------------------------------------------------------------------ |
| 3066 | Fill in Event data and post to the Main FSM |
| 3067 | ------------------------------------------------------------------------*/ |
| 3068 | wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3069 | wdiEventData.pEventData = pwdiPowerSaveCfg; |
| 3070 | wdiEventData.uEventDataSize = sizeof(*pwdiPowerSaveCfg); |
| 3071 | wdiEventData.pCBfnc = wdiSetPwrSaveCfgCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3072 | wdiEventData.pUserData = pUserData; |
| 3073 | |
| 3074 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3075 | |
| 3076 | }/*WDI_SetPwrSaveCfgReq*/ |
| 3077 | |
| 3078 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3079 | @brief WDI_EnterImpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3080 | request the device to get into IMPS power state. Upon |
| 3081 | the call of this API the WLAN DAL will send a HAL Enter |
| 3082 | IMPS request message to the lower RIVA sub-system if DAL |
| 3083 | is in state STARTED. |
| 3084 | |
| 3085 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3086 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3087 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3088 | |
| 3089 | @param wdiEnterImpsRspCb: callback for passing back the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3090 | response of the Enter IMPS operation received from the |
| 3091 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3092 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3093 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3094 | callback |
| 3095 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3096 | @see WDI_Start |
| 3097 | @return Result of the function call |
| 3098 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3099 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3100 | WDI_EnterImpsReq |
| 3101 | ( |
| 3102 | WDI_EnterImpsRspCb wdiEnterImpsRspCb, |
| 3103 | void* pUserData |
| 3104 | ) |
| 3105 | { |
| 3106 | WDI_EventInfoType wdiEventData; |
| 3107 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3108 | |
| 3109 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3110 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3111 | ------------------------------------------------------------------------*/ |
| 3112 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3113 | { |
| 3114 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3115 | "WDI API call before module is initialized - Fail request"); |
| 3116 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3117 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3118 | } |
| 3119 | |
| 3120 | /*------------------------------------------------------------------------ |
| 3121 | Fill in Event data and post to the Main FSM |
| 3122 | ------------------------------------------------------------------------*/ |
| 3123 | wdiEventData.wdiRequest = WDI_ENTER_IMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3124 | wdiEventData.pEventData = NULL; |
| 3125 | wdiEventData.uEventDataSize = 0; |
| 3126 | wdiEventData.pCBfnc = wdiEnterImpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3127 | wdiEventData.pUserData = pUserData; |
| 3128 | |
| 3129 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3130 | |
| 3131 | }/*WDI_EnterImpsReq*/ |
| 3132 | |
| 3133 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3134 | @brief WDI_ExitImpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3135 | request the device to get out of IMPS power state. Upon |
| 3136 | the call of this API the WLAN DAL will send a HAL Exit |
| 3137 | IMPS request message to the lower RIVA sub-system if DAL |
| 3138 | is in state STARTED. |
| 3139 | |
| 3140 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3141 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3142 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3143 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3144 | |
| 3145 | @param wdiExitImpsRspCb: callback for passing back the response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3146 | of the Exit IMPS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3147 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3148 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3149 | callback |
| 3150 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3151 | @see WDI_Start |
| 3152 | @return Result of the function call |
| 3153 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3154 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3155 | WDI_ExitImpsReq |
| 3156 | ( |
| 3157 | WDI_ExitImpsRspCb wdiExitImpsRspCb, |
| 3158 | void* pUserData |
| 3159 | ) |
| 3160 | { |
| 3161 | WDI_EventInfoType wdiEventData; |
| 3162 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3163 | |
| 3164 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3165 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3166 | ------------------------------------------------------------------------*/ |
| 3167 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3168 | { |
| 3169 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3170 | "WDI API call before module is initialized - Fail request"); |
| 3171 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3172 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3173 | } |
| 3174 | |
| 3175 | /*------------------------------------------------------------------------ |
| 3176 | Fill in Event data and post to the Main FSM |
| 3177 | ------------------------------------------------------------------------*/ |
| 3178 | wdiEventData.wdiRequest = WDI_EXIT_IMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3179 | wdiEventData.pEventData = NULL; |
| 3180 | wdiEventData.uEventDataSize = 0; |
| 3181 | wdiEventData.pCBfnc = wdiExitImpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3182 | wdiEventData.pUserData = pUserData; |
| 3183 | |
| 3184 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3185 | |
| 3186 | }/*WDI_ExitImpsReq*/ |
| 3187 | |
| 3188 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3189 | @brief WDI_EnterBmpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3190 | request the device to get into BMPS power state. Upon |
| 3191 | the call of this API the WLAN DAL will pack and send a |
| 3192 | HAL Enter BMPS request message to the lower RIVA |
| 3193 | sub-system if DAL is in state STARTED. |
| 3194 | |
| 3195 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3196 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3197 | |
| 3198 | WDI_PostAssocReq must have been called. |
| 3199 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3200 | @param pwdiEnterBmpsReqParams: the Enter BMPS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3201 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3202 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3203 | wdiEnterBmpsRspCb: callback for passing back the |
| 3204 | response of the Enter BMPS operation received from the |
| 3205 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3206 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3207 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3208 | callback |
| 3209 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3210 | @see WDI_PostAssocReq |
| 3211 | @return Result of the function call |
| 3212 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3213 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3214 | WDI_EnterBmpsReq |
| 3215 | ( |
| 3216 | WDI_EnterBmpsReqParamsType *pwdiEnterBmpsReqParams, |
| 3217 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb, |
| 3218 | void* pUserData |
| 3219 | ) |
| 3220 | { |
| 3221 | WDI_EventInfoType wdiEventData; |
| 3222 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3223 | |
| 3224 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3225 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3226 | ------------------------------------------------------------------------*/ |
| 3227 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3228 | { |
| 3229 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3230 | "WDI API call before module is initialized - Fail request"); |
| 3231 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3232 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3233 | } |
| 3234 | |
| 3235 | /*------------------------------------------------------------------------ |
| 3236 | Fill in Event data and post to the Main FSM |
| 3237 | ------------------------------------------------------------------------*/ |
| 3238 | wdiEventData.wdiRequest = WDI_ENTER_BMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3239 | wdiEventData.pEventData = pwdiEnterBmpsReqParams; |
| 3240 | wdiEventData.uEventDataSize = sizeof(*pwdiEnterBmpsReqParams); |
| 3241 | wdiEventData.pCBfnc = wdiEnterBmpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3242 | wdiEventData.pUserData = pUserData; |
| 3243 | |
| 3244 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3245 | |
| 3246 | }/*WDI_EnterBmpsReq*/ |
| 3247 | |
| 3248 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3249 | @brief WDI_ExitBmpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3250 | request the device to get out of BMPS power state. Upon |
| 3251 | the call of this API the WLAN DAL will pack and send a |
| 3252 | HAL Exit BMPS request message to the lower RIVA |
| 3253 | sub-system if DAL is in state STARTED. |
| 3254 | |
| 3255 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3256 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3257 | |
| 3258 | WDI_PostAssocReq must have been called. |
| 3259 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3260 | @param pwdiExitBmpsReqParams: the Exit BMPS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3261 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3262 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3263 | wdiExitBmpsRspCb: callback for passing back the response |
| 3264 | of the Exit BMPS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3265 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3266 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3267 | callback |
| 3268 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3269 | @see WDI_PostAssocReq |
| 3270 | @return Result of the function call |
| 3271 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3272 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3273 | WDI_ExitBmpsReq |
| 3274 | ( |
| 3275 | WDI_ExitBmpsReqParamsType *pwdiExitBmpsReqParams, |
| 3276 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb, |
| 3277 | void* pUserData |
| 3278 | ) |
| 3279 | { |
| 3280 | WDI_EventInfoType wdiEventData; |
| 3281 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3282 | |
| 3283 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3284 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3285 | ------------------------------------------------------------------------*/ |
| 3286 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3287 | { |
| 3288 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3289 | "WDI API call before module is initialized - Fail request"); |
| 3290 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3291 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3292 | } |
| 3293 | |
| 3294 | /*------------------------------------------------------------------------ |
| 3295 | Fill in Event data and post to the Main FSM |
| 3296 | ------------------------------------------------------------------------*/ |
| 3297 | wdiEventData.wdiRequest = WDI_EXIT_BMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3298 | wdiEventData.pEventData = pwdiExitBmpsReqParams; |
| 3299 | wdiEventData.uEventDataSize = sizeof(*pwdiExitBmpsReqParams); |
| 3300 | wdiEventData.pCBfnc = wdiExitBmpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3301 | wdiEventData.pUserData = pUserData; |
| 3302 | |
| 3303 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3304 | |
| 3305 | }/*WDI_ExitBmpsReq*/ |
| 3306 | |
| 3307 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3308 | @brief WDI_EnterUapsdReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3309 | request the device to get into UAPSD power state. Upon |
| 3310 | the call of this API the WLAN DAL will pack and send a |
| 3311 | HAL Enter UAPSD request message to the lower RIVA |
| 3312 | sub-system if DAL is in state STARTED. |
| 3313 | |
| 3314 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3315 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3316 | |
| 3317 | WDI_PostAssocReq must have been called. |
| 3318 | WDI_SetUapsdAcParamsReq must have been called. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3319 | |
| 3320 | @param pwdiEnterUapsdReqParams: the Enter UAPSD parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3321 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3322 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3323 | wdiEnterUapsdRspCb: callback for passing back the |
| 3324 | response of the Enter UAPSD operation received from the |
| 3325 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3326 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3327 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3328 | callback |
| 3329 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3330 | @see WDI_PostAssocReq, WDI_SetUapsdAcParamsReq |
| 3331 | @return Result of the function call |
| 3332 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3333 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3334 | WDI_EnterUapsdReq |
| 3335 | ( |
| 3336 | WDI_EnterUapsdReqParamsType *pwdiEnterUapsdReqParams, |
| 3337 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb, |
| 3338 | void* pUserData |
| 3339 | ) |
| 3340 | { |
| 3341 | WDI_EventInfoType wdiEventData; |
| 3342 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3343 | |
| 3344 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3345 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3346 | ------------------------------------------------------------------------*/ |
| 3347 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3348 | { |
| 3349 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3350 | "WDI API call before module is initialized - Fail request"); |
| 3351 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3352 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3353 | } |
| 3354 | |
| 3355 | /*------------------------------------------------------------------------ |
| 3356 | Fill in Event data and post to the Main FSM |
| 3357 | ------------------------------------------------------------------------*/ |
| 3358 | wdiEventData.wdiRequest = WDI_ENTER_UAPSD_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3359 | wdiEventData.pEventData = pwdiEnterUapsdReqParams; |
| 3360 | wdiEventData.uEventDataSize = sizeof(*pwdiEnterUapsdReqParams); |
| 3361 | wdiEventData.pCBfnc = wdiEnterUapsdRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3362 | wdiEventData.pUserData = pUserData; |
| 3363 | |
| 3364 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3365 | |
| 3366 | }/*WDI_EnterUapsdReq*/ |
| 3367 | |
| 3368 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3369 | @brief WDI_ExitUapsdReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3370 | request the device to get out of UAPSD power state. Upon |
| 3371 | the call of this API the WLAN DAL will send a HAL Exit |
| 3372 | UAPSD request message to the lower RIVA sub-system if |
| 3373 | DAL is in state STARTED. |
| 3374 | |
| 3375 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3376 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3377 | |
| 3378 | WDI_PostAssocReq must have been called. |
| 3379 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3380 | @param wdiExitUapsdRspCb: callback for passing back the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3381 | response of the Exit UAPSD operation received from the |
| 3382 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3383 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3384 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3385 | callback |
| 3386 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3387 | @see WDI_PostAssocReq |
| 3388 | @return Result of the function call |
| 3389 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3390 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3391 | WDI_ExitUapsdReq |
| 3392 | ( |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 3393 | WDI_ExitUapsdReqParamsType *pwdiExitUapsdReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3394 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb, |
| 3395 | void* pUserData |
| 3396 | ) |
| 3397 | { |
| 3398 | WDI_EventInfoType wdiEventData; |
| 3399 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3400 | |
| 3401 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3402 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3403 | ------------------------------------------------------------------------*/ |
| 3404 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3405 | { |
| 3406 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3407 | "WDI API call before module is initialized - Fail request"); |
| 3408 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3409 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3410 | } |
| 3411 | |
| 3412 | /*------------------------------------------------------------------------ |
| 3413 | Fill in Event data and post to the Main FSM |
| 3414 | ------------------------------------------------------------------------*/ |
| 3415 | wdiEventData.wdiRequest = WDI_EXIT_UAPSD_REQ; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 3416 | wdiEventData.pEventData = pwdiExitUapsdReqParams; |
| 3417 | wdiEventData.uEventDataSize = sizeof(*pwdiExitUapsdReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3418 | wdiEventData.pCBfnc = wdiExitUapsdRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3419 | wdiEventData.pUserData = pUserData; |
| 3420 | |
| 3421 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3422 | |
| 3423 | }/*WDI_ExitUapsdReq*/ |
| 3424 | |
| 3425 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3426 | @brief WDI_UpdateUapsdParamsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3427 | MAC wants to set the UAPSD related configurations |
| 3428 | of an associated STA (while acting as an AP) to the WLAN |
| 3429 | Device. Upon the call of this API the WLAN DAL will pack |
| 3430 | and send a HAL Update UAPSD params request message to |
| 3431 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3432 | |
| 3433 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3434 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3435 | |
| 3436 | WDI_ConfigBSSReq must have been called. |
| 3437 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3438 | @param pwdiUpdateUapsdReqParams: the UAPSD parameters |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3439 | as specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3440 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3441 | wdiUpdateUapsdParamsCb: callback for passing back the |
| 3442 | response of the update UAPSD params operation received |
| 3443 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3444 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3445 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3446 | callback |
| 3447 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3448 | @see WDI_ConfigBSSReq |
| 3449 | @return Result of the function call |
| 3450 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3451 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3452 | WDI_UpdateUapsdParamsReq |
| 3453 | ( |
| 3454 | WDI_UpdateUapsdReqParamsType *pwdiUpdateUapsdReqParams, |
| 3455 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb, |
| 3456 | void* pUserData |
| 3457 | ) |
| 3458 | { |
| 3459 | WDI_EventInfoType wdiEventData; |
| 3460 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3461 | |
| 3462 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3463 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3464 | ------------------------------------------------------------------------*/ |
| 3465 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3466 | { |
| 3467 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3468 | "WDI API call before module is initialized - Fail request"); |
| 3469 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3470 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3471 | } |
| 3472 | |
| 3473 | /*------------------------------------------------------------------------ |
| 3474 | Fill in Event data and post to the Main FSM |
| 3475 | ------------------------------------------------------------------------*/ |
| 3476 | wdiEventData.wdiRequest = WDI_UPDATE_UAPSD_PARAM_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3477 | wdiEventData.pEventData = pwdiUpdateUapsdReqParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3478 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateUapsdReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3479 | wdiEventData.pCBfnc = wdiUpdateUapsdParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3480 | wdiEventData.pUserData = pUserData; |
| 3481 | |
| 3482 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3483 | |
| 3484 | }/*WDI_UpdateUapsdParamsReq*/ |
| 3485 | |
| 3486 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3487 | @brief WDI_SetUapsdAcParamsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3488 | MAC wants to set the UAPSD related configurations before |
| 3489 | requesting for enter UAPSD power state to the WLAN |
| 3490 | Device. Upon the call of this API the WLAN DAL will pack |
| 3491 | and send a HAL Set UAPSD params request message to |
| 3492 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3493 | |
| 3494 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3495 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3496 | |
| 3497 | WDI_PostAssocReq must have been called. |
| 3498 | |
| 3499 | @param pwdiUapsdInfo: the UAPSD parameters as specified by |
| 3500 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3501 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3502 | wdiSetUapsdAcParamsCb: callback for passing back the |
| 3503 | response of the set UAPSD params operation received from |
| 3504 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3505 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3506 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3507 | callback |
| 3508 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3509 | @see WDI_PostAssocReq |
| 3510 | @return Result of the function call |
| 3511 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3512 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3513 | WDI_SetUapsdAcParamsReq |
| 3514 | ( |
| 3515 | WDI_SetUapsdAcParamsReqParamsType* pwdiUapsdInfo, |
| 3516 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb, |
| 3517 | void* pUserData |
| 3518 | ) |
| 3519 | { |
| 3520 | WDI_EventInfoType wdiEventData; |
| 3521 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3522 | |
| 3523 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3524 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3525 | ------------------------------------------------------------------------*/ |
| 3526 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3527 | { |
| 3528 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3529 | "WDI API call before module is initialized - Fail request"); |
| 3530 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3531 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3532 | } |
| 3533 | |
| 3534 | /*------------------------------------------------------------------------ |
| 3535 | Fill in Event data and post to the Main FSM |
| 3536 | ------------------------------------------------------------------------*/ |
| 3537 | wdiEventData.wdiRequest = WDI_SET_UAPSD_PARAM_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3538 | wdiEventData.pEventData = pwdiUapsdInfo; |
| 3539 | wdiEventData.uEventDataSize = sizeof(*pwdiUapsdInfo); |
| 3540 | wdiEventData.pCBfnc = wdiSetUapsdAcParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3541 | wdiEventData.pUserData = pUserData; |
| 3542 | |
| 3543 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3544 | |
| 3545 | }/*WDI_SetUapsdAcParamsReq*/ |
| 3546 | |
| 3547 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3548 | @brief WDI_ConfigureRxpFilterReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3549 | MAC wants to set/reset the RXP filters for received pkts |
| 3550 | (MC, BC etc.). Upon the call of this API the WLAN DAL will pack |
| 3551 | and send a HAL configure RXP filter request message to |
| 3552 | the lower RIVA sub-system. |
| 3553 | |
| 3554 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3555 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3556 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3557 | |
| 3558 | @param pwdiConfigureRxpFilterReqParams: the RXP |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3559 | filter as specified by the Device |
| 3560 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3561 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3562 | wdiConfigureRxpFilterCb: callback for passing back the |
| 3563 | response of the configure RXP filter operation received |
| 3564 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3565 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3566 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3567 | callback |
| 3568 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3569 | @return Result of the function call |
| 3570 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3571 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3572 | WDI_ConfigureRxpFilterReq |
| 3573 | ( |
| 3574 | WDI_ConfigureRxpFilterReqParamsType *pwdiConfigureRxpFilterReqParams, |
| 3575 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb, |
| 3576 | void* pUserData |
| 3577 | ) |
| 3578 | { |
| 3579 | WDI_EventInfoType wdiEventData; |
| 3580 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3581 | |
| 3582 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3583 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3584 | ------------------------------------------------------------------------*/ |
| 3585 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3586 | { |
| 3587 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3588 | "WDI API call before module is initialized - Fail request"); |
| 3589 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3590 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3591 | } |
| 3592 | |
| 3593 | /*------------------------------------------------------------------------ |
| 3594 | Fill in Event data and post to the Main FSM |
| 3595 | ------------------------------------------------------------------------*/ |
| 3596 | wdiEventData.wdiRequest = WDI_CONFIGURE_RXP_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3597 | wdiEventData.pEventData = pwdiConfigureRxpFilterReqParams; |
| 3598 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigureRxpFilterReqParams); |
| 3599 | wdiEventData.pCBfnc = wdiConfigureRxpFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3600 | wdiEventData.pUserData = pUserData; |
| 3601 | |
| 3602 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3603 | }/*WDI_ConfigureRxpFilterReq*/ |
| 3604 | |
| 3605 | /** |
| 3606 | @brief WDI_SetBeaconFilterReq will be called when the upper MAC |
| 3607 | wants to set the beacon filters while in power save. |
| 3608 | Upon the call of this API the WLAN DAL will pack and |
| 3609 | send a Beacon filter request message to the |
| 3610 | lower RIVA sub-system. |
| 3611 | |
| 3612 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3613 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3614 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3615 | |
| 3616 | @param pwdiBeaconFilterReqParams: the beacon |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3617 | filter as specified by the Device |
| 3618 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3619 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3620 | wdiBeaconFilterCb: callback for passing back the |
| 3621 | response of the set beacon filter operation received |
| 3622 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3623 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3624 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3625 | callback |
| 3626 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3627 | @return Result of the function call |
| 3628 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3629 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3630 | WDI_SetBeaconFilterReq |
| 3631 | ( |
| 3632 | WDI_BeaconFilterReqParamsType *pwdiBeaconFilterReqParams, |
| 3633 | WDI_SetBeaconFilterCb wdiBeaconFilterCb, |
| 3634 | void* pUserData |
| 3635 | ) |
| 3636 | { |
| 3637 | WDI_EventInfoType wdiEventData; |
| 3638 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3639 | |
| 3640 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3641 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3642 | ------------------------------------------------------------------------*/ |
| 3643 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3644 | { |
| 3645 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3646 | "WDI API call before module is initialized - Fail request"); |
| 3647 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3648 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3649 | } |
| 3650 | |
| 3651 | /*------------------------------------------------------------------------ |
| 3652 | Fill in Event data and post to the Main FSM |
| 3653 | ------------------------------------------------------------------------*/ |
| 3654 | wdiEventData.wdiRequest = WDI_SET_BEACON_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3655 | wdiEventData.pEventData = pwdiBeaconFilterReqParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3656 | wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3657 | wdiEventData.pCBfnc = wdiBeaconFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3658 | wdiEventData.pUserData = pUserData; |
| 3659 | |
| 3660 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3661 | }/*WDI_SetBeaconFilterReq*/ |
| 3662 | |
| 3663 | /** |
| 3664 | @brief WDI_RemBeaconFilterReq will be called when the upper MAC |
| 3665 | wants to remove the beacon filter for particular IE |
| 3666 | while in power save. Upon the call of this API the WLAN |
| 3667 | DAL will pack and send a remove Beacon filter request |
| 3668 | message to the lower RIVA sub-system. |
| 3669 | |
| 3670 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3671 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3672 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3673 | |
| 3674 | @param pwdiBeaconFilterReqParams: the beacon |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3675 | filter as specified by the Device |
| 3676 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3677 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3678 | wdiBeaconFilterCb: callback for passing back the |
| 3679 | response of the remove beacon filter operation received |
| 3680 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3681 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3682 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3683 | callback |
| 3684 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3685 | @return Result of the function call |
| 3686 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3687 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3688 | WDI_RemBeaconFilterReq |
| 3689 | ( |
| 3690 | WDI_RemBeaconFilterReqParamsType *pwdiBeaconFilterReqParams, |
| 3691 | WDI_RemBeaconFilterCb wdiBeaconFilterCb, |
| 3692 | void* pUserData |
| 3693 | ) |
| 3694 | { |
| 3695 | WDI_EventInfoType wdiEventData; |
| 3696 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3697 | |
| 3698 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3699 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3700 | ------------------------------------------------------------------------*/ |
| 3701 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3702 | { |
| 3703 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3704 | "WDI API call before module is initialized - Fail request"); |
| 3705 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3706 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3707 | } |
| 3708 | |
| 3709 | /*------------------------------------------------------------------------ |
| 3710 | Fill in Event data and post to the Main FSM |
| 3711 | ------------------------------------------------------------------------*/ |
| 3712 | wdiEventData.wdiRequest = WDI_REM_BEACON_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3713 | wdiEventData.pEventData = pwdiBeaconFilterReqParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3714 | wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3715 | wdiEventData.pCBfnc = wdiBeaconFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3716 | wdiEventData.pUserData = pUserData; |
| 3717 | |
| 3718 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3719 | }/*WDI_RemBeaconFilterReq*/ |
| 3720 | |
| 3721 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3722 | @brief WDI_SetRSSIThresholdsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3723 | MAC wants to set the RSSI thresholds related |
| 3724 | configurations while in power save. Upon the call of |
| 3725 | this API the WLAN DAL will pack and send a HAL Set RSSI |
| 3726 | thresholds request message to the lower RIVA |
| 3727 | sub-system if DAL is in state STARTED. |
| 3728 | |
| 3729 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3730 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3731 | |
| 3732 | WDI_PostAssocReq must have been called. |
| 3733 | |
| 3734 | @param pwdiUapsdInfo: the UAPSD parameters as specified by |
| 3735 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3736 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3737 | wdiSetUapsdAcParamsCb: callback for passing back the |
| 3738 | response of the set UAPSD params operation received from |
| 3739 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3740 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3741 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3742 | callback |
| 3743 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3744 | @see WDI_PostAssocReq |
| 3745 | @return Result of the function call |
| 3746 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3747 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3748 | WDI_SetRSSIThresholdsReq |
| 3749 | ( |
| 3750 | WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams, |
| 3751 | WDI_SetRSSIThresholdsCb wdiSetRSSIThresholdsCb, |
| 3752 | void* pUserData |
| 3753 | ) |
| 3754 | { |
| 3755 | WDI_EventInfoType wdiEventData; |
| 3756 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3757 | |
| 3758 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3759 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3760 | ------------------------------------------------------------------------*/ |
| 3761 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3762 | { |
| 3763 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3764 | "WDI API call before module is initialized - Fail request"); |
| 3765 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3766 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3767 | } |
| 3768 | |
| 3769 | /*------------------------------------------------------------------------ |
| 3770 | Fill in Event data and post to the Main FSM |
| 3771 | ------------------------------------------------------------------------*/ |
| 3772 | wdiEventData.wdiRequest = WDI_SET_RSSI_THRESHOLDS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3773 | wdiEventData.pEventData = pwdiRSSIThresholdsParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3774 | wdiEventData.uEventDataSize = sizeof(*pwdiRSSIThresholdsParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3775 | wdiEventData.pCBfnc = wdiSetRSSIThresholdsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3776 | wdiEventData.pUserData = pUserData; |
| 3777 | |
| 3778 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3779 | }/* WDI_SetRSSIThresholdsReq*/ |
| 3780 | |
| 3781 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3782 | @brief WDI_HostOffloadReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3783 | wants to set the filter to minimize unnecessary host |
| 3784 | wakeup due to broadcast traffic while in power save. |
| 3785 | Upon the call of this API the WLAN DAL will pack and |
| 3786 | send a HAL host offload request message to the |
| 3787 | lower RIVA sub-system if DAL is in state STARTED. |
| 3788 | |
| 3789 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3790 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3791 | |
| 3792 | WDI_PostAssocReq must have been called. |
| 3793 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3794 | @param pwdiHostOffloadParams: the host offload as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3795 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3796 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3797 | wdiHostOffloadCb: callback for passing back the response |
| 3798 | of the host offload operation received from the |
| 3799 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3800 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3801 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3802 | callback |
| 3803 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3804 | @see WDI_PostAssocReq |
| 3805 | @return Result of the function call |
| 3806 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3807 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3808 | WDI_HostOffloadReq |
| 3809 | ( |
| 3810 | WDI_HostOffloadReqParamsType* pwdiHostOffloadParams, |
| 3811 | WDI_HostOffloadCb wdiHostOffloadCb, |
| 3812 | void* pUserData |
| 3813 | ) |
| 3814 | { |
| 3815 | WDI_EventInfoType wdiEventData; |
| 3816 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3817 | |
| 3818 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3819 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3820 | ------------------------------------------------------------------------*/ |
| 3821 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3822 | { |
| 3823 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3824 | "WDI API call before module is initialized - Fail request"); |
| 3825 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3826 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3827 | } |
| 3828 | |
| 3829 | /*------------------------------------------------------------------------ |
| 3830 | Fill in Event data and post to the Main FSM |
| 3831 | ------------------------------------------------------------------------*/ |
| 3832 | wdiEventData.wdiRequest = WDI_HOST_OFFLOAD_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3833 | wdiEventData.pEventData = pwdiHostOffloadParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3834 | wdiEventData.uEventDataSize = sizeof(*pwdiHostOffloadParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3835 | wdiEventData.pCBfnc = wdiHostOffloadCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3836 | wdiEventData.pUserData = pUserData; |
| 3837 | |
| 3838 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3839 | }/*WDI_HostOffloadReq*/ |
| 3840 | |
| 3841 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3842 | @brief WDI_KeepAliveReq will be called when the upper MAC |
| 3843 | wants to set the filter to send NULL or unsolicited ARP responses |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3844 | and minimize unnecessary host wakeups due to while in power save. |
| 3845 | Upon the call of this API the WLAN DAL will pack and |
| 3846 | send a HAL Keep Alive request message to the |
| 3847 | lower RIVA sub-system if DAL is in state STARTED. |
| 3848 | |
| 3849 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3850 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3851 | |
| 3852 | WDI_PostAssocReq must have been called. |
| 3853 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3854 | @param pwdiKeepAliveParams: the Keep Alive as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3855 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3856 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3857 | wdiKeepAliveCb: callback for passing back the response |
| 3858 | of the Keep Alive operation received from the |
| 3859 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3860 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3861 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3862 | callback |
| 3863 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3864 | @see WDI_PostAssocReq |
| 3865 | @return Result of the function call |
| 3866 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3867 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3868 | WDI_KeepAliveReq |
| 3869 | ( |
| 3870 | WDI_KeepAliveReqParamsType* pwdiKeepAliveParams, |
| 3871 | WDI_KeepAliveCb wdiKeepAliveCb, |
| 3872 | void* pUserData |
| 3873 | ) |
| 3874 | { |
| 3875 | WDI_EventInfoType wdiEventData; |
| 3876 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3877 | |
| 3878 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3879 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3880 | ------------------------------------------------------------------------*/ |
| 3881 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3882 | { |
| 3883 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3884 | "WDI_KeepAliveReq: WDI API call before module " |
| 3885 | "is initialized - Fail request"); |
| 3886 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3887 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3888 | } |
| 3889 | |
| 3890 | /*------------------------------------------------------------------------ |
| 3891 | Fill in Event data and post to the Main FSM |
| 3892 | ------------------------------------------------------------------------*/ |
| 3893 | wdiEventData.wdiRequest = WDI_KEEP_ALIVE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3894 | wdiEventData.pEventData = pwdiKeepAliveParams; |
| 3895 | wdiEventData.uEventDataSize = sizeof(*pwdiKeepAliveParams); |
| 3896 | wdiEventData.pCBfnc = wdiKeepAliveCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3897 | wdiEventData.pUserData = pUserData; |
| 3898 | |
| 3899 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3900 | }/*WDI_KeepAliveReq*/ |
| 3901 | |
| 3902 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3903 | @brief WDI_WowlAddBcPtrnReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3904 | wants to set the Wowl Bcast ptrn to minimize unnecessary |
| 3905 | host wakeup due to broadcast traffic while in power |
| 3906 | save. Upon the call of this API the WLAN DAL will pack |
| 3907 | and send a HAL Wowl Bcast ptrn request message to the |
| 3908 | lower RIVA sub-system if DAL is in state STARTED. |
| 3909 | |
| 3910 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3911 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3912 | |
| 3913 | WDI_PostAssocReq must have been called. |
| 3914 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3915 | @param pwdiWowlAddBcPtrnParams: the Wowl bcast ptrn as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3916 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3917 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3918 | wdiWowlAddBcPtrnCb: callback for passing back the |
| 3919 | response of the add Wowl bcast ptrn operation received |
| 3920 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3921 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3922 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3923 | callback |
| 3924 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3925 | @see WDI_PostAssocReq |
| 3926 | @return Result of the function call |
| 3927 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3928 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3929 | WDI_WowlAddBcPtrnReq |
| 3930 | ( |
| 3931 | WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams, |
| 3932 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb, |
| 3933 | void* pUserData |
| 3934 | ) |
| 3935 | { |
| 3936 | WDI_EventInfoType wdiEventData; |
| 3937 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3938 | |
| 3939 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3940 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3941 | ------------------------------------------------------------------------*/ |
| 3942 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3943 | { |
| 3944 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3945 | "WDI API call before module is initialized - Fail request"); |
| 3946 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3947 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3948 | } |
| 3949 | |
| 3950 | /*------------------------------------------------------------------------ |
| 3951 | Fill in Event data and post to the Main FSM |
| 3952 | ------------------------------------------------------------------------*/ |
| 3953 | wdiEventData.wdiRequest = WDI_WOWL_ADD_BC_PTRN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3954 | wdiEventData.pEventData = pwdiWowlAddBcPtrnParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3955 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlAddBcPtrnParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3956 | wdiEventData.pCBfnc = wdiWowlAddBcPtrnCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3957 | wdiEventData.pUserData = pUserData; |
| 3958 | |
| 3959 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3960 | }/*WDI_WowlAddBcPtrnReq*/ |
| 3961 | |
| 3962 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3963 | @brief WDI_WowlDelBcPtrnReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3964 | wants to clear the Wowl Bcast ptrn. Upon the call of |
| 3965 | this API the WLAN DAL will pack and send a HAL delete |
| 3966 | Wowl Bcast ptrn request message to the lower RIVA |
| 3967 | sub-system if DAL is in state STARTED. |
| 3968 | |
| 3969 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3970 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3971 | |
| 3972 | WDI_WowlAddBcPtrnReq must have been called. |
| 3973 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3974 | @param pwdiWowlDelBcPtrnParams: the Wowl bcast ptrn as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3975 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3976 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3977 | wdiWowlDelBcPtrnCb: callback for passing back the |
| 3978 | response of the del Wowl bcast ptrn operation received |
| 3979 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3980 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3981 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3982 | callback |
| 3983 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3984 | @see WDI_WowlAddBcPtrnReq |
| 3985 | @return Result of the function call |
| 3986 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3987 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3988 | WDI_WowlDelBcPtrnReq |
| 3989 | ( |
| 3990 | WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams, |
| 3991 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb, |
| 3992 | void* pUserData |
| 3993 | ) |
| 3994 | { |
| 3995 | WDI_EventInfoType wdiEventData; |
| 3996 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3997 | |
| 3998 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3999 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4000 | ------------------------------------------------------------------------*/ |
| 4001 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4002 | { |
| 4003 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4004 | "WDI API call before module is initialized - Fail request"); |
| 4005 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4006 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4007 | } |
| 4008 | |
| 4009 | /*------------------------------------------------------------------------ |
| 4010 | Fill in Event data and post to the Main FSM |
| 4011 | ------------------------------------------------------------------------*/ |
| 4012 | wdiEventData.wdiRequest = WDI_WOWL_DEL_BC_PTRN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4013 | wdiEventData.pEventData = pwdiWowlDelBcPtrnParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 4014 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlDelBcPtrnParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4015 | wdiEventData.pCBfnc = wdiWowlDelBcPtrnCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4016 | wdiEventData.pUserData = pUserData; |
| 4017 | |
| 4018 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4019 | }/*WDI_WowlDelBcPtrnReq*/ |
| 4020 | |
| 4021 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4022 | @brief WDI_WowlEnterReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4023 | wants to enter the Wowl state to minimize unnecessary |
| 4024 | host wakeup while in power save. Upon the call of this |
| 4025 | API the WLAN DAL will pack and send a HAL Wowl enter |
| 4026 | request message to the lower RIVA sub-system if DAL is |
| 4027 | in state STARTED. |
| 4028 | |
| 4029 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4030 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4031 | |
| 4032 | WDI_PostAssocReq must have been called. |
| 4033 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4034 | @param pwdiWowlEnterReqParams: the Wowl enter info as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4035 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4036 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4037 | wdiWowlEnterReqCb: callback for passing back the |
| 4038 | response of the enter Wowl operation received from the |
| 4039 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4040 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4041 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4042 | callback |
| 4043 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4044 | @see WDI_PostAssocReq |
| 4045 | @return Result of the function call |
| 4046 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4047 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4048 | WDI_WowlEnterReq |
| 4049 | ( |
| 4050 | WDI_WowlEnterReqParamsType* pwdiWowlEnterParams, |
| 4051 | WDI_WowlEnterReqCb wdiWowlEnterCb, |
| 4052 | void* pUserData |
| 4053 | ) |
| 4054 | { |
| 4055 | WDI_EventInfoType wdiEventData; |
| 4056 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4057 | |
| 4058 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4059 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4060 | ------------------------------------------------------------------------*/ |
| 4061 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4062 | { |
| 4063 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4064 | "WDI API call before module is initialized - Fail request"); |
| 4065 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4066 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4067 | } |
| 4068 | |
| 4069 | /*------------------------------------------------------------------------ |
| 4070 | Fill in Event data and post to the Main FSM |
| 4071 | ------------------------------------------------------------------------*/ |
| 4072 | wdiEventData.wdiRequest = WDI_WOWL_ENTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4073 | wdiEventData.pEventData = pwdiWowlEnterParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 4074 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlEnterParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4075 | wdiEventData.pCBfnc = wdiWowlEnterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4076 | wdiEventData.pUserData = pUserData; |
| 4077 | |
| 4078 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4079 | }/*WDI_WowlEnterReq*/ |
| 4080 | |
| 4081 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4082 | @brief WDI_WowlExitReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4083 | wants to exit the Wowl state. Upon the call of this API |
| 4084 | the WLAN DAL will pack and send a HAL Wowl exit request |
| 4085 | message to the lower RIVA sub-system if DAL is in state |
| 4086 | STARTED. |
| 4087 | |
| 4088 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4089 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4090 | |
| 4091 | WDI_WowlEnterReq must have been called. |
| 4092 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4093 | @param pwdiWowlExitReqParams: the Wowl exit info as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4094 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4095 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4096 | wdiWowlExitReqCb: callback for passing back the response |
| 4097 | of the exit Wowl operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4098 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4099 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4100 | callback |
| 4101 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4102 | @see WDI_WowlEnterReq |
| 4103 | @return Result of the function call |
| 4104 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4105 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4106 | WDI_WowlExitReq |
| 4107 | ( |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4108 | WDI_WowlExitReqParamsType* pwdiWowlExitParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4109 | WDI_WowlExitReqCb wdiWowlExitCb, |
| 4110 | void* pUserData |
| 4111 | ) |
| 4112 | { |
| 4113 | WDI_EventInfoType wdiEventData; |
| 4114 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4115 | |
| 4116 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4117 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4118 | ------------------------------------------------------------------------*/ |
| 4119 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4120 | { |
| 4121 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4122 | "WDI API call before module is initialized - Fail request"); |
| 4123 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4124 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4125 | } |
| 4126 | |
| 4127 | /*------------------------------------------------------------------------ |
| 4128 | Fill in Event data and post to the Main FSM |
| 4129 | ------------------------------------------------------------------------*/ |
| 4130 | wdiEventData.wdiRequest = WDI_WOWL_EXIT_REQ; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4131 | wdiEventData.pEventData = pwdiWowlExitParams; |
| 4132 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlExitParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4133 | wdiEventData.pCBfnc = wdiWowlExitCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4134 | wdiEventData.pUserData = pUserData; |
| 4135 | |
| 4136 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4137 | }/*WDI_WowlExitReq*/ |
| 4138 | |
| 4139 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4140 | @brief WDI_ConfigureAppsCpuWakeupStateReq will be called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4141 | the upper MAC wants to dynamically adjusts the listen |
| 4142 | interval based on the WLAN/MSM activity. Upon the call |
| 4143 | of this API the WLAN DAL will pack and send a HAL |
| 4144 | configure Apps Cpu Wakeup State request message to the |
| 4145 | lower RIVA sub-system. |
| 4146 | |
| 4147 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4148 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4149 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4150 | |
| 4151 | @param pwdiConfigureAppsCpuWakeupStateReqParams: the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4152 | Apps Cpu Wakeup State as specified by the |
| 4153 | Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4154 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4155 | wdiConfigureAppsCpuWakeupStateCb: callback for passing |
| 4156 | back the response of the configure Apps Cpu Wakeup State |
| 4157 | operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4158 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4159 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4160 | callback |
| 4161 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4162 | @return Result of the function call |
| 4163 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4164 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4165 | WDI_ConfigureAppsCpuWakeupStateReq |
| 4166 | ( |
| 4167 | WDI_ConfigureAppsCpuWakeupStateReqParamsType *pwdiConfigureAppsCpuWakeupStateReqParams, |
| 4168 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb, |
| 4169 | void* pUserData |
| 4170 | ) |
| 4171 | { |
| 4172 | WDI_EventInfoType wdiEventData; |
| 4173 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4174 | |
| 4175 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4176 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4177 | ------------------------------------------------------------------------*/ |
| 4178 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4179 | { |
| 4180 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4181 | "WDI API call before module is initialized - Fail request"); |
| 4182 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4183 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4184 | } |
| 4185 | |
| 4186 | /*------------------------------------------------------------------------ |
| 4187 | Fill in Event data and post to the Main FSM |
| 4188 | ------------------------------------------------------------------------*/ |
| 4189 | wdiEventData.wdiRequest = WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4190 | wdiEventData.pEventData = pwdiConfigureAppsCpuWakeupStateReqParams; |
| 4191 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigureAppsCpuWakeupStateReqParams); |
| 4192 | wdiEventData.pCBfnc = wdiConfigureAppsCpuWakeupStateCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4193 | wdiEventData.pUserData = pUserData; |
| 4194 | |
| 4195 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4196 | }/*WDI_ConfigureAppsCpuWakeupStateReq*/ |
| 4197 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4198 | @brief WDI_FlushAcReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4199 | to to perform a flush operation on a given AC. Upon the |
| 4200 | call of this API the WLAN DAL will pack and send a HAL |
| 4201 | Flush AC request message to the lower RIVA sub-system if |
| 4202 | DAL is in state STARTED. |
| 4203 | |
| 4204 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4205 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4206 | |
| 4207 | WDI_AddBAReq must have been called. |
| 4208 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4209 | @param pwdiFlushAcReqParams: the Flush AC parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4210 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4211 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4212 | wdiFlushAcRspCb: callback for passing back the response |
| 4213 | of the Flush AC operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4214 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4215 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4216 | callback |
| 4217 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4218 | @see WDI_AddBAReq |
| 4219 | @return Result of the function call |
| 4220 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4221 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4222 | WDI_FlushAcReq |
| 4223 | ( |
| 4224 | WDI_FlushAcReqParamsType* pwdiFlushAcReqParams, |
| 4225 | WDI_FlushAcRspCb wdiFlushAcRspCb, |
| 4226 | void* pUserData |
| 4227 | ) |
| 4228 | { |
| 4229 | WDI_EventInfoType wdiEventData; |
| 4230 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4231 | |
| 4232 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4233 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4234 | ------------------------------------------------------------------------*/ |
| 4235 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4236 | { |
| 4237 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4238 | "WDI API call before module is initialized - Fail request"); |
| 4239 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4240 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4241 | } |
| 4242 | |
| 4243 | /*------------------------------------------------------------------------ |
| 4244 | Fill in Event data and post to the Main FSM |
| 4245 | ------------------------------------------------------------------------*/ |
| 4246 | wdiEventData.wdiRequest = WDI_FLUSH_AC_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4247 | wdiEventData.pEventData = pwdiFlushAcReqParams; |
| 4248 | wdiEventData.uEventDataSize = sizeof(*pwdiFlushAcReqParams); |
| 4249 | wdiEventData.pCBfnc = wdiFlushAcRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4250 | wdiEventData.pUserData = pUserData; |
| 4251 | |
| 4252 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4253 | |
| 4254 | }/*WDI_FlushAcReq*/ |
| 4255 | |
| 4256 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4257 | @brief WDI_BtAmpEventReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4258 | wants to notify the lower mac on a BT AMP event. This is |
| 4259 | to inform BTC-SLM that some BT AMP event occurred. Upon |
| 4260 | the call of this API the WLAN DAL will pack and send a |
| 4261 | HAL BT AMP event request message to the lower RIVA |
| 4262 | sub-system if DAL is in state STARTED. |
| 4263 | |
| 4264 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4265 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4266 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4267 | |
| 4268 | @param wdiBtAmpEventReqParams: the BT AMP event parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4269 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4270 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4271 | wdiBtAmpEventRspCb: callback for passing back the |
| 4272 | response of the BT AMP event operation received from the |
| 4273 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4274 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4275 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4276 | callback |
| 4277 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4278 | @return Result of the function call |
| 4279 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4280 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4281 | WDI_BtAmpEventReq |
| 4282 | ( |
| 4283 | WDI_BtAmpEventParamsType* pwdiBtAmpEventReqParams, |
| 4284 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb, |
| 4285 | void* pUserData |
| 4286 | ) |
| 4287 | { |
| 4288 | WDI_EventInfoType wdiEventData; |
| 4289 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4290 | |
| 4291 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4292 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4293 | ------------------------------------------------------------------------*/ |
| 4294 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4295 | { |
| 4296 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4297 | "WDI API call before module is initialized - Fail request"); |
| 4298 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4299 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4300 | } |
| 4301 | |
| 4302 | /*------------------------------------------------------------------------ |
| 4303 | Fill in Event data and post to the Main FSM |
| 4304 | ------------------------------------------------------------------------*/ |
| 4305 | wdiEventData.wdiRequest = WDI_BTAMP_EVENT_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4306 | wdiEventData.pEventData = pwdiBtAmpEventReqParams; |
| 4307 | wdiEventData.uEventDataSize = sizeof(*pwdiBtAmpEventReqParams); |
| 4308 | wdiEventData.pCBfnc = wdiBtAmpEventRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4309 | wdiEventData.pUserData = pUserData; |
| 4310 | |
| 4311 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4312 | |
| 4313 | }/*WDI_BtAmpEventReq*/ |
| 4314 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4315 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 4316 | /** |
| 4317 | @brief WDI_Start Oem Data Req will be called when the upper MAC |
| 4318 | wants to notify the lower mac on a oem data Req event.Upon |
| 4319 | the call of this API the WLAN DAL will pack and send a |
| 4320 | HAL OEM Data Req event request message to the lower RIVA |
| 4321 | sub-system if DAL is in state STARTED. |
| 4322 | |
| 4323 | In state BUSY this request will be queued. Request won't |
| 4324 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4325 | |
| 4326 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4327 | |
| 4328 | @param pwdiOemDataReqParams: the Oem Data Req as |
| 4329 | specified by the Device Interface |
| 4330 | |
| 4331 | wdiStartOemDataRspCb: callback for passing back the |
| 4332 | response of the Oem Data Req received from the |
| 4333 | device |
| 4334 | |
| 4335 | pUserData: user data will be passed back with the |
| 4336 | callback |
| 4337 | |
| 4338 | @return Result of the function call |
| 4339 | */ |
| 4340 | WDI_Status |
| 4341 | WDI_StartOemDataReq |
| 4342 | ( |
| 4343 | WDI_oemDataReqParamsType* pwdiOemDataReqParams, |
| 4344 | WDI_oemDataRspCb wdiOemDataRspCb, |
| 4345 | void* pUserData |
| 4346 | ) |
| 4347 | { |
| 4348 | WDI_EventInfoType wdiEventData; |
| 4349 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4350 | |
| 4351 | /*------------------------------------------------------------------------ |
| 4352 | Sanity Check |
| 4353 | ------------------------------------------------------------------------*/ |
| 4354 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4355 | { |
| 4356 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4357 | "WDI API call before module is initialized - Fail request"); |
| 4358 | |
| 4359 | return WDI_STATUS_E_NOT_ALLOWED; |
| 4360 | } |
| 4361 | |
| 4362 | /*------------------------------------------------------------------------ |
| 4363 | Fill in Event data and post to the Main FSM |
| 4364 | ------------------------------------------------------------------------*/ |
| 4365 | wdiEventData.wdiRequest = WDI_START_OEM_DATA_REQ; |
| 4366 | wdiEventData.pEventData = pwdiOemDataReqParams; |
| 4367 | wdiEventData.uEventDataSize = sizeof(*pwdiOemDataReqParams); |
| 4368 | wdiEventData.pCBfnc = wdiOemDataRspCb; |
| 4369 | wdiEventData.pUserData = pUserData; |
| 4370 | |
| 4371 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4372 | |
| 4373 | |
| 4374 | } |
| 4375 | |
| 4376 | #endif |
| 4377 | |
| 4378 | |
| 4379 | /*======================================================================== |
| 4380 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4381 | CONTROL APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4382 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4383 | ==========================================================================*/ |
| 4384 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4385 | @brief WDI_SwitchChReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4386 | the WLAN HW to change the current channel of operation. |
| 4387 | Upon the call of this API the WLAN DAL will pack and |
| 4388 | send a HAL Start request message to the lower RIVA |
| 4389 | sub-system if DAL is in state STARTED. |
| 4390 | |
| 4391 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4392 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4393 | |
| 4394 | WDI_Start must have been called. |
| 4395 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4396 | @param wdiSwitchChReqParams: the switch ch parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4397 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4398 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4399 | wdiSwitchChRspCb: callback for passing back the response |
| 4400 | of the switch ch operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4401 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4402 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4403 | callback |
| 4404 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4405 | @see WDI_Start |
| 4406 | @return Result of the function call |
| 4407 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4408 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4409 | WDI_SwitchChReq |
| 4410 | ( |
| 4411 | WDI_SwitchChReqParamsType* pwdiSwitchChReqParams, |
| 4412 | WDI_SwitchChRspCb wdiSwitchChRspCb, |
| 4413 | void* pUserData |
| 4414 | ) |
| 4415 | { |
| 4416 | WDI_EventInfoType wdiEventData; |
| 4417 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4418 | |
| 4419 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4420 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4421 | ------------------------------------------------------------------------*/ |
| 4422 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4423 | { |
| 4424 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4425 | "WDI API call before module is initialized - Fail request"); |
| 4426 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4427 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4428 | } |
| 4429 | |
| 4430 | /*------------------------------------------------------------------------ |
| 4431 | Fill in Event data and post to the Main FSM |
| 4432 | ------------------------------------------------------------------------*/ |
| 4433 | wdiEventData.wdiRequest = WDI_CH_SWITCH_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4434 | wdiEventData.pEventData = pwdiSwitchChReqParams; |
| 4435 | wdiEventData.uEventDataSize = sizeof(*pwdiSwitchChReqParams); |
| 4436 | wdiEventData.pCBfnc = wdiSwitchChRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4437 | wdiEventData.pUserData = pUserData; |
| 4438 | |
| 4439 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4440 | |
| 4441 | }/*WDI_SwitchChReq*/ |
| 4442 | |
| 4443 | |
| 4444 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4445 | @brief WDI_ConfigSTAReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4446 | wishes to add or update a STA in HW. Upon the call of |
| 4447 | this API the WLAN DAL will pack and send a HAL Start |
| 4448 | message request message to the lower RIVA sub-system if |
| 4449 | DAL is in state STARTED. |
| 4450 | |
| 4451 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4452 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4453 | |
| 4454 | WDI_Start must have been called. |
| 4455 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4456 | @param wdiConfigSTAReqParams: the config STA parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4457 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4458 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4459 | wdiConfigSTARspCb: callback for passing back the |
| 4460 | response of the config STA operation received from the |
| 4461 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4462 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4463 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4464 | callback |
| 4465 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4466 | @see WDI_Start |
| 4467 | @return Result of the function call |
| 4468 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4469 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4470 | WDI_ConfigSTAReq |
| 4471 | ( |
| 4472 | WDI_ConfigSTAReqParamsType* pwdiConfigSTAReqParams, |
| 4473 | WDI_ConfigSTARspCb wdiConfigSTARspCb, |
| 4474 | void* pUserData |
| 4475 | ) |
| 4476 | { |
| 4477 | WDI_EventInfoType wdiEventData; |
| 4478 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4479 | |
| 4480 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4481 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4482 | ------------------------------------------------------------------------*/ |
| 4483 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4484 | { |
| 4485 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4486 | "WDI API call before module is initialized - Fail request"); |
| 4487 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4488 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4489 | } |
| 4490 | |
| 4491 | /*------------------------------------------------------------------------ |
| 4492 | Fill in Event data and post to the Main FSM |
| 4493 | ------------------------------------------------------------------------*/ |
| 4494 | wdiEventData.wdiRequest = WDI_CONFIG_STA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4495 | wdiEventData.pEventData = pwdiConfigSTAReqParams; |
| 4496 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigSTAReqParams); |
| 4497 | wdiEventData.pCBfnc = wdiConfigSTARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4498 | wdiEventData.pUserData = pUserData; |
| 4499 | |
| 4500 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4501 | |
| 4502 | }/*WDI_ConfigSTAReq*/ |
| 4503 | |
| 4504 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4505 | @brief WDI_SetLinkStateReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4506 | wants to change the state of an ongoing link. Upon the |
| 4507 | call of this API the WLAN DAL will pack and send a HAL |
| 4508 | Start message request message to the lower RIVA |
| 4509 | sub-system if DAL is in state STARTED. |
| 4510 | |
| 4511 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4512 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4513 | |
| 4514 | WDI_JoinStartReq must have been called. |
| 4515 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4516 | @param wdiSetLinkStateReqParams: the set link state parameters |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4517 | as specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4518 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4519 | wdiSetLinkStateRspCb: callback for passing back the |
| 4520 | response of the set link state operation received from |
| 4521 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4522 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4523 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4524 | callback |
| 4525 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4526 | @see WDI_JoinStartReq |
| 4527 | @return Result of the function call |
| 4528 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4529 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4530 | WDI_SetLinkStateReq |
| 4531 | ( |
| 4532 | WDI_SetLinkReqParamsType* pwdiSetLinkStateReqParams, |
| 4533 | WDI_SetLinkStateRspCb wdiSetLinkStateRspCb, |
| 4534 | void* pUserData |
| 4535 | ) |
| 4536 | { |
| 4537 | WDI_EventInfoType wdiEventData; |
| 4538 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4539 | |
| 4540 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4541 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4542 | ------------------------------------------------------------------------*/ |
| 4543 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4544 | { |
| 4545 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4546 | "WDI API call before module is initialized - Fail request"); |
| 4547 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4548 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4549 | } |
| 4550 | |
| 4551 | /*------------------------------------------------------------------------ |
| 4552 | Fill in Event data and post to the Main FSM |
| 4553 | ------------------------------------------------------------------------*/ |
| 4554 | wdiEventData.wdiRequest = WDI_SET_LINK_ST_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4555 | wdiEventData.pEventData = pwdiSetLinkStateReqParams; |
| 4556 | wdiEventData.uEventDataSize = sizeof(*pwdiSetLinkStateReqParams); |
| 4557 | wdiEventData.pCBfnc = wdiSetLinkStateRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4558 | wdiEventData.pUserData = pUserData; |
| 4559 | |
| 4560 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4561 | |
| 4562 | }/*WDI_SetLinkStateReq*/ |
| 4563 | |
| 4564 | |
| 4565 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4566 | @brief WDI_GetStatsReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4567 | to get statistics (MIB counters) from the device. Upon |
| 4568 | the call of this API the WLAN DAL will pack and send a |
| 4569 | HAL Start request message to the lower RIVA sub-system |
| 4570 | if DAL is in state STARTED. |
| 4571 | |
| 4572 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4573 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4574 | |
| 4575 | WDI_Start must have been called. |
| 4576 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4577 | @param wdiGetStatsReqParams: the stats parameters to get as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4578 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4579 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4580 | wdiGetStatsRspCb: callback for passing back the response |
| 4581 | of the get stats operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4582 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4583 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4584 | callback |
| 4585 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4586 | @see WDI_Start |
| 4587 | @return Result of the function call |
| 4588 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4589 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4590 | WDI_GetStatsReq |
| 4591 | ( |
| 4592 | WDI_GetStatsReqParamsType* pwdiGetStatsReqParams, |
| 4593 | WDI_GetStatsRspCb wdiGetStatsRspCb, |
| 4594 | void* pUserData |
| 4595 | ) |
| 4596 | { |
| 4597 | WDI_EventInfoType wdiEventData; |
| 4598 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4599 | |
| 4600 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4601 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4602 | ------------------------------------------------------------------------*/ |
| 4603 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4604 | { |
| 4605 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4606 | "WDI API call before module is initialized - Fail request"); |
| 4607 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4608 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4609 | } |
| 4610 | |
| 4611 | /*------------------------------------------------------------------------ |
| 4612 | Fill in Event data and post to the Main FSM |
| 4613 | ------------------------------------------------------------------------*/ |
| 4614 | wdiEventData.wdiRequest = WDI_GET_STATS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4615 | wdiEventData.pEventData = pwdiGetStatsReqParams; |
| 4616 | wdiEventData.uEventDataSize = sizeof(*pwdiGetStatsReqParams); |
| 4617 | wdiEventData.pCBfnc = wdiGetStatsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4618 | wdiEventData.pUserData = pUserData; |
| 4619 | |
| 4620 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4621 | |
| 4622 | }/*WDI_GetStatsReq*/ |
| 4623 | |
| 4624 | |
| 4625 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4626 | @brief WDI_UpdateCfgReq will be called when the upper MAC when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4627 | it wishes to change the configuration of the WLAN |
| 4628 | Device. Upon the call of this API the WLAN DAL will pack |
| 4629 | and send a HAL Update CFG request message to the lower |
| 4630 | RIVA sub-system if DAL is in state STARTED. |
| 4631 | |
| 4632 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4633 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4634 | |
| 4635 | WDI_Start must have been called. |
| 4636 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4637 | @param wdiUpdateCfgReqParams: the update cfg parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4638 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4639 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4640 | wdiUpdateCfgsRspCb: callback for passing back the |
| 4641 | response of the update cfg operation received from the |
| 4642 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4643 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4644 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4645 | callback |
| 4646 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4647 | @see WDI_Start |
| 4648 | @return Result of the function call |
| 4649 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4650 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4651 | WDI_UpdateCfgReq |
| 4652 | ( |
| 4653 | WDI_UpdateCfgReqParamsType* pwdiUpdateCfgReqParams, |
| 4654 | WDI_UpdateCfgRspCb wdiUpdateCfgsRspCb, |
| 4655 | void* pUserData |
| 4656 | ) |
| 4657 | { |
| 4658 | WDI_EventInfoType wdiEventData; |
| 4659 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4660 | |
| 4661 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4662 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4663 | ------------------------------------------------------------------------*/ |
| 4664 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4665 | { |
| 4666 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4667 | "WDI API call before module is initialized - Fail request"); |
| 4668 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4669 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4670 | } |
| 4671 | |
| 4672 | /*------------------------------------------------------------------------ |
| 4673 | Fill in Event data and post to the Main FSM |
| 4674 | ------------------------------------------------------------------------*/ |
| 4675 | wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4676 | wdiEventData.pEventData = pwdiUpdateCfgReqParams; |
| 4677 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateCfgReqParams); |
| 4678 | wdiEventData.pCBfnc = wdiUpdateCfgsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4679 | wdiEventData.pUserData = pUserData; |
| 4680 | |
| 4681 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4682 | |
| 4683 | }/*WDI_UpdateCfgReq*/ |
| 4684 | |
| 4685 | |
| 4686 | |
| 4687 | /** |
| 4688 | @brief WDI_AddBAReq will be called when the upper MAC has setup |
| 4689 | successfully a BA session and needs to notify the HW for |
| 4690 | the appropriate settings to take place. Upon the call of |
| 4691 | this API the WLAN DAL will pack and send a HAL Add BA |
| 4692 | request message to the lower RIVA sub-system if DAL is |
| 4693 | in state STARTED. |
| 4694 | |
| 4695 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4696 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4697 | |
| 4698 | WDI_PostAssocReq must have been called. |
| 4699 | |
| 4700 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 4701 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4702 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4703 | wdiAddBARspCb: callback for passing back the response of |
| 4704 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4705 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4706 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4707 | callback |
| 4708 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4709 | @see WDI_PostAssocReq |
| 4710 | @return Result of the function call |
| 4711 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4712 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4713 | WDI_AddBAReq |
| 4714 | ( |
| 4715 | WDI_AddBAReqParamsType* pwdiAddBAReqParams, |
| 4716 | WDI_AddBARspCb wdiAddBARspCb, |
| 4717 | void* pUserData |
| 4718 | ) |
| 4719 | { |
| 4720 | WDI_EventInfoType wdiEventData; |
| 4721 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4722 | |
| 4723 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4724 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4725 | ------------------------------------------------------------------------*/ |
| 4726 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4727 | { |
| 4728 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4729 | "WDI API call before module is initialized - Fail request"); |
| 4730 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4731 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4732 | } |
| 4733 | |
| 4734 | /*------------------------------------------------------------------------ |
| 4735 | Fill in Event data and post to the Main FSM |
| 4736 | ------------------------------------------------------------------------*/ |
| 4737 | wdiEventData.wdiRequest = WDI_ADD_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4738 | wdiEventData.pEventData = pwdiAddBAReqParams; |
| 4739 | wdiEventData.uEventDataSize = sizeof(*pwdiAddBAReqParams); |
| 4740 | wdiEventData.pCBfnc = wdiAddBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4741 | wdiEventData.pUserData = pUserData; |
| 4742 | |
| 4743 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4744 | |
| 4745 | }/*WDI_AddBAReq*/ |
| 4746 | |
| 4747 | |
| 4748 | /** |
| 4749 | @brief WDI_TriggerBAReq will be called when the upper MAC has setup |
| 4750 | successfully a BA session and needs to notify the HW for |
| 4751 | the appropriate settings to take place. Upon the call of |
| 4752 | this API the WLAN DAL will pack and send a HAL Add BA |
| 4753 | request message to the lower RIVA sub-system if DAL is |
| 4754 | in state STARTED. |
| 4755 | |
| 4756 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4757 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4758 | |
| 4759 | WDI_PostAssocReq must have been called. |
| 4760 | |
| 4761 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 4762 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4763 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4764 | wdiAddBARspCb: callback for passing back the response of |
| 4765 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4766 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4767 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4768 | callback |
| 4769 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4770 | @see WDI_PostAssocReq |
| 4771 | @return Result of the function call |
| 4772 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4773 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4774 | WDI_TriggerBAReq |
| 4775 | ( |
| 4776 | WDI_TriggerBAReqParamsType* pwdiTriggerBAReqParams, |
| 4777 | WDI_TriggerBARspCb wdiTriggerBARspCb, |
| 4778 | void* pUserData |
| 4779 | ) |
| 4780 | { |
| 4781 | WDI_EventInfoType wdiEventData; |
| 4782 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4783 | |
| 4784 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4785 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4786 | ------------------------------------------------------------------------*/ |
| 4787 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4788 | { |
| 4789 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4790 | "WDI API call before module is initialized - Fail request"); |
| 4791 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4792 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4793 | } |
| 4794 | |
| 4795 | /*------------------------------------------------------------------------ |
| 4796 | Fill in Event data and post to the Main FSM |
| 4797 | ------------------------------------------------------------------------*/ |
| 4798 | wdiEventData.wdiRequest = WDI_TRIGGER_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4799 | wdiEventData.pEventData = pwdiTriggerBAReqParams; |
| 4800 | wdiEventData.uEventDataSize = sizeof(*pwdiTriggerBAReqParams); |
| 4801 | wdiEventData.pCBfnc = wdiTriggerBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4802 | wdiEventData.pUserData = pUserData; |
| 4803 | |
| 4804 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4805 | |
| 4806 | }/*WDI_AddBAReq*/ |
| 4807 | |
| 4808 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4809 | @brief WDI_UpdateBeaconParamsReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4810 | wishes to update any of the Beacon parameters used by HW. |
| 4811 | Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon Params request |
| 4812 | message to the lower RIVA sub-system if DAL is in state |
| 4813 | STARTED. |
| 4814 | |
| 4815 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4816 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4817 | |
| 4818 | WDI_PostAssocReq must have been called. |
| 4819 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4820 | @param wdiUpdateBeaconParams: the Beacon parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4821 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4822 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4823 | wdiUpdateBeaconParamsRspCb: callback for passing back the |
| 4824 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4825 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4826 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4827 | callback |
| 4828 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4829 | @see WDI_PostAssocReq |
| 4830 | @return Result of the function call |
| 4831 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4832 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4833 | WDI_UpdateBeaconParamsReq |
| 4834 | ( |
| 4835 | WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams, |
| 4836 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb, |
| 4837 | void* pUserData |
| 4838 | ) |
| 4839 | { |
| 4840 | WDI_EventInfoType wdiEventData; |
| 4841 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4842 | |
| 4843 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4844 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4845 | ------------------------------------------------------------------------*/ |
| 4846 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4847 | { |
| 4848 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4849 | "WDI API call before module is initialized - Fail request"); |
| 4850 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4851 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4852 | } |
| 4853 | |
| 4854 | /*------------------------------------------------------------------------ |
| 4855 | Fill in Event data and post to the Main FSM |
| 4856 | ------------------------------------------------------------------------*/ |
| 4857 | wdiEventData.wdiRequest = WDI_UPD_BCON_PRMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4858 | wdiEventData.pEventData = pwdiUpdateBeaconParams; |
| 4859 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateBeaconParams); |
| 4860 | wdiEventData.pCBfnc = wdiUpdateBeaconParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4861 | wdiEventData.pUserData = pUserData; |
| 4862 | |
| 4863 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4864 | |
| 4865 | }/*WDI_UpdateBeaconParamsReq*/ |
| 4866 | |
| 4867 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4868 | @brief WDI_SendBeaconParamsReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4869 | wishes to update the Beacon template used by HW. |
| 4870 | Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon template request |
| 4871 | message to the lower RIVA sub-system if DAL is in state |
| 4872 | STARTED. |
| 4873 | |
| 4874 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4875 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4876 | |
| 4877 | WDI_PostAssocReq must have been called. |
| 4878 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4879 | @param wdiSendBeaconParams: the Beacon parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4880 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4881 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4882 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 4883 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4884 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4885 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4886 | callback |
| 4887 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4888 | @see WDI_PostAssocReq |
| 4889 | @return Result of the function call |
| 4890 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4891 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4892 | WDI_SendBeaconParamsReq |
| 4893 | ( |
| 4894 | WDI_SendBeaconParamsType* pwdiSendBeaconParams, |
| 4895 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb, |
| 4896 | void* pUserData |
| 4897 | ) |
| 4898 | { |
| 4899 | WDI_EventInfoType wdiEventData; |
| 4900 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4901 | |
| 4902 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4903 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4904 | ------------------------------------------------------------------------*/ |
| 4905 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4906 | { |
| 4907 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4908 | "WDI API call before module is initialized - Fail request"); |
| 4909 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4910 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4911 | } |
| 4912 | |
| 4913 | /*------------------------------------------------------------------------ |
| 4914 | Fill in Event data and post to the Main FSM |
| 4915 | ------------------------------------------------------------------------*/ |
| 4916 | wdiEventData.wdiRequest = WDI_SND_BCON_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4917 | wdiEventData.pEventData = pwdiSendBeaconParams; |
| 4918 | wdiEventData.uEventDataSize = sizeof(*pwdiSendBeaconParams); |
| 4919 | wdiEventData.pCBfnc = wdiSendBeaconParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4920 | wdiEventData.pUserData = pUserData; |
| 4921 | |
| 4922 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4923 | |
| 4924 | }/*WDI_SendBeaconParamsReq*/ |
| 4925 | |
| 4926 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4927 | @brief WDI_UpdateProbeRspTemplateReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4928 | upper MAC wants to update the probe response template to |
| 4929 | be transmitted as Soft AP |
| 4930 | Upon the call of this API the WLAN DAL will |
| 4931 | pack and send the probe rsp template message to the |
| 4932 | lower RIVA sub-system if DAL is in state STARTED. |
| 4933 | |
| 4934 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4935 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4936 | |
| 4937 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4938 | @param pwdiUpdateProbeRspParams: the Update Beacon parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4939 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4940 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4941 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 4942 | response of the Send Beacon Params operation received |
| 4943 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4944 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4945 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4946 | callback |
| 4947 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4948 | @see WDI_AddBAReq |
| 4949 | @return Result of the function call |
| 4950 | */ |
| 4951 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4952 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4953 | WDI_UpdateProbeRspTemplateReq |
| 4954 | ( |
| 4955 | WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRspParams, |
| 4956 | WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRspParamsRspCb, |
| 4957 | void* pUserData |
| 4958 | ) |
| 4959 | { |
| 4960 | WDI_EventInfoType wdiEventData; |
| 4961 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4962 | |
| 4963 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4964 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4965 | ------------------------------------------------------------------------*/ |
| 4966 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4967 | { |
| 4968 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4969 | "WDI API call before module is initialized - Fail request"); |
| 4970 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4971 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4972 | } |
| 4973 | |
| 4974 | /*------------------------------------------------------------------------ |
| 4975 | Fill in Event data and post to the Main FSM |
| 4976 | ------------------------------------------------------------------------*/ |
| 4977 | wdiEventData.wdiRequest = WDI_UPD_PROBE_RSP_TEMPLATE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4978 | wdiEventData.pEventData = pwdiUpdateProbeRspParams; |
| 4979 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateProbeRspParams); |
| 4980 | wdiEventData.pCBfnc = wdiUpdateProbeRspParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4981 | wdiEventData.pUserData = pUserData; |
| 4982 | |
| 4983 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4984 | |
| 4985 | }/*WDI_UpdateProbeRspTemplateReq*/ |
| 4986 | |
| 4987 | /** |
| 4988 | @brief WDI_NvDownloadReq will be called by the UMAC to download the NV blob |
| 4989 | to the NV memory. |
| 4990 | |
| 4991 | |
| 4992 | @param wdiNvDownloadReqParams: the NV Download parameters as specified by |
| 4993 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4994 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4995 | wdiNvDownloadRspCb: callback for passing back the response of |
| 4996 | the NV Download operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4997 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4998 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4999 | callback |
| 5000 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5001 | @see WDI_PostAssocReq |
| 5002 | @return Result of the function call |
| 5003 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5004 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5005 | WDI_NvDownloadReq |
| 5006 | ( |
| 5007 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams, |
| 5008 | WDI_NvDownloadRspCb wdiNvDownloadRspCb, |
| 5009 | void* pUserData |
| 5010 | ) |
| 5011 | { |
| 5012 | WDI_EventInfoType wdiEventData; |
| 5013 | |
| 5014 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5015 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5016 | ------------------------------------------------------------------------*/ |
| 5017 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5018 | { |
| 5019 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5020 | "WDI API call before module is initialized - Fail request"); |
| 5021 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5022 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5023 | } |
| 5024 | |
| 5025 | /*------------------------------------------------------------------------ |
| 5026 | Fill in Event data and post to the Main FSM |
| 5027 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5028 | wdiEventData.wdiRequest = WDI_NV_DOWNLOAD_REQ; |
| 5029 | wdiEventData.pEventData = (void *)pwdiNvDownloadReqParams; |
| 5030 | wdiEventData.uEventDataSize = sizeof(*pwdiNvDownloadReqParams); |
| 5031 | wdiEventData.pCBfnc = wdiNvDownloadRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5032 | wdiEventData.pUserData = pUserData; |
| 5033 | |
| 5034 | return WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, &wdiEventData); |
| 5035 | |
| 5036 | }/*WDI_NVDownloadReq*/ |
| 5037 | |
| 5038 | #ifdef WLAN_FEATURE_P2P |
| 5039 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5040 | @brief WDI_SetP2PGONOAReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5041 | upper MAC wants to send Notice of Absence |
| 5042 | Upon the call of this API the WLAN DAL will |
| 5043 | pack and send the probe rsp template message to the |
| 5044 | lower RIVA sub-system if DAL is in state STARTED. |
| 5045 | |
| 5046 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5047 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5048 | |
| 5049 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5050 | @param pwdiUpdateProbeRspParams: the Update Beacon parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5051 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5052 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5053 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 5054 | response of the Send Beacon Params operation received |
| 5055 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5056 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5057 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5058 | callback |
| 5059 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5060 | @see WDI_AddBAReq |
| 5061 | @return Result of the function call |
| 5062 | */ |
| 5063 | WDI_Status |
| 5064 | WDI_SetP2PGONOAReq |
| 5065 | ( |
| 5066 | WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams, |
| 5067 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb, |
| 5068 | void* pUserData |
| 5069 | ) |
| 5070 | { |
| 5071 | WDI_EventInfoType wdiEventData; |
| 5072 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5073 | |
| 5074 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5075 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5076 | ------------------------------------------------------------------------*/ |
| 5077 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5078 | { |
| 5079 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5080 | "WDI API call before module is initialized - Fail request"); |
| 5081 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5082 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5083 | } |
| 5084 | |
| 5085 | /*------------------------------------------------------------------------ |
| 5086 | Fill in Event data and post to the Main FSM |
| 5087 | ------------------------------------------------------------------------*/ |
| 5088 | wdiEventData.wdiRequest = WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5089 | wdiEventData.pEventData = pwdiP2PGONOAReqParams; |
| 5090 | wdiEventData.uEventDataSize = sizeof(*pwdiP2PGONOAReqParams); |
| 5091 | wdiEventData.pCBfnc = wdiP2PGONOAReqParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5092 | wdiEventData.pUserData = pUserData; |
| 5093 | |
| 5094 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5095 | |
| 5096 | }/*WDI_SetP2PGONOAReq*/ |
| 5097 | #endif |
| 5098 | |
| 5099 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5100 | @brief WDI_AddSTASelfReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5101 | UMAC wanted to add STA self while opening any new session |
| 5102 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5103 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5104 | |
| 5105 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5106 | @param pwdiAddSTASelfParams: the add sta self parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5107 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5108 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5109 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5110 | callback |
| 5111 | |
| 5112 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5113 | @return Result of the function call |
| 5114 | */ |
| 5115 | WDI_Status |
| 5116 | WDI_AddSTASelfReq |
| 5117 | ( |
| 5118 | WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams, |
| 5119 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb, |
| 5120 | void* pUserData |
| 5121 | ) |
| 5122 | { |
| 5123 | WDI_EventInfoType wdiEventData; |
| 5124 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5125 | |
| 5126 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5127 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5128 | ------------------------------------------------------------------------*/ |
| 5129 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5130 | { |
| 5131 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5132 | "WDI API call before module is initialized - Fail request"); |
| 5133 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5134 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5135 | } |
| 5136 | |
| 5137 | /*------------------------------------------------------------------------ |
| 5138 | Fill in Event data and post to the Main FSM |
| 5139 | ------------------------------------------------------------------------*/ |
| 5140 | wdiEventData.wdiRequest = WDI_ADD_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5141 | wdiEventData.pEventData = pwdiAddSTASelfReqParams; |
| 5142 | wdiEventData.uEventDataSize = sizeof(*pwdiAddSTASelfReqParams); |
| 5143 | wdiEventData.pCBfnc = wdiAddSTASelfReqParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5144 | wdiEventData.pUserData = pUserData; |
| 5145 | |
| 5146 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5147 | |
| 5148 | }/*WDI_AddSTASelfReq*/ |
| 5149 | |
| 5150 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5151 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5152 | /** |
| 5153 | @brief WDI_AggrAddTSReq will be called when the upper MAC to inform |
| 5154 | the device of a successful add TSpec negotiation. HW |
| 5155 | needs to receive the TSpec Info from the UMAC in order |
| 5156 | to configure properly the QoS data traffic. Upon the |
| 5157 | call of this API the WLAN DAL will pack and send a HAL |
| 5158 | Add TS request message to the lower RIVA sub-system if |
| 5159 | DAL is in state STARTED. |
| 5160 | |
| 5161 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5162 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5163 | |
| 5164 | WDI_PostAssocReq must have been called. |
| 5165 | |
| 5166 | @param wdiAddTsReqParams: the add TS parameters as specified by |
| 5167 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5168 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5169 | wdiAddTsRspCb: callback for passing back the response of |
| 5170 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5171 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5172 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5173 | callback |
| 5174 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5175 | @see WDI_PostAssocReq |
| 5176 | @return Result of the function call |
| 5177 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5178 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5179 | WDI_AggrAddTSReq |
| 5180 | ( |
| 5181 | WDI_AggrAddTSReqParamsType* pwdiAggrAddTsReqParams, |
| 5182 | WDI_AggrAddTsRspCb wdiAggrAddTsRspCb, |
| 5183 | void* pUserData |
| 5184 | ) |
| 5185 | { |
| 5186 | WDI_EventInfoType wdiEventData; |
| 5187 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5188 | |
| 5189 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5190 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5191 | ------------------------------------------------------------------------*/ |
| 5192 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5193 | { |
| 5194 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5195 | "WDI API call before module is initialized - Fail request"); |
| 5196 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5197 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5198 | } |
| 5199 | |
| 5200 | /*------------------------------------------------------------------------ |
| 5201 | Fill in Event data and post to the Main FSM |
| 5202 | ------------------------------------------------------------------------*/ |
| 5203 | wdiEventData.wdiRequest = WDI_AGGR_ADD_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5204 | wdiEventData.pEventData = pwdiAggrAddTsReqParams; |
| 5205 | wdiEventData.uEventDataSize = sizeof(*pwdiAggrAddTsReqParams); |
| 5206 | wdiEventData.pCBfnc = wdiAggrAddTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5207 | wdiEventData.pUserData = pUserData; |
| 5208 | |
| 5209 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5210 | |
| 5211 | }/*WDI_AggrAddTSReq*/ |
| 5212 | |
| 5213 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 5214 | |
| 5215 | #ifdef ANI_MANF_DIAG |
| 5216 | /** |
| 5217 | @brief WDI_FTMCommandReq |
| 5218 | Post FTM Command Event |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5219 | |
| 5220 | @param ftmCommandReq: FTM Command Body |
| 5221 | @param ftmCommandRspCb: FTM Response from HAL CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5222 | @param pUserData: Client Data |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5223 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5224 | @see |
| 5225 | @return Result of the function call |
| 5226 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5227 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5228 | WDI_FTMCommandReq |
| 5229 | ( |
| 5230 | WDI_FTMCommandReqType *ftmCommandReq, |
| 5231 | WDI_FTMCommandRspCb ftmCommandRspCb, |
| 5232 | void *pUserData |
| 5233 | ) |
| 5234 | { |
| 5235 | WDI_EventInfoType wdiEventData; |
| 5236 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5237 | |
| 5238 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5239 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5240 | ------------------------------------------------------------------------*/ |
| 5241 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5242 | { |
| 5243 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5244 | "WDI API call before module is initialized - Fail request"); |
| 5245 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5246 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5247 | } |
| 5248 | |
| 5249 | /*------------------------------------------------------------------------ |
| 5250 | Fill in Event data and post to the Main FSM |
| 5251 | ------------------------------------------------------------------------*/ |
| 5252 | wdiEventData.wdiRequest = WDI_FTM_CMD_REQ; |
| 5253 | wdiEventData.pEventData = (void *)ftmCommandReq; |
| 5254 | wdiEventData.uEventDataSize = ftmCommandReq->bodyLength + sizeof(wpt_uint32); |
| 5255 | wdiEventData.pCBfnc = ftmCommandRspCb; |
| 5256 | wdiEventData.pUserData = pUserData; |
| 5257 | |
| 5258 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5259 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5260 | #endif /* ANI_MANF_DIAG */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5261 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5262 | @brief WDI_HostResumeReq will be called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5263 | |
| 5264 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5265 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5266 | |
| 5267 | |
| 5268 | @param pwdiResumeReqParams: as specified by |
| 5269 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5270 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5271 | wdiResumeReqRspCb: callback for passing back the response of |
| 5272 | the Resume Req received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5273 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5274 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5275 | callback |
| 5276 | |
| 5277 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5278 | @return Result of the function call |
| 5279 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5280 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5281 | WDI_HostResumeReq |
| 5282 | ( |
| 5283 | WDI_ResumeParamsType* pwdiResumeReqParams, |
| 5284 | WDI_HostResumeEventRspCb wdiResumeReqRspCb, |
| 5285 | void* pUserData |
| 5286 | ) |
| 5287 | { |
| 5288 | WDI_EventInfoType wdiEventData; |
| 5289 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5290 | |
| 5291 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5292 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5293 | ------------------------------------------------------------------------*/ |
| 5294 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5295 | { |
| 5296 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5297 | "WDI API call before module is initialized - Fail request"); |
| 5298 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5299 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5300 | } |
| 5301 | |
| 5302 | /*------------------------------------------------------------------------ |
| 5303 | Fill in Event data and post to the Main FSM |
| 5304 | ------------------------------------------------------------------------*/ |
| 5305 | wdiEventData.wdiRequest = WDI_HOST_RESUME_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5306 | wdiEventData.pEventData = pwdiResumeReqParams; |
| 5307 | wdiEventData.uEventDataSize = sizeof(*pwdiResumeReqParams); |
| 5308 | wdiEventData.pCBfnc = wdiResumeReqRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5309 | wdiEventData.pUserData = pUserData; |
| 5310 | |
| 5311 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5312 | |
| 5313 | }/*WDI_HostResumeReq*/ |
| 5314 | |
| 5315 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5316 | @brief WDI_DelSTASelfReq will be called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5317 | |
| 5318 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5319 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5320 | |
| 5321 | |
| 5322 | @param pwdiDelStaSelfReqParams: as specified by |
| 5323 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5324 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5325 | wdiDelStaSelfRspCb: callback for passing back the response of |
| 5326 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5327 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5328 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5329 | callback |
| 5330 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5331 | @see WDI_PostAssocReq |
| 5332 | @return Result of the function call |
| 5333 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5334 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5335 | WDI_DelSTASelfReq |
| 5336 | ( |
| 5337 | WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams, |
| 5338 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb, |
| 5339 | void* pUserData |
| 5340 | ) |
| 5341 | { |
| 5342 | WDI_EventInfoType wdiEventData; |
| 5343 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5344 | |
| 5345 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5346 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5347 | ------------------------------------------------------------------------*/ |
| 5348 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5349 | { |
| 5350 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5351 | "WDI API call before module is initialized - Fail request"); |
| 5352 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5353 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5354 | } |
| 5355 | |
| 5356 | /*------------------------------------------------------------------------ |
| 5357 | Fill in Event data and post to the Main FSM |
| 5358 | ------------------------------------------------------------------------*/ |
| 5359 | wdiEventData.wdiRequest = WDI_DEL_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5360 | wdiEventData.pEventData = pwdiDelStaSelfReqParams; |
| 5361 | wdiEventData.uEventDataSize = sizeof(*pwdiDelStaSelfReqParams); |
| 5362 | wdiEventData.pCBfnc = wdiDelStaSelfRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5363 | wdiEventData.pUserData = pUserData; |
| 5364 | |
| 5365 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5366 | |
| 5367 | }/*WDI_AggrAddTSReq*/ |
| 5368 | |
| 5369 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5370 | @brief WDI_SetTxPerTrackingReq will be called when the upper MAC |
| 5371 | wants to set the Tx Per Tracking configurations. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5372 | Upon the call of this API the WLAN DAL will pack |
| 5373 | and send a HAL Set Tx Per Tracking request message to the |
| 5374 | lower RIVA sub-system if DAL is in state STARTED. |
| 5375 | |
| 5376 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5377 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5378 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5379 | @param pwdiSetTxPerTrackingReqParams: the Set Tx PER Tracking configurations as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5380 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5381 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5382 | pwdiSetTxPerTrackingRspCb: callback for passing back the |
| 5383 | response of the set Tx PER Tracking configurations operation received |
| 5384 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5385 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5386 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5387 | callback |
| 5388 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5389 | @return Result of the function call |
| 5390 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5391 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5392 | WDI_SetTxPerTrackingReq |
| 5393 | ( |
| 5394 | WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams, |
| 5395 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb, |
| 5396 | void* pUserData |
| 5397 | ) |
| 5398 | { |
| 5399 | WDI_EventInfoType wdiEventData; |
| 5400 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5401 | |
| 5402 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5403 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5404 | ------------------------------------------------------------------------*/ |
| 5405 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5406 | { |
| 5407 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5408 | "WDI API call before module is initialized - Fail request"); |
| 5409 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5410 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5411 | } |
| 5412 | |
| 5413 | /*------------------------------------------------------------------------ |
| 5414 | Fill in Event data and post to the Main FSM |
| 5415 | ------------------------------------------------------------------------*/ |
| 5416 | wdiEventData.wdiRequest = WDI_SET_TX_PER_TRACKING_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5417 | wdiEventData.pEventData = pwdiSetTxPerTrackingReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5418 | wdiEventData.uEventDataSize = sizeof(*pwdiSetTxPerTrackingReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5419 | wdiEventData.pCBfnc = pwdiSetTxPerTrackingRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5420 | wdiEventData.pUserData = pUserData; |
| 5421 | |
| 5422 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5423 | |
| 5424 | }/*WDI_SetTxPerTrackingReq*/ |
| 5425 | |
| 5426 | /** |
| 5427 | @brief WDI_SetTmLevelReq |
| 5428 | If HW Thermal condition changed, driver should react based on new |
| 5429 | HW thermal condition. |
| 5430 | |
| 5431 | @param pwdiSetTmLevelReq: New thermal condition information |
| 5432 | |
| 5433 | pwdiSetTmLevelRspCb: callback |
| 5434 | |
| 5435 | usrData: user data will be passed back with the |
| 5436 | callback |
| 5437 | |
| 5438 | @return Result of the function call |
| 5439 | */ |
| 5440 | WDI_Status |
| 5441 | WDI_SetTmLevelReq |
| 5442 | ( |
| 5443 | WDI_SetTmLevelReqType *pwdiSetTmLevelReq, |
| 5444 | WDI_SetTmLevelCb pwdiSetTmLevelRspCb, |
| 5445 | void *usrData |
| 5446 | ) |
| 5447 | { |
| 5448 | WDI_EventInfoType wdiEventData; |
| 5449 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5450 | |
| 5451 | /*------------------------------------------------------------------------ |
| 5452 | Sanity Check |
| 5453 | ------------------------------------------------------------------------*/ |
| 5454 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5455 | { |
| 5456 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5457 | "WDI API call before module is initialized - Fail request"); |
| 5458 | |
| 5459 | return WDI_STATUS_E_NOT_ALLOWED; |
| 5460 | } |
| 5461 | |
| 5462 | /*------------------------------------------------------------------------ |
| 5463 | Fill in Event data and post to the Main FSM |
| 5464 | ------------------------------------------------------------------------*/ |
| 5465 | wdiEventData.wdiRequest = WDI_SET_TM_LEVEL_REQ; |
| 5466 | wdiEventData.pEventData = pwdiSetTmLevelReq; |
| 5467 | wdiEventData.uEventDataSize = sizeof(*pwdiSetTmLevelReq); |
| 5468 | wdiEventData.pCBfnc = pwdiSetTmLevelRspCb; |
| 5469 | wdiEventData.pUserData = usrData; |
| 5470 | |
| 5471 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5472 | } |
| 5473 | |
| 5474 | /** |
| 5475 | @brief WDI_HostSuspendInd |
| 5476 | |
| 5477 | Suspend Indication from the upper layer will be sent |
| 5478 | down to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5479 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5480 | @param WDI_SuspendResumeIndParamsType |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5481 | |
| 5482 | @see |
| 5483 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5484 | @return Status of the request |
| 5485 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5486 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5487 | WDI_HostSuspendInd |
| 5488 | ( |
| 5489 | WDI_SuspendParamsType* pwdiSuspendIndParams |
| 5490 | ) |
| 5491 | { |
| 5492 | |
| 5493 | WDI_EventInfoType wdiEventData; |
| 5494 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5495 | |
| 5496 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5497 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5498 | ------------------------------------------------------------------------*/ |
| 5499 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5500 | { |
| 5501 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5502 | "WDI API call before module is initialized - Fail request"); |
| 5503 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5504 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5505 | } |
| 5506 | |
| 5507 | /*------------------------------------------------------------------------ |
| 5508 | Fill in Event data and post to the Main FSM |
| 5509 | ------------------------------------------------------------------------*/ |
| 5510 | wdiEventData.wdiRequest = WDI_HOST_SUSPEND_IND; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5511 | wdiEventData.pEventData = pwdiSuspendIndParams; |
| 5512 | wdiEventData.uEventDataSize = sizeof(*pwdiSuspendIndParams); |
| 5513 | wdiEventData.pCBfnc = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5514 | wdiEventData.pUserData = NULL; |
| 5515 | |
| 5516 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5517 | |
| 5518 | }/*WDI_HostSuspendInd*/ |
| 5519 | |
| 5520 | /** |
| 5521 | @brief WDI_HALDumpCmdReq |
| 5522 | Post HAL DUMP Command Event |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5523 | |
| 5524 | @param halDumpCmdReqParams: Hal Dump Command Body |
| 5525 | @param halDumpCmdRspCb: HAL DUMP Response from HAL CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5526 | @param pUserData: Client Data |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5527 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5528 | @see |
| 5529 | @return Result of the function call |
| 5530 | */ |
| 5531 | WDI_Status WDI_HALDumpCmdReq |
| 5532 | ( |
| 5533 | WDI_HALDumpCmdReqParamsType *halDumpCmdReqParams, |
| 5534 | WDI_HALDumpCmdRspCb halDumpCmdRspCb, |
| 5535 | void *pUserData |
| 5536 | ) |
| 5537 | { |
| 5538 | WDI_EventInfoType wdiEventData; |
| 5539 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5540 | |
| 5541 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5542 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5543 | ------------------------------------------------------------------------*/ |
| 5544 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5545 | { |
| 5546 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5547 | "WDI API call before module is initialized - Fail request"); |
| 5548 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5549 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5550 | } |
| 5551 | |
| 5552 | /*------------------------------------------------------------------------ |
| 5553 | Fill in Event data and post to the Main FSM |
| 5554 | ------------------------------------------------------------------------*/ |
| 5555 | wdiEventData.wdiRequest = WDI_HAL_DUMP_CMD_REQ; |
| 5556 | wdiEventData.pEventData = (void *)halDumpCmdReqParams; |
| 5557 | wdiEventData.uEventDataSize = sizeof(WDI_HALDumpCmdReqParamsType); |
| 5558 | wdiEventData.pCBfnc = halDumpCmdRspCb; |
| 5559 | wdiEventData.pUserData = pUserData; |
| 5560 | |
| 5561 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5562 | } |
| 5563 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5564 | /*============================================================================ |
| 5565 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5566 | DAL Control Path Main FSM Function Implementation |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5567 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5568 | ============================================================================*/ |
| 5569 | |
| 5570 | /** |
| 5571 | @brief Main FSM Start function for all states except BUSY |
| 5572 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5573 | |
| 5574 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5575 | wdiEV: event posted to the main DAL FSM |
| 5576 | pEventData: pointer to the event information |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5577 | structure |
| 5578 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5579 | @see |
| 5580 | @return Result of the function call |
| 5581 | */ |
| 5582 | WDI_Status |
| 5583 | WDI_PostMainEvent |
| 5584 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5585 | WDI_ControlBlockType* pWDICtx, |
| 5586 | WDI_MainEventType wdiEV, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5587 | WDI_EventInfoType* pEventData |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5588 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5589 | ) |
| 5590 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5591 | WDI_Status wdiStatus; |
| 5592 | WDI_MainFuncType pfnWDIMainEvHdlr; |
| 5593 | WDI_MainStateType wdiOldState; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5594 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5595 | |
| 5596 | /*------------------------------------------------------------------------- |
| 5597 | Sanity check |
| 5598 | -------------------------------------------------------------------------*/ |
| 5599 | if (( pWDICtx->uGlobalState >= WDI_MAX_ST ) || |
| 5600 | ( wdiEV >= WDI_MAX_EVENT )) |
| 5601 | { |
| 5602 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5603 | "Invalid state or event in Post Main Ev function ST: %d EV: %d", |
| 5604 | pWDICtx->uGlobalState, wdiEV); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5605 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5606 | } |
| 5607 | |
| 5608 | /*Access to the global state must be locked */ |
| 5609 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5610 | |
| 5611 | /*Fetch event handler for state*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5612 | pfnWDIMainEvHdlr = wdiMainFSM[pWDICtx->uGlobalState].pfnMainTbl[wdiEV]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5613 | |
| 5614 | wdiOldState = pWDICtx->uGlobalState; |
| 5615 | |
| 5616 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5617 | --Incase of WDI event is WDI_RESPONSE_EVENT and this is called when a |
| 5618 | response comes from CCPU for the request sent by host: |
| 5619 | 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] | 5620 | 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] | 5621 | --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] | 5622 | CCPU: |
| 5623 | don't change the state */ |
| 5624 | if ( WDI_RESPONSE_EVENT != wdiEV) |
| 5625 | { |
| 5626 | /*Transition to BUSY State - the request is now being processed by the FSM, |
| 5627 | if the request fails we shall transition back to the old state, if not |
| 5628 | the request will manage its own state transition*/ |
| 5629 | WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST); |
| 5630 | } |
| 5631 | /* If the state function associated with the EV is NULL it means that this |
| 5632 | event is not allowed in this state*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5633 | if ( NULL != pfnWDIMainEvHdlr ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5634 | { |
| 5635 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5636 | "Posting event %d in state: %d to the Main FSM", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5637 | wdiEV, wdiOldState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5638 | wdiStatus = pfnWDIMainEvHdlr( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5639 | } |
| 5640 | else |
| 5641 | { |
| 5642 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5643 | "Unexpected event %d in state: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5644 | wdiEV, wdiOldState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5645 | wdiStatus = WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5646 | } |
| 5647 | |
| 5648 | /* If a request handles itself well it will end up in a success or in a |
| 5649 | pending |
| 5650 | Success - means that the request was processed and the proper state |
| 5651 | transition already occurred or will occur when the resp is received |
| 5652 | - NO other state transition or dequeueing is required |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5653 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5654 | Pending - means the request could not be processed at this moment in time |
| 5655 | because the FSM was already busy so no state transition or dequeueing |
| 5656 | is necessary anymore |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5657 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5658 | Success for synchronous case means that the transition may occur and |
| 5659 | processing of pending requests may continue - so it should go through |
| 5660 | and restores the state and continue processing queued requests*/ |
| 5661 | if (( WDI_STATUS_SUCCESS != wdiStatus )&& |
| 5662 | ( WDI_STATUS_PENDING != wdiStatus )) |
| 5663 | { |
| 5664 | if ( WDI_RESPONSE_EVENT != wdiEV) |
| 5665 | { |
| 5666 | /*The request has failed or could not be processed - transition back to |
| 5667 | the old state - check to see if anything was queued and try to execute |
| 5668 | The dequeue logic should post a message to a thread and return - no |
| 5669 | actual processing can occur */ |
| 5670 | WDI_STATE_TRANSITION( pWDICtx, wdiOldState); |
| 5671 | } |
| 5672 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5673 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5674 | } |
| 5675 | |
| 5676 | /* we have completed processing the event */ |
| 5677 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5678 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5679 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5680 | |
| 5681 | }/*WDI_PostMainEvent*/ |
| 5682 | |
| 5683 | |
| 5684 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5685 | INIT State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5686 | --------------------------------------------------------------------------*/ |
| 5687 | /** |
| 5688 | @brief Main FSM Start function for all states except BUSY |
| 5689 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5690 | |
| 5691 | @param pWDICtx: pointer to the WLAN DAL context |
| 5692 | pEventData: pointer to the event information structure |
| 5693 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5694 | @see |
| 5695 | @return Result of the function call |
| 5696 | */ |
| 5697 | WDI_Status |
| 5698 | WDI_MainStart |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5699 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5700 | WDI_ControlBlockType* pWDICtx, |
| 5701 | WDI_EventInfoType* pEventData |
| 5702 | ) |
| 5703 | { |
| 5704 | |
| 5705 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5706 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5707 | ----------------------------------------------------------------------*/ |
| 5708 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5709 | { |
| 5710 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5711 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5712 | pWDICtx, pEventData); |
| 5713 | return WDI_STATUS_E_FAILURE; |
| 5714 | } |
| 5715 | |
| 5716 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5717 | |
| 5718 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5719 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5720 | ----------------------------------------------------------------------*/ |
| 5721 | if ( eWLAN_PAL_FALSE == pWDICtx->bCTOpened ) |
| 5722 | { |
| 5723 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 5724 | "Control Transport not yet Open - queueing the request"); |
| 5725 | |
| 5726 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5727 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5728 | |
| 5729 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5730 | return WDI_STATUS_PENDING; |
| 5731 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5732 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5733 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5734 | |
| 5735 | /*Return Success*/ |
| 5736 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 5737 | |
| 5738 | }/*WDI_MainStart*/ |
| 5739 | |
| 5740 | /** |
| 5741 | @brief Main FSM Response function for state INIT |
| 5742 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5743 | |
| 5744 | @param pWDICtx: pointer to the WLAN DAL context |
| 5745 | pEventData: pointer to the event information structure |
| 5746 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5747 | @see |
| 5748 | @return Result of the function call |
| 5749 | */ |
| 5750 | WDI_Status |
| 5751 | WDI_MainRspInit |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5752 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5753 | WDI_ControlBlockType* pWDICtx, |
| 5754 | WDI_EventInfoType* pEventData |
| 5755 | ) |
| 5756 | { |
| 5757 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5758 | Not expecting a response from the device before it is started |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5759 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5760 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5761 | |
| 5762 | /*Return Success*/ |
| 5763 | return WDI_STATUS_E_NOT_ALLOWED; |
| 5764 | }/* WDI_MainRspInit */ |
| 5765 | |
| 5766 | /** |
| 5767 | @brief Main FSM Close function for all states except BUSY |
| 5768 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5769 | |
| 5770 | @param pWDICtx: pointer to the WLAN DAL context |
| 5771 | pEventData: pointer to the event information structure |
| 5772 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5773 | @see |
| 5774 | @return Result of the function call |
| 5775 | */ |
| 5776 | WDI_Status |
| 5777 | WDI_MainClose |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5778 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5779 | WDI_ControlBlockType* pWDICtx, |
| 5780 | WDI_EventInfoType* pEventData |
| 5781 | ) |
| 5782 | { |
| 5783 | |
| 5784 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5785 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5786 | ----------------------------------------------------------------------*/ |
| 5787 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5788 | { |
| 5789 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5790 | "Invalid parameters on Main Close %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5791 | pWDICtx, pEventData); |
| 5792 | return WDI_STATUS_E_FAILURE; |
| 5793 | } |
| 5794 | |
| 5795 | /*Return Success*/ |
| 5796 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 5797 | |
| 5798 | }/*WDI_MainClose*/ |
| 5799 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5800 | STARTED State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5801 | --------------------------------------------------------------------------*/ |
| 5802 | /** |
| 5803 | @brief Main FSM Start function for state STARTED |
| 5804 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5805 | |
| 5806 | @param pWDICtx: pointer to the WLAN DAL context |
| 5807 | pEventData: pointer to the event information structure |
| 5808 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5809 | @see |
| 5810 | @return Result of the function call |
| 5811 | */ |
| 5812 | WDI_Status |
| 5813 | WDI_MainStartStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5814 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5815 | WDI_ControlBlockType* pWDICtx, |
| 5816 | WDI_EventInfoType* pEventData |
| 5817 | ) |
| 5818 | { |
| 5819 | WDI_StartRspCb wdiStartRspCb = NULL; |
| 5820 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5821 | |
| 5822 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5823 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5824 | ----------------------------------------------------------------------*/ |
| 5825 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5826 | { |
| 5827 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5828 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5829 | pWDICtx, pEventData); |
| 5830 | return WDI_STATUS_E_FAILURE; |
| 5831 | } |
| 5832 | |
| 5833 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5834 | Nothing to do transport was already started |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5835 | ----------------------------------------------------------------------*/ |
| 5836 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5837 | "Received start while transport was already started - nothing to do"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5838 | |
| 5839 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5840 | |
| 5841 | /*Transition back to started because the post function transitioned us to |
| 5842 | busy*/ |
| 5843 | WDI_STATE_TRANSITION( pWDICtx, WDI_STARTED_ST); |
| 5844 | |
| 5845 | /*Check to see if any request is pending*/ |
| 5846 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5847 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5848 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5849 | |
| 5850 | /*Tell UMAC Success*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5851 | wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc; |
| 5852 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5853 | /*Notify UMAC*/ |
| 5854 | wdiStartRspCb( &pWDICtx->wdiCachedStartRspParams, pWDICtx->pRspCBUserData); |
| 5855 | |
| 5856 | /*Return Success*/ |
| 5857 | return WDI_STATUS_SUCCESS; |
| 5858 | |
| 5859 | }/*WDI_MainStartStarted*/ |
| 5860 | |
| 5861 | /** |
| 5862 | @brief Main FSM Stop function for state STARTED |
| 5863 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5864 | |
| 5865 | @param pWDICtx: pointer to the WLAN DAL context |
| 5866 | pEventData: pointer to the event information structure |
| 5867 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5868 | @see |
| 5869 | @return Result of the function call |
| 5870 | */ |
| 5871 | WDI_Status |
| 5872 | WDI_MainStopStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5873 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5874 | WDI_ControlBlockType* pWDICtx, |
| 5875 | WDI_EventInfoType* pEventData |
| 5876 | ) |
| 5877 | { |
| 5878 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5879 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5880 | ----------------------------------------------------------------------*/ |
| 5881 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5882 | { |
| 5883 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5884 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5885 | pWDICtx, pEventData); |
| 5886 | return WDI_STATUS_E_FAILURE; |
| 5887 | } |
| 5888 | |
| 5889 | /*State at this point is BUSY - because we enter this state before posting |
| 5890 | an event to the FSM in order to prevent potential race conditions*/ |
| 5891 | |
| 5892 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 5893 | "Processing stop request in FSM"); |
| 5894 | |
| 5895 | /*Return Success*/ |
| 5896 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 5897 | |
| 5898 | }/*WDI_MainStopStarted*/ |
| 5899 | /** |
| 5900 | @brief Main FSM Request function for state started |
| 5901 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5902 | |
| 5903 | @param pWDICtx: pointer to the WLAN DAL context |
| 5904 | pEventData: pointer to the event information structure |
| 5905 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5906 | @see |
| 5907 | @return Result of the function call |
| 5908 | */ |
| 5909 | WDI_Status |
| 5910 | WDI_MainReqStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5911 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5912 | WDI_ControlBlockType* pWDICtx, |
| 5913 | WDI_EventInfoType* pEventData |
| 5914 | ) |
| 5915 | { |
| 5916 | |
| 5917 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5918 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5919 | ----------------------------------------------------------------------*/ |
| 5920 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5921 | { |
| 5922 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5923 | "Invalid parameters on Main Req Started %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5924 | pWDICtx, pEventData); |
| 5925 | return WDI_STATUS_E_FAILURE; |
| 5926 | } |
| 5927 | |
| 5928 | /*State at this point is BUSY - because we enter this state before posting |
| 5929 | an event to the FSM in order to prevent potential race conditions*/ |
| 5930 | |
| 5931 | /*Return Success*/ |
| 5932 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 5933 | |
| 5934 | }/*WDI_MainReqStarted*/ |
| 5935 | |
| 5936 | /** |
| 5937 | @brief Main FSM Response function for all states except INIT |
| 5938 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5939 | |
| 5940 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5941 | pEventData: pointer to the event information structure |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5942 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5943 | @see |
| 5944 | @return Result of the function call |
| 5945 | */ |
| 5946 | WDI_Status |
| 5947 | WDI_MainRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5948 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5949 | WDI_ControlBlockType* pWDICtx, |
| 5950 | WDI_EventInfoType* pEventData |
| 5951 | ) |
| 5952 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5953 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5954 | wpt_boolean expectedResponse; |
| 5955 | |
| 5956 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5957 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5958 | ----------------------------------------------------------------------*/ |
| 5959 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5960 | { |
| 5961 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5962 | "Invalid parameters on Main Response %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5963 | pWDICtx, pEventData); |
| 5964 | return WDI_STATUS_E_FAILURE; |
| 5965 | } |
| 5966 | |
| 5967 | if ( pEventData->wdiResponse == pWDICtx->wdiExpectedResponse ) |
| 5968 | { |
| 5969 | /* we received an expected response */ |
| 5970 | expectedResponse = eWLAN_PAL_TRUE; |
| 5971 | |
| 5972 | /*We expect that we will transition to started after this processing*/ |
| 5973 | pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST; |
| 5974 | |
| 5975 | /* we are no longer expecting a response */ |
| 5976 | pWDICtx->wdiExpectedResponse = WDI_MAX_RESP; |
| 5977 | } |
| 5978 | else |
| 5979 | { |
| 5980 | /* we received an indication or unexpected response */ |
| 5981 | expectedResponse = eWLAN_PAL_FALSE; |
| 5982 | /* for indications no need to update state from what it is right |
| 5983 | now, unless it explicitly does it in the indication handler (say |
| 5984 | for device failure ind) */ |
| 5985 | pWDICtx->ucExpectedStateTransition = pWDICtx->uGlobalState; |
| 5986 | } |
| 5987 | |
| 5988 | /*Process the response and indication */ |
| 5989 | wdiStatus = WDI_ProcessResponse( pWDICtx, pEventData ); |
| 5990 | |
| 5991 | /*Lock the CB as we are about to do a state transition*/ |
| 5992 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5993 | |
| 5994 | /*Transition to the expected state after the response processing |
| 5995 | - this should always be started state with the following exceptions: |
| 5996 | 1. processing of a failed start response |
| 5997 | 2. device failure detected while processing response |
| 5998 | 3. stop response received*/ |
| 5999 | WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6000 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6001 | /*Dequeue request that may have been queued while we were waiting for the |
| 6002 | response */ |
| 6003 | if ( expectedResponse ) |
| 6004 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6005 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6006 | } |
| 6007 | |
| 6008 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6009 | |
| 6010 | /*Return Success - always */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6011 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6012 | |
| 6013 | }/*WDI_MainRsp*/ |
| 6014 | |
| 6015 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6016 | STOPPED State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6017 | --------------------------------------------------------------------------*/ |
| 6018 | /** |
| 6019 | @brief Main FSM Stop function for state STOPPED |
| 6020 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6021 | |
| 6022 | @param pWDICtx: pointer to the WLAN DAL context |
| 6023 | pEventData: pointer to the event information structure |
| 6024 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6025 | @see |
| 6026 | @return Result of the function call |
| 6027 | */ |
| 6028 | WDI_Status |
| 6029 | WDI_MainStopStopped |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6030 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6031 | WDI_ControlBlockType* pWDICtx, |
| 6032 | WDI_EventInfoType* pEventData |
| 6033 | ) |
| 6034 | { |
| 6035 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6036 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6037 | ----------------------------------------------------------------------*/ |
| 6038 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6039 | { |
| 6040 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6041 | "Invalid parameters on Main Stop Stopped %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6042 | pWDICtx, pEventData); |
| 6043 | return WDI_STATUS_E_FAILURE; |
| 6044 | } |
| 6045 | |
| 6046 | /*We should normally not get a STOP request if we are already stopped |
| 6047 | since we should normally be stopped by the UMAC. However in some |
| 6048 | error situations we put ourselves in the stopped state without the |
| 6049 | UMAC knowing, so when we get a STOP request in this state we still |
| 6050 | process it since we need to clean up the underlying state */ |
| 6051 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6052 | "Processing stop request while stopped in FSM"); |
| 6053 | |
| 6054 | /*Return Success*/ |
| 6055 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6056 | |
| 6057 | }/*WDI_MainStopStopped*/ |
| 6058 | |
| 6059 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6060 | BUSY State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6061 | --------------------------------------------------------------------------*/ |
| 6062 | /** |
| 6063 | @brief Main FSM Start function for state BUSY |
| 6064 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6065 | |
| 6066 | @param pWDICtx: pointer to the WLAN DAL context |
| 6067 | pEventData: pointer to the event information structure |
| 6068 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6069 | @see |
| 6070 | @return Result of the function call |
| 6071 | */ |
| 6072 | WDI_Status |
| 6073 | WDI_MainStartBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6074 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6075 | WDI_ControlBlockType* pWDICtx, |
| 6076 | WDI_EventInfoType* pEventData |
| 6077 | ) |
| 6078 | { |
| 6079 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6080 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6081 | ----------------------------------------------------------------------*/ |
| 6082 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6083 | { |
| 6084 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6085 | "Invalid parameters on Main Start in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6086 | pWDICtx, pEventData); |
| 6087 | return WDI_STATUS_E_FAILURE; |
| 6088 | } |
| 6089 | |
| 6090 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6091 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6092 | ----------------------------------------------------------------------*/ |
| 6093 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6094 | "WDI Busy state - queue start request"); |
| 6095 | |
| 6096 | /*Queue the start request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6097 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6098 | |
| 6099 | /*Return Success*/ |
| 6100 | return WDI_STATUS_PENDING; |
| 6101 | }/*WDI_MainStartBusy*/ |
| 6102 | |
| 6103 | /** |
| 6104 | @brief Main FSM Stop function for state BUSY |
| 6105 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6106 | |
| 6107 | @param pWDICtx: pointer to the WLAN DAL context |
| 6108 | pEventData: pointer to the event information structure |
| 6109 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6110 | @see |
| 6111 | @return Result of the function call |
| 6112 | */ |
| 6113 | WDI_Status |
| 6114 | WDI_MainStopBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6115 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6116 | WDI_ControlBlockType* pWDICtx, |
| 6117 | WDI_EventInfoType* pEventData |
| 6118 | ) |
| 6119 | { |
| 6120 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6121 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6122 | ----------------------------------------------------------------------*/ |
| 6123 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6124 | { |
| 6125 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6126 | "Invalid parameters on Main Stop in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6127 | pWDICtx, pEventData); |
| 6128 | return WDI_STATUS_E_FAILURE; |
| 6129 | } |
| 6130 | |
| 6131 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6132 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6133 | ----------------------------------------------------------------------*/ |
| 6134 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6135 | "WDI Busy state - queue stop request"); |
| 6136 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6137 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6138 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6139 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6140 | }/*WDI_MainStopBusy*/ |
| 6141 | |
| 6142 | /** |
| 6143 | @brief Main FSM Request function for state BUSY |
| 6144 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6145 | |
| 6146 | @param pWDICtx: pointer to the WLAN DAL context |
| 6147 | pEventData: pointer to the event information structure |
| 6148 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6149 | @see |
| 6150 | @return Result of the function call |
| 6151 | */ |
| 6152 | WDI_Status |
| 6153 | WDI_MainReqBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6154 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6155 | WDI_ControlBlockType* pWDICtx, |
| 6156 | WDI_EventInfoType* pEventData |
| 6157 | ) |
| 6158 | { |
| 6159 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6160 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6161 | ----------------------------------------------------------------------*/ |
| 6162 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6163 | { |
| 6164 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6165 | "Invalid parameters on Main Request in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6166 | pWDICtx, pEventData); |
| 6167 | return WDI_STATUS_E_FAILURE; |
| 6168 | } |
| 6169 | |
| 6170 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6171 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6172 | ----------------------------------------------------------------------*/ |
| 6173 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6174 | "WDI Busy state - queue request %d because waiting for response %d", |
| 6175 | pEventData->wdiRequest, pWDICtx->wdiExpectedResponse); |
| 6176 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6177 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6178 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6179 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6180 | }/*WDI_MainReqBusy*/ |
| 6181 | /** |
| 6182 | @brief Main FSM Close function for state BUSY |
| 6183 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6184 | |
| 6185 | @param pWDICtx: pointer to the WLAN DAL context |
| 6186 | pEventData: pointer to the event information structure |
| 6187 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6188 | @see |
| 6189 | @return Result of the function call |
| 6190 | */ |
| 6191 | WDI_Status |
| 6192 | WDI_MainCloseBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6193 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6194 | WDI_ControlBlockType* pWDICtx, |
| 6195 | WDI_EventInfoType* pEventData |
| 6196 | ) |
| 6197 | { |
| 6198 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6199 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6200 | ----------------------------------------------------------------------*/ |
| 6201 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6202 | { |
| 6203 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6204 | "Invalid parameters on Main Close in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6205 | pWDICtx, pEventData); |
| 6206 | return WDI_STATUS_E_FAILURE; |
| 6207 | } |
| 6208 | |
| 6209 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6210 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6211 | ----------------------------------------------------------------------*/ |
| 6212 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6213 | "WDI Busy state - queue close request"); |
| 6214 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6215 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6216 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6217 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6218 | }/*WDI_MainCloseBusy*/ |
| 6219 | |
| 6220 | /** |
| 6221 | @brief Main FSM Shutdown function for INIT & STARTED states |
| 6222 | |
| 6223 | |
| 6224 | @param pWDICtx: pointer to the WLAN DAL context |
| 6225 | pEventData: pointer to the event information structure |
| 6226 | |
| 6227 | @see |
| 6228 | @return Result of the function call |
| 6229 | */ |
| 6230 | WDI_Status |
| 6231 | WDI_MainShutdown |
| 6232 | ( |
| 6233 | WDI_ControlBlockType* pWDICtx, |
| 6234 | WDI_EventInfoType* pEventData |
| 6235 | ) |
| 6236 | { |
| 6237 | /*-------------------------------------------------------------------- |
| 6238 | Sanity Check |
| 6239 | ----------------------------------------------------------------------*/ |
| 6240 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6241 | { |
| 6242 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6243 | "Invalid parameters on Main Start %x %x", |
| 6244 | pWDICtx, pEventData); |
| 6245 | return WDI_STATUS_E_FAILURE; |
| 6246 | } |
| 6247 | |
| 6248 | /*State at this point is BUSY - because we enter this state before posting |
| 6249 | an event to the FSM in order to prevent potential race conditions*/ |
| 6250 | |
| 6251 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6252 | "Processing shutdown request in FSM"); |
| 6253 | |
| 6254 | /*Return Success*/ |
| 6255 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6256 | |
| 6257 | }/*WDI_MainShutdown*/ |
| 6258 | |
| 6259 | /** |
| 6260 | @brief Main FSM Shutdown function for BUSY state |
| 6261 | |
| 6262 | |
| 6263 | @param pWDICtx: pointer to the WLAN DAL context |
| 6264 | pEventData: pointer to the event information structure |
| 6265 | |
| 6266 | @see |
| 6267 | @return Result of the function call |
| 6268 | */ |
| 6269 | WDI_Status |
| 6270 | WDI_MainShutdownBusy |
| 6271 | ( |
| 6272 | WDI_ControlBlockType* pWDICtx, |
| 6273 | WDI_EventInfoType* pEventData |
| 6274 | ) |
| 6275 | { |
| 6276 | /*-------------------------------------------------------------------- |
| 6277 | Sanity Check |
| 6278 | ----------------------------------------------------------------------*/ |
| 6279 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6280 | { |
| 6281 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6282 | "Invalid parameters on Main Start %x %x", |
| 6283 | pWDICtx, pEventData); |
| 6284 | return WDI_STATUS_E_FAILURE; |
| 6285 | } |
| 6286 | |
| 6287 | /* If you are waiting for a HAL response at this stage, you are not |
| 6288 | * going to get it. Riva is already shutdown/crashed. |
| 6289 | */ |
| 6290 | wpalTimerStop(&gWDICb.wptResponseTimer); |
| 6291 | |
| 6292 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6293 | "Processing shutdown request in FSM: Busy state "); |
| 6294 | |
| 6295 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6296 | |
| 6297 | }/*WDI_MainShutdownBusy*/ |
| 6298 | |
| 6299 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6300 | /*======================================================================= |
| 6301 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6302 | WLAN DAL Control Path Main Processing Functions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6303 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6304 | *=======================================================================*/ |
| 6305 | |
| 6306 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6307 | Main DAL Control Path Request Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6308 | ========================================================================*/ |
| 6309 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6310 | @brief Process Start Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6311 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6312 | |
| 6313 | @param pWDICtx: pointer to the WLAN DAL context |
| 6314 | pEventData: pointer to the event information structure |
| 6315 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6316 | @see |
| 6317 | @return Result of the function call |
| 6318 | */ |
| 6319 | WDI_Status |
| 6320 | WDI_ProcessStartReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6321 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6322 | WDI_ControlBlockType* pWDICtx, |
| 6323 | WDI_EventInfoType* pEventData |
| 6324 | ) |
| 6325 | { |
| 6326 | WDI_StartReqParamsType* pwdiStartParams = NULL; |
| 6327 | WDI_StartRspCb wdiStartRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6328 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6329 | wpt_uint16 usDataOffset = 0; |
| 6330 | wpt_uint16 usSendSize = 0; |
| 6331 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6332 | tHalMacStartReqMsg halStartReq; |
| 6333 | wpt_uint16 usLen = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6334 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6335 | |
| 6336 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6337 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6338 | -------------------------------------------------------------------------*/ |
| 6339 | if (( NULL == pEventData ) || |
| 6340 | ( NULL == (pwdiStartParams = (WDI_StartReqParamsType*)pEventData->pEventData)) || |
| 6341 | ( NULL == (wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc))) |
| 6342 | { |
| 6343 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6344 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6345 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6346 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6347 | } |
| 6348 | |
| 6349 | /*----------------------------------------------------------------------- |
| 6350 | Get message buffer |
| 6351 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6352 | usLen = sizeof(halStartReq.startReqParams) + |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6353 | pwdiStartParams->usConfigBufferLen; |
| 6354 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6355 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6356 | usLen, |
| 6357 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6358 | ( usSendSize < (usDataOffset + usLen ))) |
| 6359 | { |
| 6360 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6361 | "Unable to get send buffer in start req %x %x %x", |
| 6362 | pEventData, pwdiStartParams, wdiStartRspCb); |
| 6363 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6364 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6365 | } |
| 6366 | |
| 6367 | /*----------------------------------------------------------------------- |
| 6368 | Fill in the message |
| 6369 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6370 | halStartReq.startReqParams.driverType = |
| 6371 | WDI_2_HAL_DRV_TYPE(pwdiStartParams->wdiDriverType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6372 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6373 | halStartReq.startReqParams.uConfigBufferLen = |
| 6374 | pwdiStartParams->usConfigBufferLen; |
| 6375 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6376 | &halStartReq.startReqParams, |
| 6377 | sizeof(halStartReq.startReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6378 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6379 | usDataOffset += sizeof(halStartReq.startReqParams); |
| 6380 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6381 | pwdiStartParams->pConfigBuffer, |
| 6382 | pwdiStartParams->usConfigBufferLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6383 | |
| 6384 | pWDICtx->wdiReqStatusCB = pwdiStartParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6385 | pWDICtx->pReqStatusUserData = pwdiStartParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6386 | |
| 6387 | /*Save Low Level Ind CB and associated user data - it will be used further |
| 6388 | on when an indication is coming from the lower MAC*/ |
| 6389 | pWDICtx->wdiLowLevelIndCB = pwdiStartParams->wdiLowLevelIndCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6390 | pWDICtx->pIndUserData = pwdiStartParams->pIndUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6391 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6392 | pWDICtx->bFrameTransEnabled = pwdiStartParams->bFrameTransEnabled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6393 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6394 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6395 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6396 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6397 | wdiStartRspCb, pEventData->pUserData, WDI_START_RESP); |
| 6398 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6399 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6400 | }/*WDI_ProcessStartReq*/ |
| 6401 | |
| 6402 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6403 | @brief Process Stop Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6404 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6405 | |
| 6406 | @param pWDICtx: pointer to the WLAN DAL context |
| 6407 | pEventData: pointer to the event information structure |
| 6408 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6409 | @see |
| 6410 | @return Result of the function call |
| 6411 | */ |
| 6412 | WDI_Status |
| 6413 | WDI_ProcessStopReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6414 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6415 | WDI_ControlBlockType* pWDICtx, |
| 6416 | WDI_EventInfoType* pEventData |
| 6417 | ) |
| 6418 | { |
| 6419 | WDI_StopReqParamsType* pwdiStopParams = NULL; |
| 6420 | WDI_StopRspCb wdiStopRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6421 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6422 | wpt_uint16 usDataOffset = 0; |
| 6423 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6424 | wpt_status status; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6425 | tHalMacStopReqMsg halStopReq; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6426 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6427 | |
| 6428 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6429 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6430 | -------------------------------------------------------------------------*/ |
| 6431 | if (( NULL == pEventData ) || |
| 6432 | ( NULL == (pwdiStopParams = (WDI_StopReqParamsType*)pEventData->pEventData)) || |
| 6433 | ( NULL == (wdiStopRspCb = (WDI_StopRspCb)pEventData->pCBfnc))) |
| 6434 | { |
| 6435 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6436 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6437 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6438 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6439 | } |
| 6440 | |
| 6441 | /*----------------------------------------------------------------------- |
| 6442 | Get message buffer |
| 6443 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6444 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_STOP_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6445 | sizeof(halStopReq.stopReqParams), |
| 6446 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6447 | ( usSendSize < (usDataOffset + sizeof(halStopReq.stopReqParams) ))) |
| 6448 | { |
| 6449 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6450 | "Unable to get send buffer in stop req %x %x %x", |
| 6451 | pEventData, pwdiStopParams, wdiStopRspCb); |
| 6452 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6453 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6454 | } |
| 6455 | |
| 6456 | /*----------------------------------------------------------------------- |
| 6457 | Fill in the message |
| 6458 | -----------------------------------------------------------------------*/ |
| 6459 | halStopReq.stopReqParams.reason = WDI_2_HAL_STOP_REASON( |
| 6460 | pwdiStopParams->wdiStopReason); |
| 6461 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6462 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6463 | &halStopReq.stopReqParams, |
| 6464 | sizeof(halStopReq.stopReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6465 | |
| 6466 | pWDICtx->wdiReqStatusCB = pwdiStopParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6467 | pWDICtx->pReqStatusUserData = pwdiStopParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6468 | |
| 6469 | /*! TO DO: stop the data services */ |
| 6470 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 6471 | { |
| 6472 | /*Stop the STA Table !UT- check this logic again |
| 6473 | It is safer to do it here than on the response - because a stop is imminent*/ |
| 6474 | WDI_STATableStop(pWDICtx); |
| 6475 | |
| 6476 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6477 | status = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 6478 | if (eWLAN_PAL_STATUS_SUCCESS != status) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6479 | { |
| 6480 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6481 | "WDI Init failed to reset power state event"); |
| 6482 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6483 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6484 | return VOS_STATUS_E_FAILURE; |
| 6485 | } |
| 6486 | /* Stop Transport Driver, DXE */ |
| 6487 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_DOWN, WDI_SetPowerStateCb); |
| 6488 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6489 | * 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] | 6490 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6491 | status = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 6492 | WDI_SET_POWER_STATE_TIMEOUT); |
| 6493 | if (eWLAN_PAL_STATUS_SUCCESS != status) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6494 | { |
| 6495 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6496 | "WDI Init failed to wait on an event"); |
| 6497 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6498 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6499 | return VOS_STATUS_E_FAILURE; |
| 6500 | } |
| 6501 | } |
| 6502 | |
| 6503 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6504 | Send Stop Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6505 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6506 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6507 | wdiStopRspCb, pEventData->pUserData, WDI_STOP_RESP); |
| 6508 | |
| 6509 | }/*WDI_ProcessStopReq*/ |
| 6510 | |
| 6511 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6512 | @brief Process Close Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6513 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6514 | |
| 6515 | @param pWDICtx: pointer to the WLAN DAL context |
| 6516 | pEventData: pointer to the event information structure |
| 6517 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6518 | @see |
| 6519 | @return Result of the function call |
| 6520 | */ |
| 6521 | WDI_Status |
| 6522 | WDI_ProcessCloseReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6523 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6524 | WDI_ControlBlockType* pWDICtx, |
| 6525 | WDI_EventInfoType* pEventData |
| 6526 | ) |
| 6527 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6528 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6529 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6530 | |
| 6531 | /*Lock control block for cleanup*/ |
| 6532 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6533 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6534 | /*Clear all pending request*/ |
| 6535 | WDI_ClearPendingRequests(pWDICtx); |
| 6536 | |
| 6537 | /* Close Control transport*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6538 | WCTS_CloseTransport(pWDICtx->wctsHandle); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6539 | |
| 6540 | /* Close Data transport*/ |
| 6541 | /* FTM mode does not open Data Path */ |
| 6542 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 6543 | { |
| 6544 | WDTS_Close(pWDICtx); |
| 6545 | } |
| 6546 | |
| 6547 | /*Close the STA Table !UT- check this logic again*/ |
| 6548 | WDI_STATableClose(pWDICtx); |
| 6549 | |
| 6550 | /*close the PAL */ |
| 6551 | wptStatus = wpalClose(pWDICtx->pPALContext); |
| 6552 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 6553 | { |
| 6554 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6555 | "Failed to wpal Close %d", wptStatus); |
| 6556 | WDI_ASSERT(0); |
| 6557 | } |
| 6558 | |
| 6559 | /*Transition back to init state*/ |
| 6560 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
| 6561 | |
| 6562 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6563 | |
| 6564 | /*Make sure the expected state is properly defaulted to Init*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6565 | pWDICtx->ucExpectedStateTransition = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6566 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6567 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6568 | }/*WDI_ProcessCloseReq*/ |
| 6569 | |
| 6570 | |
| 6571 | /*=========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6572 | SCANING REQUEST PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6573 | ===========================================================================*/ |
| 6574 | |
| 6575 | /** |
| 6576 | @brief Process Init Scan Request function (called when Main FSM |
| 6577 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6578 | |
| 6579 | @param pWDICtx: pointer to the WLAN DAL context |
| 6580 | pEventData: pointer to the event information structure |
| 6581 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6582 | @see |
| 6583 | @return Result of the function call |
| 6584 | */ |
| 6585 | WDI_Status |
| 6586 | WDI_ProcessInitScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6587 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6588 | WDI_ControlBlockType* pWDICtx, |
| 6589 | WDI_EventInfoType* pEventData |
| 6590 | ) |
| 6591 | { |
| 6592 | WDI_InitScanReqParamsType* pwdiInitScanParams = NULL; |
| 6593 | WDI_InitScanRspCb wdiInitScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6594 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6595 | wpt_uint16 usDataOffset = 0; |
| 6596 | wpt_uint16 usSendSize = 0; |
| 6597 | wpt_uint8 i = 0; |
| 6598 | |
| 6599 | tHalInitScanReqMsg halInitScanReqMsg; |
| 6600 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6601 | /*This is temporary fix. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6602 | * It shold be removed once host and riva changes are in sync*/ |
| 6603 | tHalInitScanConReqMsg halInitScanConReqMsg; |
| 6604 | |
| 6605 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6606 | |
| 6607 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6608 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6609 | -------------------------------------------------------------------------*/ |
| 6610 | if (( NULL == pEventData ) || |
| 6611 | ( NULL == (pwdiInitScanParams = (WDI_InitScanReqParamsType*)pEventData->pEventData)) || |
| 6612 | ( NULL == (wdiInitScanRspCb = (WDI_InitScanRspCb)pEventData->pCBfnc))) |
| 6613 | { |
| 6614 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6615 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6616 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6617 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6618 | } |
| 6619 | |
| 6620 | #if 0 |
| 6621 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6622 | /*----------------------------------------------------------------------- |
| 6623 | Check to see if SCAN is already in progress - if so reject the req |
| 6624 | We only allow one scan at a time |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6625 | ! TO DO: - revisit this constraint |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6626 | -----------------------------------------------------------------------*/ |
| 6627 | if ( pWDICtx->bScanInProgress ) |
| 6628 | { |
| 6629 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6630 | "Scan is already in progress - subsequent scan is not allowed" |
| 6631 | " until the first scan completes"); |
| 6632 | |
| 6633 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6634 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6635 | } |
| 6636 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6637 | pWDICtx->bScanInProgress = eWLAN_PAL_TRUE; |
| 6638 | pWDICtx->uScanState = WDI_SCAN_INITIALIZED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6639 | |
| 6640 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6641 | #endif |
| 6642 | |
| 6643 | if (pwdiInitScanParams->wdiReqInfo.bUseNOA) |
| 6644 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6645 | /*This is temporary fix. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6646 | * It shold be removed once host and riva changes are in sync*/ |
| 6647 | /*----------------------------------------------------------------------- |
| 6648 | Get message buffer |
| 6649 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6650 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_CON_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6651 | sizeof(halInitScanConReqMsg.initScanParams), |
| 6652 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6653 | ( usSendSize < (usDataOffset + sizeof(halInitScanConReqMsg.initScanParams) ))) |
| 6654 | { |
| 6655 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6656 | "Unable to get send buffer in init scan req %x %x %x", |
| 6657 | pEventData, pwdiInitScanParams, wdiInitScanRspCb); |
| 6658 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6659 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6660 | } |
| 6661 | |
| 6662 | |
| 6663 | /*----------------------------------------------------------------------- |
| 6664 | Fill in the message |
| 6665 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6666 | halInitScanConReqMsg.initScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6667 | WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode); |
| 6668 | |
| 6669 | wpalMemoryCopy(halInitScanConReqMsg.initScanParams.bssid, |
| 6670 | pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 6671 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6672 | halInitScanConReqMsg.initScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6673 | pwdiInitScanParams->wdiReqInfo.bNotifyBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6674 | halInitScanConReqMsg.initScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6675 | pwdiInitScanParams->wdiReqInfo.ucFrameType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6676 | halInitScanConReqMsg.initScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6677 | pwdiInitScanParams->wdiReqInfo.ucFrameLength; |
| 6678 | |
| 6679 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanConReqMsg.initScanParams.macMgmtHdr, |
| 6680 | &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 6681 | |
| 6682 | #ifdef WLAN_FEATURE_P2P |
| 6683 | halInitScanConReqMsg.initScanParams.useNoA = pwdiInitScanParams->wdiReqInfo.bUseNOA; |
| 6684 | halInitScanConReqMsg.initScanParams.scanDuration = pwdiInitScanParams->wdiReqInfo.scanDuration; |
| 6685 | #endif |
| 6686 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6687 | halInitScanConReqMsg.initScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6688 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; |
| 6689 | |
| 6690 | for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 6691 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6692 | halInitScanConReqMsg.initScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6693 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i]; |
| 6694 | } |
| 6695 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6696 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6697 | &halInitScanConReqMsg.initScanParams, |
| 6698 | sizeof(halInitScanConReqMsg.initScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6699 | } |
| 6700 | else |
| 6701 | { |
| 6702 | /*----------------------------------------------------------------------- |
| 6703 | Get message buffer |
| 6704 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6705 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6706 | sizeof(halInitScanReqMsg.initScanParams), |
| 6707 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6708 | ( usSendSize < (usDataOffset + sizeof(halInitScanReqMsg.initScanParams) ))) |
| 6709 | { |
| 6710 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6711 | "Unable to get send buffer in init scan req %x %x %x", |
| 6712 | pEventData, pwdiInitScanParams, wdiInitScanRspCb); |
| 6713 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6714 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6715 | } |
| 6716 | |
| 6717 | |
| 6718 | /*----------------------------------------------------------------------- |
| 6719 | Fill in the message |
| 6720 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6721 | halInitScanReqMsg.initScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6722 | WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode); |
| 6723 | |
| 6724 | wpalMemoryCopy(halInitScanReqMsg.initScanParams.bssid, |
| 6725 | pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 6726 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6727 | halInitScanReqMsg.initScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6728 | pwdiInitScanParams->wdiReqInfo.bNotifyBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6729 | halInitScanReqMsg.initScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6730 | pwdiInitScanParams->wdiReqInfo.ucFrameType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6731 | halInitScanReqMsg.initScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6732 | pwdiInitScanParams->wdiReqInfo.ucFrameLength; |
| 6733 | |
| 6734 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanReqMsg.initScanParams.macMgmtHdr, |
| 6735 | &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 6736 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6737 | halInitScanReqMsg.initScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6738 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; |
| 6739 | |
| 6740 | for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 6741 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6742 | halInitScanReqMsg.initScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6743 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i]; |
| 6744 | } |
| 6745 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6746 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6747 | &halInitScanReqMsg.initScanParams, |
| 6748 | sizeof(halInitScanReqMsg.initScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6749 | } |
| 6750 | |
| 6751 | pWDICtx->wdiReqStatusCB = pwdiInitScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6752 | pWDICtx->pReqStatusUserData = pwdiInitScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6753 | |
| 6754 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6755 | Send Init Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6756 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6757 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6758 | wdiInitScanRspCb, pEventData->pUserData, WDI_INIT_SCAN_RESP); |
| 6759 | |
| 6760 | }/*WDI_ProcessInitScanReq*/ |
| 6761 | |
| 6762 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6763 | @brief Process Start Scan Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6764 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6765 | |
| 6766 | @param pWDICtx: pointer to the WLAN DAL context |
| 6767 | pEventData: pointer to the event information structure |
| 6768 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6769 | @see |
| 6770 | @return Result of the function call |
| 6771 | */ |
| 6772 | WDI_Status |
| 6773 | WDI_ProcessStartScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6774 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6775 | WDI_ControlBlockType* pWDICtx, |
| 6776 | WDI_EventInfoType* pEventData |
| 6777 | ) |
| 6778 | { |
| 6779 | WDI_StartScanReqParamsType* pwdiStartScanParams = NULL; |
| 6780 | WDI_StartScanRspCb wdiStartScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6781 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6782 | wpt_uint16 usDataOffset = 0; |
| 6783 | wpt_uint16 usSendSize = 0; |
| 6784 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6785 | tHalStartScanReqMsg halStartScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6786 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6787 | |
| 6788 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6789 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6790 | -------------------------------------------------------------------------*/ |
| 6791 | if (( NULL == pEventData ) || |
| 6792 | ( NULL == (pwdiStartScanParams = (WDI_StartScanReqParamsType*)pEventData->pEventData)) || |
| 6793 | ( NULL == (wdiStartScanRspCb = (WDI_StartScanRspCb)pEventData->pCBfnc))) |
| 6794 | { |
| 6795 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6796 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6797 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6798 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6799 | } |
| 6800 | |
| 6801 | #if 0 |
| 6802 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6803 | /*----------------------------------------------------------------------- |
| 6804 | Check to see if SCAN is already in progress - start scan is only |
| 6805 | 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] | 6806 | is either init or end |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6807 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6808 | if (( !pWDICtx->bScanInProgress ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6809 | (( WDI_SCAN_INITIALIZED_ST != pWDICtx->uScanState ) && |
| 6810 | ( WDI_SCAN_ENDED_ST != pWDICtx->uScanState ))) |
| 6811 | { |
| 6812 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6813 | "Scan start not allowed in this state %d %d", |
| 6814 | pWDICtx->bScanInProgress, pWDICtx->uScanState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6815 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6816 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6817 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6818 | } |
| 6819 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6820 | pWDICtx->uScanState = WDI_SCAN_STARTED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6821 | |
| 6822 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6823 | #endif |
| 6824 | |
| 6825 | /*----------------------------------------------------------------------- |
| 6826 | Get message buffer |
| 6827 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6828 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6829 | sizeof(halStartScanReqMsg.startScanParams), |
| 6830 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6831 | ( usSendSize < (usDataOffset + sizeof(halStartScanReqMsg.startScanParams) ))) |
| 6832 | { |
| 6833 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6834 | "Unable to get send buffer in start scan req %x %x %x", |
| 6835 | pEventData, pwdiStartScanParams, wdiStartScanRspCb); |
| 6836 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6837 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6838 | } |
| 6839 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6840 | halStartScanReqMsg.startScanParams.scanChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6841 | pwdiStartScanParams->ucChannel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6842 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6843 | &halStartScanReqMsg.startScanParams, |
| 6844 | sizeof(halStartScanReqMsg.startScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6845 | |
| 6846 | pWDICtx->wdiReqStatusCB = pwdiStartScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6847 | pWDICtx->pReqStatusUserData = pwdiStartScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6848 | |
| 6849 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6850 | Send Start Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6851 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6852 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6853 | wdiStartScanRspCb, pEventData->pUserData, WDI_START_SCAN_RESP); |
| 6854 | }/*WDI_ProcessStartScanReq*/ |
| 6855 | |
| 6856 | |
| 6857 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6858 | @brief Process End Scan Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6859 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6860 | |
| 6861 | @param pWDICtx: pointer to the WLAN DAL context |
| 6862 | pEventData: pointer to the event information structure |
| 6863 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6864 | @see |
| 6865 | @return Result of the function call |
| 6866 | */ |
| 6867 | WDI_Status |
| 6868 | WDI_ProcessEndScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6869 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6870 | WDI_ControlBlockType* pWDICtx, |
| 6871 | WDI_EventInfoType* pEventData |
| 6872 | ) |
| 6873 | { |
| 6874 | WDI_EndScanReqParamsType* pwdiEndScanParams = NULL; |
| 6875 | WDI_EndScanRspCb wdiEndScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6876 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6877 | wpt_uint16 usDataOffset = 0; |
| 6878 | wpt_uint16 usSendSize = 0; |
| 6879 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6880 | tHalEndScanReqMsg halEndScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6881 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6882 | |
| 6883 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6884 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6885 | -------------------------------------------------------------------------*/ |
| 6886 | if (( NULL == pEventData ) || |
| 6887 | ( NULL == (pwdiEndScanParams = (WDI_EndScanReqParamsType*)pEventData->pEventData)) || |
| 6888 | ( NULL == (wdiEndScanRspCb = (WDI_EndScanRspCb)pEventData->pCBfnc))) |
| 6889 | { |
| 6890 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6891 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6892 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6893 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6894 | } |
| 6895 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6896 | /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN |
| 6897 | * sometimes because of this check the scan request is not being |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6898 | * forwarded to HAL and result in hang*/ |
| 6899 | #if 0 |
| 6900 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6901 | /*----------------------------------------------------------------------- |
| 6902 | Check to see if SCAN is already in progress - end scan is only |
| 6903 | allowed when a scan is ongoing and the state of the scan procedure |
| 6904 | is started |
| 6905 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6906 | if (( !pWDICtx->bScanInProgress ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6907 | ( WDI_SCAN_STARTED_ST != pWDICtx->uScanState )) |
| 6908 | { |
| 6909 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6910 | "End start not allowed in this state %d %d", |
| 6911 | pWDICtx->bScanInProgress, pWDICtx->uScanState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6912 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6913 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6914 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6915 | } |
| 6916 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6917 | pWDICtx->uScanState = WDI_SCAN_ENDED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6918 | |
| 6919 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6920 | #endif |
| 6921 | |
| 6922 | /*----------------------------------------------------------------------- |
| 6923 | Get message buffer |
| 6924 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6925 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_END_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6926 | sizeof(halEndScanReqMsg.endScanParams), |
| 6927 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6928 | ( usSendSize < (usDataOffset + sizeof(halEndScanReqMsg.endScanParams) ))) |
| 6929 | { |
| 6930 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6931 | "Unable to get send buffer in start scan req %x %x %x", |
| 6932 | pEventData, pwdiEndScanParams, wdiEndScanRspCb); |
| 6933 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6934 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6935 | } |
| 6936 | |
| 6937 | halEndScanReqMsg.endScanParams.scanChannel = pwdiEndScanParams->ucChannel; |
| 6938 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6939 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6940 | &halEndScanReqMsg.endScanParams, |
| 6941 | sizeof(halEndScanReqMsg.endScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6942 | |
| 6943 | pWDICtx->wdiReqStatusCB = pwdiEndScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6944 | pWDICtx->pReqStatusUserData = pwdiEndScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6945 | |
| 6946 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6947 | Send End Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6948 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6949 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6950 | wdiEndScanRspCb, pEventData->pUserData, WDI_END_SCAN_RESP); |
| 6951 | }/*WDI_ProcessEndScanReq*/ |
| 6952 | |
| 6953 | |
| 6954 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6955 | @brief Process Finish Scan Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6956 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6957 | |
| 6958 | @param pWDICtx: pointer to the WLAN DAL context |
| 6959 | pEventData: pointer to the event information structure |
| 6960 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6961 | @see |
| 6962 | @return Result of the function call |
| 6963 | */ |
| 6964 | WDI_Status |
| 6965 | WDI_ProcessFinishScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6966 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6967 | WDI_ControlBlockType* pWDICtx, |
| 6968 | WDI_EventInfoType* pEventData |
| 6969 | ) |
| 6970 | { |
| 6971 | WDI_FinishScanReqParamsType* pwdiFinishScanParams; |
| 6972 | WDI_FinishScanRspCb wdiFinishScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6973 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6974 | wpt_uint16 usDataOffset = 0; |
| 6975 | wpt_uint16 usSendSize = 0; |
| 6976 | wpt_uint8 i = 0; |
| 6977 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6978 | tHalFinishScanReqMsg halFinishScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6979 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6980 | |
| 6981 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6982 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6983 | -------------------------------------------------------------------------*/ |
| 6984 | if (( NULL == pEventData ) || |
| 6985 | ( NULL == pEventData->pEventData) || |
| 6986 | ( NULL == pEventData->pCBfnc)) |
| 6987 | { |
| 6988 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6989 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6990 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6991 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6992 | } |
| 6993 | |
| 6994 | pwdiFinishScanParams = (WDI_FinishScanReqParamsType*)pEventData->pEventData; |
| 6995 | wdiFinishScanRspCb = (WDI_FinishScanRspCb)pEventData->pCBfnc; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6996 | /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN |
| 6997 | * sometimes because of this check the scan request is not being |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6998 | * forwarded to HAL and result in hang*/ |
| 6999 | #if 0 |
| 7000 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7001 | /*----------------------------------------------------------------------- |
| 7002 | Check to see if SCAN is already in progress |
| 7003 | Finish scan gets invoked any scan states. ie. abort scan |
| 7004 | It should be allowed in any states. |
| 7005 | -----------------------------------------------------------------------*/ |
| 7006 | if ( !pWDICtx->bScanInProgress ) |
| 7007 | { |
| 7008 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7009 | "Finish start not allowed in this state %d", |
| 7010 | pWDICtx->bScanInProgress ); |
| 7011 | |
| 7012 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7013 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7014 | } |
| 7015 | |
| 7016 | /*----------------------------------------------------------------------- |
| 7017 | 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] | 7018 | back all subsequent requests will be blocked at BUSY state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7019 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7020 | pWDICtx->uScanState = WDI_SCAN_FINISHED_ST; |
| 7021 | pWDICtx->bScanInProgress = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7022 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7023 | #endif |
| 7024 | |
| 7025 | if ( pWDICtx->bInBmps ) |
| 7026 | { |
| 7027 | // notify DTS that we are entering BMPS |
| 7028 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, NULL); |
| 7029 | } |
| 7030 | |
| 7031 | /*----------------------------------------------------------------------- |
| 7032 | Get message buffer |
| 7033 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7034 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FINISH_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7035 | sizeof(halFinishScanReqMsg.finishScanParams), |
| 7036 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7037 | ( usSendSize < (usDataOffset + sizeof(halFinishScanReqMsg.finishScanParams) ))) |
| 7038 | { |
| 7039 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7040 | "Unable to get send buffer in start scan req %x %x %x", |
| 7041 | pEventData, pwdiFinishScanParams, wdiFinishScanRspCb); |
| 7042 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7043 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7044 | } |
| 7045 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7046 | halFinishScanReqMsg.finishScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7047 | WDI_2_HAL_SCAN_MODE(pwdiFinishScanParams->wdiReqInfo.wdiScanMode); |
| 7048 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7049 | halFinishScanReqMsg.finishScanParams.currentOperChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7050 | pwdiFinishScanParams->wdiReqInfo.ucCurrentOperatingChannel; |
| 7051 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7052 | halFinishScanReqMsg.finishScanParams.cbState = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7053 | WDI_2_HAL_CB_STATE(pwdiFinishScanParams->wdiReqInfo.wdiCBState); |
| 7054 | |
| 7055 | wpalMemoryCopy(halFinishScanReqMsg.finishScanParams.bssid, |
| 7056 | pwdiFinishScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 7057 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7058 | halFinishScanReqMsg.finishScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7059 | pwdiFinishScanParams->wdiReqInfo.bNotifyBSS ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7060 | halFinishScanReqMsg.finishScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7061 | pwdiFinishScanParams->wdiReqInfo.ucFrameType ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7062 | halFinishScanReqMsg.finishScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7063 | pwdiFinishScanParams->wdiReqInfo.ucFrameLength ; |
| 7064 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7065 | halFinishScanReqMsg.finishScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7066 | pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt ; |
| 7067 | |
| 7068 | for (i = 0; i < pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 7069 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7070 | halFinishScanReqMsg.finishScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7071 | pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i] ; |
| 7072 | } |
| 7073 | |
| 7074 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halFinishScanReqMsg.finishScanParams.macMgmtHdr, |
| 7075 | &pwdiFinishScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 7076 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7077 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7078 | &halFinishScanReqMsg.finishScanParams, |
| 7079 | sizeof(halFinishScanReqMsg.finishScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7080 | |
| 7081 | pWDICtx->wdiReqStatusCB = pwdiFinishScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7082 | pWDICtx->pReqStatusUserData = pwdiFinishScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7083 | |
| 7084 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7085 | Send Finish Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7086 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7087 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7088 | wdiFinishScanRspCb, pEventData->pUserData, WDI_FINISH_SCAN_RESP); |
| 7089 | }/*WDI_ProcessFinishScanReq*/ |
| 7090 | |
| 7091 | |
| 7092 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7093 | ASSOCIATION REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7094 | ==========================================================================*/ |
| 7095 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7096 | @brief Process BSS Join for a given Session |
| 7097 | |
| 7098 | @param pWDICtx: pointer to the WLAN DAL context |
| 7099 | pEventData: pointer to the event information structure |
| 7100 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7101 | @see |
| 7102 | @return Result of the function call |
| 7103 | */ |
| 7104 | WDI_Status |
| 7105 | WDI_ProcessBSSSessionJoinReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7106 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7107 | WDI_ControlBlockType* pWDICtx, |
| 7108 | WDI_JoinReqParamsType* pwdiJoinParams, |
| 7109 | WDI_JoinRspCb wdiJoinRspCb, |
| 7110 | void* pUserData |
| 7111 | ) |
| 7112 | { |
| 7113 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7114 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7115 | wpt_uint16 usDataOffset = 0; |
| 7116 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7117 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7118 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7119 | tHalJoinReqMsg halJoinReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7120 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7121 | |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7122 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7123 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7124 | /*------------------------------------------------------------------------ |
| 7125 | Check to see if we have any session with this BSSID already stored, we |
| 7126 | should not |
| 7127 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7128 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 7129 | pwdiJoinParams->wdiReqInfo.macBSSID, |
| 7130 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7131 | |
| 7132 | if ( NULL != pBSSSes ) |
| 7133 | { |
| 7134 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7135 | "Association for this BSSID: " MAC_ADDRESS_STR " is already in place", |
| 7136 | MAC_ADDR_ARRAY(pwdiJoinParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7137 | |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7138 | /*reset the bAssociationInProgress otherwise the next |
| 7139 | *join request will be queued*/ |
| 7140 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 7141 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7142 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7143 | } |
| 7144 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7145 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7146 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7147 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7148 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7149 | if ( NULL == pBSSSes ) |
| 7150 | { |
| 7151 | |
| 7152 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7153 | "DAL has no free sessions - cannot run another join"); |
| 7154 | |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7155 | /*reset the bAssociationInProgress otherwise the next |
| 7156 | *join request will be queued*/ |
| 7157 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7158 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7159 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7160 | } |
| 7161 | |
| 7162 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7163 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7164 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiJoinParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7165 | WDI_MAC_ADDR_LEN); |
| 7166 | |
| 7167 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7168 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7169 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7170 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7171 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7172 | |
| 7173 | /*----------------------------------------------------------------------- |
| 7174 | Get message buffer |
| 7175 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7176 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_JOIN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7177 | sizeof(halJoinReqMsg.joinReqParams), |
| 7178 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7179 | ( usSendSize < (usDataOffset + sizeof(halJoinReqMsg.joinReqParams) ))) |
| 7180 | { |
| 7181 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7182 | "Unable to get send buffer in join req %x %x %x", |
| 7183 | pUserData, pwdiJoinParams, wdiJoinRspCb); |
| 7184 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7185 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7186 | } |
| 7187 | |
| 7188 | wpalMemoryCopy(halJoinReqMsg.joinReqParams.bssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7189 | pwdiJoinParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7190 | |
| 7191 | wpalMemoryCopy(halJoinReqMsg.joinReqParams.selfStaMacAddr, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7192 | pwdiJoinParams->wdiReqInfo.macSTASelf, |
| 7193 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7194 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7195 | halJoinReqMsg.joinReqParams.ucChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7196 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucChannel; |
| 7197 | |
| 7198 | halJoinReqMsg.joinReqParams.linkState = pwdiJoinParams->wdiReqInfo.linkState; |
| 7199 | |
Madan Mohan Koyyalamudi | 83b1282 | 2012-11-02 12:43:10 -0700 | [diff] [blame] | 7200 | #ifdef WLAN_FEATURE_VOWIFI |
| 7201 | halJoinReqMsg.joinReqParams.maxTxPower = |
| 7202 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.cMaxTxPower; |
| 7203 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7204 | halJoinReqMsg.joinReqParams.ucLocalPowerConstraint = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7205 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucLocalPowerConstraint; |
| 7206 | #endif |
| 7207 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7208 | halJoinReqMsg.joinReqParams.secondaryChannelOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7209 | WDI_2_HAL_SEC_CH_OFFSET(pwdiJoinParams->wdiReqInfo.wdiChannelInfo. |
| 7210 | wdiSecondaryChannelOffset); |
| 7211 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7212 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7213 | &halJoinReqMsg.joinReqParams, |
| 7214 | sizeof(halJoinReqMsg.joinReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7215 | |
| 7216 | pWDICtx->wdiReqStatusCB = pwdiJoinParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7217 | pWDICtx->pReqStatusUserData = pwdiJoinParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7218 | |
| 7219 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7220 | Send Join Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7221 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7222 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 7223 | wdiJoinRspCb, pUserData, WDI_JOIN_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7224 | |
| 7225 | }/*WDI_ProcessBSSSessionJoinReq*/ |
| 7226 | |
| 7227 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7228 | @brief Process Join Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7229 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7230 | |
| 7231 | @param pWDICtx: pointer to the WLAN DAL context |
| 7232 | pEventData: pointer to the event information structure |
| 7233 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7234 | @see |
| 7235 | @return Result of the function call |
| 7236 | */ |
| 7237 | WDI_Status |
| 7238 | WDI_ProcessJoinReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7239 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7240 | WDI_ControlBlockType* pWDICtx, |
| 7241 | WDI_EventInfoType* pEventData |
| 7242 | ) |
| 7243 | { |
| 7244 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 7245 | WDI_JoinReqParamsType* pwdiJoinParams = NULL; |
| 7246 | WDI_JoinRspCb wdiJoinRspCb = NULL; |
| 7247 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7248 | |
| 7249 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7250 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7251 | -------------------------------------------------------------------------*/ |
| 7252 | if (( NULL == pEventData ) || |
| 7253 | ( NULL == (pwdiJoinParams = (WDI_JoinReqParamsType*)pEventData->pEventData)) || |
| 7254 | ( NULL == (wdiJoinRspCb = (WDI_JoinRspCb)pEventData->pCBfnc))) |
| 7255 | { |
| 7256 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7257 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7258 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7259 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7260 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7261 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7262 | /*------------------------------------------------------------------------- |
| 7263 | 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] | 7264 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7265 | -------------------------------------------------------------------------*/ |
| 7266 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7267 | |
| 7268 | if ( eWLAN_PAL_FALSE != pWDICtx->bAssociationInProgress ) |
| 7269 | { |
| 7270 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7271 | "Association is currently in progress, queueing new join req"); |
| 7272 | |
| 7273 | /*Association is in progress - queue current one*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7274 | wdiStatus = WDI_QueueNewAssocRequest(pWDICtx, pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7275 | pwdiJoinParams->wdiReqInfo.macBSSID); |
| 7276 | |
| 7277 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7278 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7279 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7280 | } |
| 7281 | |
| 7282 | /*Starting a new association */ |
| 7283 | pWDICtx->bAssociationInProgress = eWLAN_PAL_TRUE; |
| 7284 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7285 | |
| 7286 | /*Process the Join Request*/ |
| 7287 | return WDI_ProcessBSSSessionJoinReq( pWDICtx, pwdiJoinParams, |
| 7288 | wdiJoinRspCb,pEventData->pUserData); |
| 7289 | |
| 7290 | }/*WDI_ProcessJoinReq*/ |
| 7291 | |
| 7292 | |
| 7293 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7294 | @brief Process Config BSS Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7295 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7296 | |
| 7297 | @param pWDICtx: pointer to the WLAN DAL context |
| 7298 | pEventData: pointer to the event information structure |
| 7299 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7300 | @see |
| 7301 | @return Result of the function call |
| 7302 | */ |
| 7303 | WDI_Status |
| 7304 | WDI_ProcessConfigBSSReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7305 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7306 | WDI_ControlBlockType* pWDICtx, |
| 7307 | WDI_EventInfoType* pEventData |
| 7308 | ) |
| 7309 | { |
| 7310 | WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams; |
| 7311 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7312 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7313 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7314 | wpt_uint16 uMsgSize = 0; |
| 7315 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7316 | wpt_uint16 usDataOffset = 0; |
| 7317 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7318 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7319 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7320 | tConfigBssReqMsg halConfigBssReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7321 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7322 | |
| 7323 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7324 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7325 | -------------------------------------------------------------------------*/ |
| 7326 | if (( NULL == pEventData ) || |
| 7327 | ( NULL == pEventData->pEventData ) || |
| 7328 | ( NULL == pEventData->pCBfnc )) |
| 7329 | { |
| 7330 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7331 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7332 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7333 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7334 | } |
| 7335 | |
| 7336 | pwdiConfigBSSParams = (WDI_ConfigBSSReqParamsType*)pEventData->pEventData; |
| 7337 | wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pEventData->pCBfnc; |
| 7338 | /*------------------------------------------------------------------------- |
| 7339 | 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] | 7340 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7341 | -------------------------------------------------------------------------*/ |
| 7342 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7343 | |
| 7344 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7345 | Find the BSS for which the request is made |
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_FindAssocSession( pWDICtx, |
| 7348 | pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
| 7349 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7350 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7351 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7352 | { |
| 7353 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 7354 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7355 | Fetch an empty session block |
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 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7358 | if ( NULL == pBSSSes ) |
| 7359 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7360 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7361 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7362 | "DAL has no free sessions - cannot run another join"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7363 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7364 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7365 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7366 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7367 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7368 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7369 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7370 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7371 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7372 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7373 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7374 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7375 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
| 7376 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7377 | /* 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] | 7378 | * Request in case of IBSS*/ |
| 7379 | if((pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_IBSS_MODE) || |
| 7380 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_INFRA_AP_MODE) || |
| 7381 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_AP_MODE) || |
| 7382 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_STA_MODE)) |
| 7383 | { |
| 7384 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7385 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7386 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7387 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7388 | if ( NULL == pBSSSes ) |
| 7389 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7390 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7391 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7392 | "DAL has no free sessions - cannot run another join"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7393 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7394 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7395 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7396 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7397 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7398 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7399 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7400 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7401 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7402 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7403 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7404 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7405 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
| 7406 | } |
| 7407 | else |
| 7408 | { |
| 7409 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7410 | "%s: Association sequence for this BSS does not yet exist." MAC_ADDRESS_STR "wdiBssType %d", |
| 7411 | __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID), |
| 7412 | pwdiConfigBSSParams->wdiReqInfo.wdiBSSType); |
| 7413 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7414 | /* for IBSS testing */ |
| 7415 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7416 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7417 | } |
| 7418 | #endif |
| 7419 | } |
| 7420 | |
| 7421 | /*------------------------------------------------------------------------ |
| 7422 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7423 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7424 | ------------------------------------------------------------------------*/ |
| 7425 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7426 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7427 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7428 | "%s: Association sequence for this BSS exists but currently queued. " MAC_ADDRESS_STR " bssIdx %d", |
| 7429 | __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID), |
| 7430 | ucCurrentBSSSesIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7431 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7432 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7433 | |
| 7434 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7435 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7436 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7437 | } |
| 7438 | |
| 7439 | /* Cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7440 | wpalMemoryCopy(&pWDICtx->wdiCachedConfigBssReq, |
| 7441 | pwdiConfigBSSParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7442 | sizeof(pWDICtx->wdiCachedConfigBssReq)); |
| 7443 | |
| 7444 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7445 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7446 | /* Allocation of BssReqMsg Memory Based on Firmware Capabilities */ |
| 7447 | #ifdef WLAN_FEATURE_11AC |
| 7448 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 7449 | uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams_V1); // Version - 1 For 11AC |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7450 | else |
| 7451 | #endif |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 7452 | uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams); // default Version - 0 Structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7453 | |
| 7454 | /*----------------------------------------------------------------------- |
| 7455 | Get message buffer |
| 7456 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7457 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_BSS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7458 | uMsgSize, &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7459 | ( usSendSize < (usDataOffset + uMsgSize ))) |
| 7460 | { |
| 7461 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7462 | "Unable to get send buffer in config bss req %x %x %x", |
| 7463 | pEventData, pwdiConfigBSSParams, wdiConfigBSSRspCb); |
| 7464 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7465 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7466 | } |
| 7467 | |
| 7468 | /*Copy the BSS request */ |
Madan Mohan Koyyalamudi | a208d10 | 2012-10-15 15:18:18 -0700 | [diff] [blame] | 7469 | #ifdef WLAN_FEATURE_11AC |
| 7470 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
| 7471 | WDI_CopyWDIConfigBSSToHALConfigBSS( (tConfigBssParams*)&halConfigBssReqMsg.uBssParams.configBssParams_V1, |
| 7472 | &pwdiConfigBSSParams->wdiReqInfo); |
| 7473 | else |
| 7474 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7475 | WDI_CopyWDIConfigBSSToHALConfigBSS( &halConfigBssReqMsg.uBssParams.configBssParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7476 | &pwdiConfigBSSParams->wdiReqInfo); |
| 7477 | |
| 7478 | /* Need to fill in the STA Index to invalid, since at this point we have not |
| 7479 | yet received it from HAL */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7480 | halConfigBssReqMsg.uBssParams.configBssParams.staContext.staIdx = WDI_STA_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7481 | |
| 7482 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7483 | halConfigBssReqMsg.uBssParams.configBssParams.staContext.bssIdx = pBSSSes->ucBSSIdx; |
| 7484 | |
| 7485 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7486 | &halConfigBssReqMsg.uBssParams.configBssParams, |
| 7487 | uMsgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7488 | |
| 7489 | pWDICtx->wdiReqStatusCB = pwdiConfigBSSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7490 | pWDICtx->pReqStatusUserData = pwdiConfigBSSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7491 | |
| 7492 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7493 | Send Config BSS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7494 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7495 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 7496 | wdiConfigBSSRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7497 | WDI_CONFIG_BSS_RESP); |
| 7498 | |
| 7499 | }/*WDI_ProcessConfigBSSReq*/ |
| 7500 | |
| 7501 | |
| 7502 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7503 | @brief Process Del BSS Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7504 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7505 | |
| 7506 | @param pWDICtx: pointer to the WLAN DAL context |
| 7507 | pEventData: pointer to the event information structure |
| 7508 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7509 | @see |
| 7510 | @return Result of the function call |
| 7511 | */ |
| 7512 | WDI_Status |
| 7513 | WDI_ProcessDelBSSReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7514 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7515 | WDI_ControlBlockType* pWDICtx, |
| 7516 | WDI_EventInfoType* pEventData |
| 7517 | ) |
| 7518 | { |
| 7519 | WDI_DelBSSReqParamsType* pwdiDelBSSParams = NULL; |
| 7520 | WDI_DelBSSRspCb wdiDelBSSRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7521 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7522 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7523 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7524 | wpt_uint16 usDataOffset = 0; |
| 7525 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7526 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7527 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7528 | tDeleteBssReqMsg halBssReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7529 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7530 | |
| 7531 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7532 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7533 | -------------------------------------------------------------------------*/ |
| 7534 | if (( NULL == pEventData ) || |
| 7535 | ( NULL == (pwdiDelBSSParams = (WDI_DelBSSReqParamsType*)pEventData->pEventData)) || |
| 7536 | ( NULL == (wdiDelBSSRspCb = (WDI_DelBSSRspCb)pEventData->pCBfnc))) |
| 7537 | { |
| 7538 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7539 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7540 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7541 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7542 | } |
| 7543 | |
| 7544 | /*------------------------------------------------------------------------- |
| 7545 | 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] | 7546 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7547 | -------------------------------------------------------------------------*/ |
| 7548 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7549 | |
| 7550 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7551 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7552 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7553 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 7554 | pwdiDelBSSParams->ucBssIdx, |
| 7555 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7556 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7557 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7558 | { |
| 7559 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7560 | "%s: BSS does not yet exist. ucBssIdx %d", |
| 7561 | __func__, pwdiDelBSSParams->ucBssIdx); |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame^] | 7562 | |
| 7563 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7564 | |
| 7565 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7566 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame^] | 7567 | |
| 7568 | /*------------------------------------------------------------------------ |
| 7569 | Check if this BSS is being currently processed or queued, |
| 7570 | if queued - queue the new request as well |
| 7571 | ------------------------------------------------------------------------*/ |
| 7572 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7573 | { |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame^] | 7574 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7575 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 7576 | __func__, pwdiDelBSSParams->ucBssIdx); |
| 7577 | |
| 7578 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
| 7579 | |
| 7580 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7581 | |
| 7582 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7583 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame^] | 7584 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7585 | /*----------------------------------------------------------------------- |
| 7586 | If we receive a Del BSS request for an association that is already in |
| 7587 | progress, it indicates that the assoc has failed => we no longer have |
| 7588 | an association in progress => we must check for pending associations |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7589 | 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] | 7590 | -----------------------------------------------------------------------*/ |
| 7591 | if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx ) |
| 7592 | { |
| 7593 | /*We can switch to false here because even if a subsequent Join comes in |
| 7594 | it will only be processed when DAL transitions out of BUSY state which |
| 7595 | happens when the Del BSS request comes */ |
| 7596 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 7597 | |
| 7598 | /*Former association is complete - prepare next pending assoc for |
| 7599 | processing */ |
| 7600 | WDI_DequeueAssocRequest(pWDICtx); |
| 7601 | } |
| 7602 | |
| 7603 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7604 | /*----------------------------------------------------------------------- |
| 7605 | Get message buffer |
| 7606 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7607 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BSS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7608 | sizeof(halBssReqMsg.deleteBssParams), |
| 7609 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7610 | ( usSendSize < (usDataOffset + sizeof(halBssReqMsg.deleteBssParams) ))) |
| 7611 | { |
| 7612 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7613 | "Unable to get send buffer in start req %x %x %x", |
| 7614 | pEventData, pwdiDelBSSParams, wdiDelBSSRspCb); |
| 7615 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7616 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7617 | } |
| 7618 | |
| 7619 | /*Fill in the message request structure*/ |
| 7620 | |
| 7621 | /*BSS Index is saved on config BSS response and Post Assoc Response */ |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame^] | 7622 | halBssReqMsg.deleteBssParams.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7623 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7624 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7625 | &halBssReqMsg.deleteBssParams, |
| 7626 | sizeof(halBssReqMsg.deleteBssParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7627 | |
| 7628 | pWDICtx->wdiReqStatusCB = pwdiDelBSSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7629 | pWDICtx->pReqStatusUserData = pwdiDelBSSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7630 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7631 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7632 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7633 | Send Del BSS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7634 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7635 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7636 | wdiDelBSSRspCb, pEventData->pUserData, WDI_DEL_BSS_RESP); |
| 7637 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7638 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7639 | }/*WDI_ProcessDelBSSReq*/ |
| 7640 | |
| 7641 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7642 | @brief Process Post Assoc Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7643 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7644 | |
| 7645 | @param pWDICtx: pointer to the WLAN DAL context |
| 7646 | pEventData: pointer to the event information structure |
| 7647 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7648 | @see |
| 7649 | @return Result of the function call |
| 7650 | */ |
| 7651 | WDI_Status |
| 7652 | WDI_ProcessPostAssocReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7653 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7654 | WDI_ControlBlockType* pWDICtx, |
| 7655 | WDI_EventInfoType* pEventData |
| 7656 | ) |
| 7657 | { |
| 7658 | WDI_PostAssocReqParamsType* pwdiPostAssocParams = NULL; |
| 7659 | WDI_PostAssocRspCb wdiPostAssocRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7660 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7661 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7662 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7663 | wpt_uint16 usDataOffset = 0; |
| 7664 | wpt_uint16 usSendSize = 0; |
| 7665 | wpt_uint16 uMsgSize = 0; |
| 7666 | wpt_uint16 uOffset = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7667 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7668 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7669 | tPostAssocReqMsg halPostAssocReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7670 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7671 | |
| 7672 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7673 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7674 | -------------------------------------------------------------------------*/ |
| 7675 | if (( NULL == pEventData ) || |
| 7676 | ( NULL == (pwdiPostAssocParams = (WDI_PostAssocReqParamsType*)pEventData->pEventData)) || |
| 7677 | ( NULL == (wdiPostAssocRspCb = (WDI_PostAssocRspCb)pEventData->pCBfnc))) |
| 7678 | { |
| 7679 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7680 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7681 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7682 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7683 | } |
| 7684 | |
| 7685 | /*------------------------------------------------------------------------- |
| 7686 | 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] | 7687 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7688 | -------------------------------------------------------------------------*/ |
| 7689 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7690 | |
| 7691 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7692 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7693 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7694 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 7695 | pwdiPostAssocParams->wdiBSSParams.macBSSID, |
| 7696 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7697 | |
| 7698 | if ( NULL == pBSSSes ) |
| 7699 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7700 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7701 | "%s: Association sequence for this BSS does not yet exist - " |
| 7702 | "operation not allowed. macBSSID " MAC_ADDRESS_STR, |
| 7703 | __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7704 | |
| 7705 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7706 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7707 | } |
| 7708 | |
| 7709 | /*------------------------------------------------------------------------ |
| 7710 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7711 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7712 | ------------------------------------------------------------------------*/ |
| 7713 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7714 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7715 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7716 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 7717 | __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7718 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7719 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7720 | |
| 7721 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7722 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7723 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7724 | } |
| 7725 | |
| 7726 | /*----------------------------------------------------------------------- |
| 7727 | If Post Assoc was not yet received - the current association must |
| 7728 | be in progress |
| 7729 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7730 | if (( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7731 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 7732 | { |
| 7733 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7734 | "Association sequence for this BSS association no longer in " |
| 7735 | "progress - not allowed"); |
| 7736 | |
| 7737 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7738 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7739 | } |
| 7740 | |
| 7741 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7742 | Post Assoc Request is only allowed in Joining state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7743 | -----------------------------------------------------------------------*/ |
| 7744 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 7745 | { |
| 7746 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7747 | "Post Assoc not allowed before JOIN - failing request"); |
| 7748 | |
| 7749 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7750 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7751 | } |
| 7752 | |
| 7753 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7754 | |
| 7755 | uMsgSize = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams) + |
| 7756 | sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams) ; |
| 7757 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7758 | Fill message for tx over the bus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7759 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7760 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_POST_ASSOC_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7761 | uMsgSize,&pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7762 | ( usSendSize < (usDataOffset + uMsgSize ))) |
| 7763 | { |
| 7764 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7765 | "Unable to get send buffer in start req %x %x %x", |
| 7766 | pEventData, pwdiPostAssocParams, wdiPostAssocRspCb); |
| 7767 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7768 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7769 | } |
| 7770 | |
| 7771 | /*Copy the STA parameters */ |
| 7772 | WDI_CopyWDIStaCtxToHALStaCtx(&halPostAssocReqMsg.postAssocReqParams.configStaParams, |
| 7773 | &pwdiPostAssocParams->wdiSTAParams ); |
| 7774 | |
| 7775 | /* Need to fill in the self STA Index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7776 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7777 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 7778 | pwdiPostAssocParams->wdiSTAParams.macSTA, |
| 7779 | (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configStaParams.staIdx )) |
| 7780 | { |
| 7781 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7782 | "This station does not exist in the WDI Station Table %d"); |
| 7783 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7784 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7785 | } |
| 7786 | |
| 7787 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7788 | halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7789 | pBSSSes->ucBSSIdx; |
| 7790 | |
| 7791 | /*Copy the BSS parameters */ |
| 7792 | WDI_CopyWDIConfigBSSToHALConfigBSS( &halPostAssocReqMsg.postAssocReqParams.configBssParams, |
| 7793 | &pwdiPostAssocParams->wdiBSSParams); |
| 7794 | |
| 7795 | /* Need to fill in the STA index of the peer */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7796 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7797 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 7798 | pwdiPostAssocParams->wdiBSSParams.wdiSTAContext.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7799 | (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configBssParams.staContext.staIdx)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7800 | { |
| 7801 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7802 | "This station does not exist in the WDI Station Table %d"); |
| 7803 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7804 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7805 | } |
| 7806 | |
| 7807 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7808 | halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7809 | pBSSSes->ucBSSIdx; |
| 7810 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7811 | |
| 7812 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7813 | &halPostAssocReqMsg.postAssocReqParams.configStaParams, |
| 7814 | sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7815 | |
| 7816 | uOffset = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams); |
| 7817 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7818 | wpalMemoryCopy( pSendBuffer+usDataOffset + uOffset, |
| 7819 | &halPostAssocReqMsg.postAssocReqParams.configBssParams, |
| 7820 | sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7821 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7822 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7823 | pWDICtx->wdiReqStatusCB = pwdiPostAssocParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7824 | pWDICtx->pReqStatusUserData = pwdiPostAssocParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7825 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7826 | |
| 7827 | wpalMemoryCopy( &pWDICtx->wdiCachedPostAssocReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7828 | pwdiPostAssocParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7829 | sizeof(pWDICtx->wdiCachedPostAssocReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7830 | |
| 7831 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7832 | Send Post Assoc Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7833 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7834 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7835 | wdiPostAssocRspCb, pEventData->pUserData, WDI_POST_ASSOC_RESP); |
| 7836 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7837 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7838 | }/*WDI_ProcessPostAssocReq*/ |
| 7839 | |
| 7840 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7841 | @brief Process Del STA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7842 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7843 | |
| 7844 | @param pWDICtx: pointer to the WLAN DAL context |
| 7845 | pEventData: pointer to the event information structure |
| 7846 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7847 | @see |
| 7848 | @return Result of the function call |
| 7849 | */ |
| 7850 | WDI_Status |
| 7851 | WDI_ProcessDelSTAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7852 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7853 | WDI_ControlBlockType* pWDICtx, |
| 7854 | WDI_EventInfoType* pEventData |
| 7855 | ) |
| 7856 | { |
| 7857 | WDI_DelSTAReqParamsType* pwdiDelSTAParams; |
| 7858 | WDI_DelSTARspCb wdiDelSTARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7859 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7860 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7861 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7862 | wpt_uint16 usDataOffset = 0; |
| 7863 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7864 | wpt_macAddr macBSSID; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7865 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 7866 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7867 | tDeleteStaReqMsg halDelStaReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7868 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7869 | |
| 7870 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7871 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7872 | -------------------------------------------------------------------------*/ |
| 7873 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 7874 | ( NULL == pEventData->pCBfnc )) |
| 7875 | { |
| 7876 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7877 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7878 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7879 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7880 | } |
| 7881 | |
| 7882 | pwdiDelSTAParams = (WDI_DelSTAReqParamsType*)pEventData->pEventData; |
| 7883 | wdiDelSTARspCb = (WDI_DelSTARspCb)pEventData->pCBfnc; |
| 7884 | /*------------------------------------------------------------------------- |
| 7885 | 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] | 7886 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7887 | -------------------------------------------------------------------------*/ |
| 7888 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7889 | |
| 7890 | /*------------------------------------------------------------------------ |
| 7891 | Find the BSS for which the request is made and identify WDI session |
| 7892 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7893 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 7894 | pwdiDelSTAParams->ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7895 | &macBSSID)) |
| 7896 | { |
| 7897 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7898 | "This station does not exist in the WDI Station Table %d"); |
| 7899 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7900 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7901 | } |
| 7902 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7903 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 7904 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7905 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7906 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7907 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 7908 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7909 | |
| 7910 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7911 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7912 | } |
| 7913 | |
| 7914 | /*------------------------------------------------------------------------ |
| 7915 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7916 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7917 | ------------------------------------------------------------------------*/ |
| 7918 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7919 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7920 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7921 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 7922 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7923 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7924 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7925 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7926 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7927 | } |
| 7928 | |
| 7929 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7930 | /*----------------------------------------------------------------------- |
| 7931 | Get message buffer |
| 7932 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7933 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7934 | sizeof(halDelStaReqMsg.delStaParams), |
| 7935 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7936 | ( usSendSize < (usDataOffset + sizeof(halDelStaReqMsg.delStaParams) ))) |
| 7937 | { |
| 7938 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7939 | "Unable to get send buffer in start req %x %x %x", |
| 7940 | pEventData, pwdiDelSTAParams, wdiDelSTARspCb); |
| 7941 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7942 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7943 | } |
| 7944 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7945 | halDelStaReqMsg.delStaParams.staIdx = pwdiDelSTAParams->ucSTAIdx; |
| 7946 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7947 | &halDelStaReqMsg.delStaParams, |
| 7948 | sizeof(halDelStaReqMsg.delStaParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7949 | |
| 7950 | pWDICtx->wdiReqStatusCB = pwdiDelSTAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7951 | pWDICtx->pReqStatusUserData = pwdiDelSTAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7952 | |
| 7953 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7954 | Send Del STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7955 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7956 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7957 | wdiDelSTARspCb, pEventData->pUserData, WDI_DEL_STA_RESP); |
| 7958 | |
| 7959 | }/*WDI_ProcessDelSTAReq*/ |
| 7960 | |
| 7961 | |
| 7962 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7963 | SECURITY REQUEST PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7964 | ==========================================================================*/ |
| 7965 | /** |
| 7966 | @brief Process Set BSS Key Request function (called when Main FSM |
| 7967 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7968 | |
| 7969 | @param pWDICtx: pointer to the WLAN DAL context |
| 7970 | pEventData: pointer to the event information structure |
| 7971 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7972 | @see |
| 7973 | @return Result of the function call |
| 7974 | */ |
| 7975 | WDI_Status |
| 7976 | WDI_ProcessSetBssKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7977 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7978 | WDI_ControlBlockType* pWDICtx, |
| 7979 | WDI_EventInfoType* pEventData |
| 7980 | ) |
| 7981 | { |
| 7982 | WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams; |
| 7983 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7984 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7985 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7986 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7987 | wpt_uint16 usDataOffset = 0; |
| 7988 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7989 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7990 | tSetBssKeyReqMsg halSetBssKeyReqMsg = {{0}}; |
| 7991 | wpt_uint8 keyIndex = 0; |
| 7992 | |
| 7993 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7994 | |
| 7995 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7996 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7997 | -------------------------------------------------------------------------*/ |
| 7998 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 7999 | ( NULL == pEventData->pCBfnc )) |
| 8000 | { |
| 8001 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8002 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8003 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8004 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8005 | } |
| 8006 | |
| 8007 | pwdiSetBSSKeyParams = (WDI_SetBSSKeyReqParamsType*)pEventData->pEventData; |
| 8008 | wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pEventData->pCBfnc; |
| 8009 | /*------------------------------------------------------------------------- |
| 8010 | 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] | 8011 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8012 | -------------------------------------------------------------------------*/ |
| 8013 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8014 | |
| 8015 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8016 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8017 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8018 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 8019 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx, |
| 8020 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8021 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8022 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8023 | { |
| 8024 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8025 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 8026 | __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8027 | |
| 8028 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8029 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8030 | } |
| 8031 | |
| 8032 | /*------------------------------------------------------------------------ |
| 8033 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8034 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8035 | ------------------------------------------------------------------------*/ |
| 8036 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8037 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8038 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8039 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 8040 | __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8041 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8042 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8043 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8044 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8045 | } |
| 8046 | |
| 8047 | |
| 8048 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8049 | /*----------------------------------------------------------------------- |
| 8050 | Get message buffer |
| 8051 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8052 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BSS_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8053 | sizeof(halSetBssKeyReqMsg.setBssKeyParams), |
| 8054 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8055 | ( usSendSize < (usDataOffset + sizeof(halSetBssKeyReqMsg.setBssKeyParams) ))) |
| 8056 | { |
| 8057 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8058 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8059 | pEventData, pwdiSetBSSKeyParams, wdiSetBSSKeyRspCb); |
| 8060 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8061 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8062 | } |
| 8063 | |
| 8064 | /*----------------------------------------------------------------------- |
| 8065 | Copy the Key parameters into the HAL message |
| 8066 | -----------------------------------------------------------------------*/ |
| 8067 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8068 | halSetBssKeyReqMsg.setBssKeyParams.bssIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8069 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8070 | halSetBssKeyReqMsg.setBssKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8071 | WDI_2_HAL_ENC_TYPE (pwdiSetBSSKeyParams->wdiBSSKeyInfo.wdiEncType); |
| 8072 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8073 | halSetBssKeyReqMsg.setBssKeyParams.numKeys = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8074 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys; |
| 8075 | |
| 8076 | for(keyIndex = 0; keyIndex < pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys ; |
| 8077 | keyIndex++) |
| 8078 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8079 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8080 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyId; |
| 8081 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].unicast = |
| 8082 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].unicast; |
| 8083 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyDirection = |
| 8084 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyDirection; |
| 8085 | wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8086 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8087 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8088 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8089 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8090 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8091 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyLength; |
| 8092 | wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8093 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8094 | WDI_MAX_KEY_LENGTH); |
| 8095 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8096 | |
| 8097 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8098 | &halSetBssKeyReqMsg.setBssKeyParams, |
| 8099 | sizeof(halSetBssKeyReqMsg.setBssKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8100 | |
| 8101 | pWDICtx->wdiReqStatusCB = pwdiSetBSSKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8102 | pWDICtx->pReqStatusUserData = pwdiSetBSSKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8103 | |
| 8104 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8105 | Send Set BSS Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8106 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8107 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8108 | wdiSetBSSKeyRspCb, pEventData->pUserData, |
| 8109 | WDI_SET_BSS_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8110 | |
| 8111 | }/*WDI_ProcessSetBssKeyReq*/ |
| 8112 | |
| 8113 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8114 | @brief Process Remove BSS Key Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8115 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8116 | |
| 8117 | @param pWDICtx: pointer to the WLAN DAL context |
| 8118 | pEventData: pointer to the event information structure |
| 8119 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8120 | @see |
| 8121 | @return Result of the function call |
| 8122 | */ |
| 8123 | WDI_Status |
| 8124 | WDI_ProcessRemoveBssKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8125 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8126 | WDI_ControlBlockType* pWDICtx, |
| 8127 | WDI_EventInfoType* pEventData |
| 8128 | ) |
| 8129 | { |
| 8130 | WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams; |
| 8131 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8132 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8133 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8134 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8135 | wpt_uint16 usDataOffset = 0; |
| 8136 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8137 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8138 | tRemoveBssKeyReqMsg halRemoveBssKeyReqMsg = {{0}}; |
| 8139 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8140 | |
| 8141 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8142 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8143 | -------------------------------------------------------------------------*/ |
| 8144 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8145 | ( NULL == pEventData->pCBfnc )) |
| 8146 | { |
| 8147 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8148 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8149 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8150 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8151 | } |
| 8152 | |
| 8153 | pwdiRemoveBSSKeyParams = (WDI_RemoveBSSKeyReqParamsType*)pEventData->pEventData; |
| 8154 | wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pEventData->pCBfnc; |
| 8155 | /*------------------------------------------------------------------------- |
| 8156 | 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] | 8157 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8158 | -------------------------------------------------------------------------*/ |
| 8159 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8160 | |
| 8161 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8162 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8163 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8164 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 8165 | pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx, |
| 8166 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8167 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8168 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8169 | { |
| 8170 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8171 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 8172 | __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8173 | |
| 8174 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8175 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8176 | } |
| 8177 | |
| 8178 | /*------------------------------------------------------------------------ |
| 8179 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8180 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8181 | ------------------------------------------------------------------------*/ |
| 8182 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8183 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8184 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8185 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 8186 | __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8187 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8188 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8189 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8190 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8191 | } |
| 8192 | |
| 8193 | |
| 8194 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8195 | |
| 8196 | /*----------------------------------------------------------------------- |
| 8197 | Get message buffer |
| 8198 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8199 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_BSS_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8200 | sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams), |
| 8201 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8202 | ( usSendSize < (usDataOffset + sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams) ))) |
| 8203 | { |
| 8204 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8205 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8206 | pEventData, pwdiRemoveBSSKeyParams, wdiRemoveBSSKeyRspCb); |
| 8207 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8208 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8209 | } |
| 8210 | /*----------------------------------------------------------------------- |
| 8211 | Copy the Key parameters into the HAL message |
| 8212 | -----------------------------------------------------------------------*/ |
| 8213 | halRemoveBssKeyReqMsg.removeBssKeyParams.bssIdx = ucCurrentBSSSesIdx; |
| 8214 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8215 | halRemoveBssKeyReqMsg.removeBssKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8216 | WDI_2_HAL_ENC_TYPE (pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiEncType); |
| 8217 | |
| 8218 | halRemoveBssKeyReqMsg.removeBssKeyParams.keyId = pwdiRemoveBSSKeyParams->wdiKeyInfo.ucKeyId; |
| 8219 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8220 | halRemoveBssKeyReqMsg.removeBssKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8221 | WDI_2_HAL_WEP_TYPE(pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiWEPType); |
| 8222 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8223 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8224 | &halRemoveBssKeyReqMsg.removeBssKeyParams, |
| 8225 | sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8226 | |
| 8227 | pWDICtx->wdiReqStatusCB = pwdiRemoveBSSKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8228 | pWDICtx->pReqStatusUserData = pwdiRemoveBSSKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8229 | |
| 8230 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8231 | Send Remove BSS Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8232 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8233 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8234 | wdiRemoveBSSKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8235 | WDI_RMV_BSS_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8236 | }/*WDI_ProcessRemoveBssKeyReq*/ |
| 8237 | |
| 8238 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8239 | @brief Process Set STA KeyRequest function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8240 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8241 | |
| 8242 | @param pWDICtx: pointer to the WLAN DAL context |
| 8243 | pEventData: pointer to the event information structure |
| 8244 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8245 | @see |
| 8246 | @return Result of the function call |
| 8247 | */ |
| 8248 | WDI_Status |
| 8249 | WDI_ProcessSetStaKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8250 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8251 | WDI_ControlBlockType* pWDICtx, |
| 8252 | WDI_EventInfoType* pEventData |
| 8253 | ) |
| 8254 | { |
| 8255 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams; |
| 8256 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 8257 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8258 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8259 | wpt_uint16 usDataOffset = 0; |
| 8260 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8261 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8262 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8263 | wpt_uint8 ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8264 | tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}}; |
| 8265 | wpt_uint8 keyIndex = 0; |
| 8266 | |
| 8267 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8268 | |
| 8269 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8270 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8271 | -------------------------------------------------------------------------*/ |
| 8272 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8273 | ( NULL == pEventData->pCBfnc )) |
| 8274 | { |
| 8275 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8276 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8277 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8278 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8279 | } |
| 8280 | |
| 8281 | pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData; |
| 8282 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc; |
| 8283 | /*------------------------------------------------------------------------- |
| 8284 | 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] | 8285 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8286 | -------------------------------------------------------------------------*/ |
| 8287 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8288 | |
| 8289 | /*------------------------------------------------------------------------ |
| 8290 | Find the BSS for which the request is made and identify WDI session |
| 8291 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8292 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8293 | pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8294 | &macBSSID)) |
| 8295 | { |
| 8296 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8297 | "This station does not exist in the WDI Station Table %d"); |
| 8298 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8299 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8300 | } |
| 8301 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8302 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8303 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8304 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8305 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8306 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8307 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8308 | |
| 8309 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8310 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8311 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8312 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8313 | /*------------------------------------------------------------------------ |
| 8314 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8315 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8316 | ------------------------------------------------------------------------*/ |
| 8317 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8318 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8319 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8320 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8321 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8322 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8323 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8324 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8325 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8326 | } |
| 8327 | |
| 8328 | |
| 8329 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8330 | /*----------------------------------------------------------------------- |
| 8331 | Get message buffer |
| 8332 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8333 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8334 | sizeof(halSetStaKeyReqMsg.setStaKeyParams), |
| 8335 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8336 | ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) ))) |
| 8337 | { |
| 8338 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8339 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8340 | pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb); |
| 8341 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8342 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8343 | } |
| 8344 | /*----------------------------------------------------------------------- |
| 8345 | Copy the STA Key parameters into the HAL message |
| 8346 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8347 | halSetStaKeyReqMsg.setStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8348 | WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8349 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8350 | halSetStaKeyReqMsg.setStaKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8351 | WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType ); |
| 8352 | |
| 8353 | halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8354 | |
| 8355 | halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx; |
| 8356 | |
| 8357 | halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc; |
| 8358 | |
| 8359 | #ifdef WLAN_SOFTAP_FEATURE |
| 8360 | for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ; |
| 8361 | keyIndex++) |
| 8362 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8363 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8364 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId; |
| 8365 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast = |
| 8366 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast; |
| 8367 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection = |
| 8368 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection; |
| 8369 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8370 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8371 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8372 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8373 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8374 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8375 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength; |
| 8376 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8377 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8378 | WDI_MAX_KEY_LENGTH); |
| 8379 | } |
| 8380 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8381 | halSetStaKeyReqMsg.setStaKeyParams.key.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8382 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId; |
| 8383 | halSetStaKeyReqMsg.setStaKeyParams.key.unicast = |
| 8384 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast; |
| 8385 | halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection = |
| 8386 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection; |
| 8387 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8388 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8389 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8390 | halSetStaKeyReqMsg.setStaKeyParams.key.paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8391 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8392 | halSetStaKeyReqMsg.setStaKeyParams.key.keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8393 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength; |
| 8394 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8395 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8396 | WDI_MAX_KEY_LENGTH); |
| 8397 | #endif |
| 8398 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8399 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8400 | &halSetStaKeyReqMsg.setStaKeyParams, |
| 8401 | sizeof(halSetStaKeyReqMsg.setStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8402 | |
| 8403 | pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8404 | pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8405 | |
| 8406 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8407 | Send Set STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8408 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8409 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8410 | wdiSetSTAKeyRspCb, pEventData->pUserData, |
| 8411 | WDI_SET_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8412 | |
| 8413 | }/*WDI_ProcessSetSTAKeyReq*/ |
| 8414 | |
| 8415 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8416 | @brief Process Remove STA Key Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8417 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8418 | |
| 8419 | @param pWDICtx: pointer to the WLAN DAL context |
| 8420 | pEventData: pointer to the event information structure |
| 8421 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8422 | @see |
| 8423 | @return Result of the function call |
| 8424 | */ |
| 8425 | WDI_Status |
| 8426 | WDI_ProcessRemoveStaKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8427 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8428 | WDI_ControlBlockType* pWDICtx, |
| 8429 | WDI_EventInfoType* pEventData |
| 8430 | ) |
| 8431 | { |
| 8432 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams; |
| 8433 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 8434 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8435 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8436 | wpt_uint16 usDataOffset = 0; |
| 8437 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8438 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8439 | wpt_macAddr macBSSID; |
| 8440 | wpt_uint8 ucCurrentBSSSesIdx; |
| 8441 | tRemoveStaKeyReqMsg halRemoveStaKeyReqMsg = {{0}}; |
| 8442 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8443 | |
| 8444 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8445 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8446 | -------------------------------------------------------------------------*/ |
| 8447 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8448 | ( NULL == pEventData->pCBfnc )) |
| 8449 | { |
| 8450 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8451 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8452 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8453 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8454 | } |
| 8455 | |
| 8456 | pwdiRemoveSTAKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData; |
| 8457 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc; |
| 8458 | /*------------------------------------------------------------------------- |
| 8459 | 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] | 8460 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8461 | -------------------------------------------------------------------------*/ |
| 8462 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8463 | |
| 8464 | /*------------------------------------------------------------------------ |
| 8465 | Find the BSS for which the request is made and identify WDI session |
| 8466 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8467 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8468 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8469 | &macBSSID)) |
| 8470 | { |
| 8471 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8472 | "This station does not exist in the WDI Station Table %d"); |
| 8473 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8474 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8475 | } |
| 8476 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8477 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8478 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8479 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8480 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8481 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8482 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8483 | |
| 8484 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8485 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8486 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8487 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8488 | /*------------------------------------------------------------------------ |
| 8489 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8490 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8491 | ------------------------------------------------------------------------*/ |
| 8492 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8493 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8494 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8495 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8496 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8497 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8498 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8499 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8500 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8501 | } |
| 8502 | |
| 8503 | |
| 8504 | |
| 8505 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8506 | /*----------------------------------------------------------------------- |
| 8507 | Get message buffer |
| 8508 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8509 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8510 | sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams), |
| 8511 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8512 | ( usSendSize < (usDataOffset + sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams) ))) |
| 8513 | { |
| 8514 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8515 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8516 | pEventData, pwdiRemoveSTAKeyParams, wdiRemoveSTAKeyRspCb); |
| 8517 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8518 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8519 | } |
| 8520 | |
| 8521 | /*----------------------------------------------------------------------- |
| 8522 | Copy the Key parameters into the HAL message |
| 8523 | -----------------------------------------------------------------------*/ |
| 8524 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8525 | halRemoveStaKeyReqMsg.removeStaKeyParams.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8526 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8527 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8528 | halRemoveStaKeyReqMsg.removeStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8529 | WDI_2_HAL_ENC_TYPE (pwdiRemoveSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8530 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8531 | halRemoveStaKeyReqMsg.removeStaKeyParams.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8532 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucKeyId; |
| 8533 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8534 | halRemoveStaKeyReqMsg.removeStaKeyParams.unicast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8535 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucUnicast; |
| 8536 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8537 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8538 | &halRemoveStaKeyReqMsg.removeStaKeyParams, |
| 8539 | sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8540 | |
| 8541 | pWDICtx->wdiReqStatusCB = pwdiRemoveSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8542 | pWDICtx->pReqStatusUserData = pwdiRemoveSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8543 | |
| 8544 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8545 | Send Remove STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8546 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8547 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8548 | wdiRemoveSTAKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8549 | WDI_RMV_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8550 | |
| 8551 | }/*WDI_ProcessRemoveSTAKeyReq*/ |
| 8552 | |
| 8553 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8554 | @brief Process Set STA KeyRequest function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8555 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8556 | |
| 8557 | @param pWDICtx: pointer to the WLAN DAL context |
| 8558 | pEventData: pointer to the event information structure |
| 8559 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8560 | @see |
| 8561 | @return Result of the function call |
| 8562 | */ |
| 8563 | WDI_Status |
| 8564 | WDI_ProcessSetStaBcastKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8565 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8566 | WDI_ControlBlockType* pWDICtx, |
| 8567 | WDI_EventInfoType* pEventData |
| 8568 | ) |
| 8569 | { |
| 8570 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams; |
| 8571 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 8572 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8573 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8574 | wpt_uint16 usDataOffset = 0; |
| 8575 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8576 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8577 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8578 | wpt_uint8 ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8579 | tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}}; |
| 8580 | wpt_uint8 keyIndex = 0; |
| 8581 | |
| 8582 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8583 | |
| 8584 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8585 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8586 | -------------------------------------------------------------------------*/ |
| 8587 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8588 | ( NULL == pEventData->pCBfnc )) |
| 8589 | { |
| 8590 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8591 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8592 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8593 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8594 | } |
| 8595 | |
| 8596 | pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData; |
| 8597 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc; |
| 8598 | /*------------------------------------------------------------------------- |
| 8599 | 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] | 8600 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8601 | -------------------------------------------------------------------------*/ |
| 8602 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8603 | |
| 8604 | /*------------------------------------------------------------------------ |
| 8605 | Find the BSS for which the request is made and identify WDI session |
| 8606 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8607 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8608 | pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8609 | &macBSSID)) |
| 8610 | { |
| 8611 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8612 | "This station does not exist in the WDI Station Table %d"); |
| 8613 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8614 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8615 | } |
| 8616 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8617 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8618 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8619 | { |
| 8620 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8621 | "Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8622 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8623 | |
| 8624 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8625 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8626 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8627 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8628 | /*------------------------------------------------------------------------ |
| 8629 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8630 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8631 | ------------------------------------------------------------------------*/ |
| 8632 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8633 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8634 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8635 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8636 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8637 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8638 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8639 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8640 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8641 | } |
| 8642 | |
| 8643 | |
| 8644 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8645 | /*----------------------------------------------------------------------- |
| 8646 | Get message buffer |
| 8647 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8648 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8649 | sizeof(halSetStaKeyReqMsg.setStaKeyParams), |
| 8650 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8651 | ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) ))) |
| 8652 | { |
| 8653 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8654 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8655 | pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb); |
| 8656 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8657 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8658 | } |
| 8659 | /*----------------------------------------------------------------------- |
| 8660 | Copy the STA Key parameters into the HAL message |
| 8661 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8662 | halSetStaKeyReqMsg.setStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8663 | WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8664 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8665 | halSetStaKeyReqMsg.setStaKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8666 | WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType ); |
| 8667 | |
| 8668 | halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8669 | |
| 8670 | halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx; |
| 8671 | |
| 8672 | halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc; |
| 8673 | |
| 8674 | #ifdef WLAN_SOFTAP_FEATURE |
| 8675 | for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ; |
| 8676 | keyIndex++) |
| 8677 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8678 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8679 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId; |
| 8680 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast = |
| 8681 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast; |
| 8682 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection = |
| 8683 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection; |
| 8684 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8685 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8686 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8687 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8688 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8689 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8690 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength; |
| 8691 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8692 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8693 | WDI_MAX_KEY_LENGTH); |
| 8694 | } |
| 8695 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8696 | halSetStaKeyReqMsg.setStaKeyParams.key.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8697 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId; |
| 8698 | halSetStaKeyReqMsg.setStaKeyParams.key.unicast = |
| 8699 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast; |
| 8700 | halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection = |
| 8701 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection; |
| 8702 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8703 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8704 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8705 | halSetStaKeyReqMsg.setStaKeyParams.key.paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8706 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8707 | halSetStaKeyReqMsg.setStaKeyParams.key.keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8708 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength; |
| 8709 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8710 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8711 | WDI_MAX_KEY_LENGTH); |
| 8712 | #endif |
| 8713 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8714 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8715 | &halSetStaKeyReqMsg.setStaKeyParams, |
| 8716 | sizeof(halSetStaKeyReqMsg.setStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8717 | |
| 8718 | pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8719 | pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8720 | |
| 8721 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8722 | Send Set STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8723 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8724 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8725 | wdiSetSTAKeyRspCb, pEventData->pUserData, |
| 8726 | WDI_SET_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8727 | |
| 8728 | }/*WDI_ProcessSetSTABcastKeyReq*/ |
| 8729 | |
| 8730 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8731 | @brief Process Remove STA Key Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8732 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8733 | |
| 8734 | @param pWDICtx: pointer to the WLAN DAL context |
| 8735 | pEventData: pointer to the event information structure |
| 8736 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8737 | @see |
| 8738 | @return Result of the function call |
| 8739 | */ |
| 8740 | WDI_Status |
| 8741 | WDI_ProcessRemoveStaBcastKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8742 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8743 | WDI_ControlBlockType* pWDICtx, |
| 8744 | WDI_EventInfoType* pEventData |
| 8745 | ) |
| 8746 | { |
| 8747 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams; |
| 8748 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 8749 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8750 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8751 | wpt_uint16 usDataOffset = 0; |
| 8752 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8753 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8754 | wpt_macAddr macBSSID; |
| 8755 | wpt_uint8 ucCurrentBSSSesIdx; |
| 8756 | tRemoveStaKeyReqMsg halRemoveStaBcastKeyReqMsg = {{0}}; |
| 8757 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8758 | |
| 8759 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8760 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8761 | -------------------------------------------------------------------------*/ |
| 8762 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8763 | ( NULL == pEventData->pCBfnc )) |
| 8764 | { |
| 8765 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8766 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8767 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8768 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8769 | } |
| 8770 | |
| 8771 | pwdiRemoveSTABcastKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData; |
| 8772 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc; |
| 8773 | /*------------------------------------------------------------------------- |
| 8774 | 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] | 8775 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8776 | -------------------------------------------------------------------------*/ |
| 8777 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8778 | |
| 8779 | /*------------------------------------------------------------------------ |
| 8780 | Find the BSS for which the request is made and identify WDI session |
| 8781 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8782 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8783 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8784 | &macBSSID)) |
| 8785 | { |
| 8786 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8787 | "This station does not exist in the WDI Station Table %d"); |
| 8788 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8789 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8790 | } |
| 8791 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8792 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8793 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8794 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8795 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8796 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8797 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8798 | |
| 8799 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8800 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8801 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8802 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8803 | /*------------------------------------------------------------------------ |
| 8804 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8805 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8806 | ------------------------------------------------------------------------*/ |
| 8807 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8808 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8809 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8810 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8811 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8812 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8813 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8814 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8815 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8816 | } |
| 8817 | |
| 8818 | |
| 8819 | |
| 8820 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8821 | /*----------------------------------------------------------------------- |
| 8822 | Get message buffer |
| 8823 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8824 | 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] | 8825 | sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams), |
| 8826 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8827 | ( usSendSize < (usDataOffset + sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams) ))) |
| 8828 | { |
| 8829 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8830 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8831 | pEventData, pwdiRemoveSTABcastKeyParams, wdiRemoveSTAKeyRspCb); |
| 8832 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8833 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8834 | } |
| 8835 | |
| 8836 | /*----------------------------------------------------------------------- |
| 8837 | Copy the Key parameters into the HAL message |
| 8838 | -----------------------------------------------------------------------*/ |
| 8839 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8840 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8841 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8842 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8843 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8844 | WDI_2_HAL_ENC_TYPE (pwdiRemoveSTABcastKeyParams->wdiKeyInfo.wdiEncType); |
| 8845 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8846 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8847 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucKeyId; |
| 8848 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8849 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.unicast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8850 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucUnicast; |
| 8851 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8852 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8853 | &halRemoveStaBcastKeyReqMsg.removeStaKeyParams, |
| 8854 | sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8855 | |
| 8856 | pWDICtx->wdiReqStatusCB = pwdiRemoveSTABcastKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8857 | pWDICtx->pReqStatusUserData = pwdiRemoveSTABcastKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8858 | |
| 8859 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8860 | Send Remove STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8861 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8862 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8863 | wdiRemoveSTAKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8864 | WDI_RMV_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8865 | |
| 8866 | }/*WDI_ProcessRemoveSTABcastKeyReq*/ |
| 8867 | |
| 8868 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8869 | QOS and BA PROCESSING REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8870 | ==========================================================================*/ |
| 8871 | /** |
| 8872 | @brief Process Add TSpec Request function (called when Main FSM |
| 8873 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8874 | |
| 8875 | @param pWDICtx: pointer to the WLAN DAL context |
| 8876 | pEventData: pointer to the event information structure |
| 8877 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8878 | @see |
| 8879 | @return Result of the function call |
| 8880 | */ |
| 8881 | WDI_Status |
| 8882 | WDI_ProcessAddTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8883 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8884 | WDI_ControlBlockType* pWDICtx, |
| 8885 | WDI_EventInfoType* pEventData |
| 8886 | ) |
| 8887 | { |
| 8888 | WDI_AddTSReqParamsType* pwdiAddTSParams; |
| 8889 | WDI_AddTsRspCb wdiAddTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8890 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8891 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8892 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8893 | wpt_uint16 usDataOffset = 0; |
| 8894 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8895 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8896 | wpt_macAddr macBSSID; |
| 8897 | tAddTsParams halAddTsParams = {0}; |
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 | |
| 8901 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8902 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8903 | -------------------------------------------------------------------------*/ |
| 8904 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8905 | ( NULL == pEventData->pCBfnc )) |
| 8906 | { |
| 8907 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8908 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8909 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8910 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8911 | } |
| 8912 | |
| 8913 | pwdiAddTSParams = (WDI_AddTSReqParamsType*)pEventData->pEventData; |
| 8914 | wdiAddTSRspCb = (WDI_AddTsRspCb)pEventData->pCBfnc; |
| 8915 | /*------------------------------------------------------------------------- |
| 8916 | 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] | 8917 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8918 | -------------------------------------------------------------------------*/ |
| 8919 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8920 | |
| 8921 | /*------------------------------------------------------------------------ |
| 8922 | Find the BSS for which the request is made and identify WDI session |
| 8923 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8924 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8925 | pwdiAddTSParams->wdiTsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8926 | &macBSSID)) |
| 8927 | { |
| 8928 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8929 | "This station does not exist in the WDI Station Table %d"); |
| 8930 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8931 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8932 | } |
| 8933 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8934 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8935 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8936 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8937 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8938 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8939 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8940 | |
| 8941 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8942 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8943 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8944 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8945 | /*------------------------------------------------------------------------ |
| 8946 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8947 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8948 | ------------------------------------------------------------------------*/ |
| 8949 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8950 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8951 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8952 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8953 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8954 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8955 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8956 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8957 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8958 | } |
| 8959 | |
| 8960 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8961 | /*----------------------------------------------------------------------- |
| 8962 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8963 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8964 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8965 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_TS_REQ, |
| 8966 | sizeof(halAddTsParams), |
| 8967 | &pSendBuffer, &usDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8968 | &usSendSize))|| |
| 8969 | ( usSendSize < (usDataOffset + sizeof(halAddTsParams) ))) |
| 8970 | { |
| 8971 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8972 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8973 | pEventData, pwdiAddTSParams, wdiAddTSRspCb); |
| 8974 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8975 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8976 | } |
| 8977 | |
| 8978 | halAddTsParams.staIdx = pwdiAddTSParams->wdiTsInfo.ucSTAIdx; |
| 8979 | halAddTsParams.tspecIdx = pwdiAddTSParams->wdiTsInfo.ucTspecIdx; |
| 8980 | |
| 8981 | //TSPEC IE |
| 8982 | halAddTsParams.tspec.type = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucType; |
| 8983 | halAddTsParams.tspec.length = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucLength; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8984 | halAddTsParams.tspec.nomMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8985 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usNomMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8986 | halAddTsParams.tspec.maxMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8987 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMaxMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8988 | halAddTsParams.tspec.minSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8989 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8990 | halAddTsParams.tspec.maxSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8991 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8992 | halAddTsParams.tspec.inactInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8993 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uInactInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8994 | halAddTsParams.tspec.suspendInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8995 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSuspendInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8996 | halAddTsParams.tspec.svcStartTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8997 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSvcStartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8998 | halAddTsParams.tspec.minDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8999 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9000 | halAddTsParams.tspec.meanDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9001 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMeanDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9002 | halAddTsParams.tspec.peakDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9003 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uPeakDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9004 | halAddTsParams.tspec.maxBurstSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9005 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxBurstSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9006 | halAddTsParams.tspec.delayBound = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9007 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uDelayBound; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9008 | halAddTsParams.tspec.minPhyRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9009 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinPhyRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9010 | halAddTsParams.tspec.surplusBw = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9011 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usSurplusBw; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9012 | halAddTsParams.tspec.mediumTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9013 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMediumTime; |
| 9014 | |
| 9015 | //TSPEC IE : TS INFO : TRAFFIC |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9016 | halAddTsParams.tspec.tsinfo.traffic.ackPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9017 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.accessPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9018 | halAddTsParams.tspec.tsinfo.traffic.userPrio = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9019 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.userPrio; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9020 | halAddTsParams.tspec.tsinfo.traffic.psb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9021 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.psb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9022 | halAddTsParams.tspec.tsinfo.traffic.aggregation = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9023 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.aggregation; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9024 | halAddTsParams.tspec.tsinfo.traffic.direction = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9025 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.direction; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9026 | halAddTsParams.tspec.tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9027 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.tsid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9028 | halAddTsParams.tspec.tsinfo.traffic.trafficType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9029 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.trafficType; |
| 9030 | |
| 9031 | //TSPEC IE : TS INFO : SCHEDULE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9032 | halAddTsParams.tspec.tsinfo.schedule.rsvd = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9033 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.rsvd; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9034 | halAddTsParams.tspec.tsinfo.schedule.schedule = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9035 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.schedule; |
| 9036 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9037 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9038 | &halAddTsParams, |
| 9039 | sizeof(halAddTsParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9040 | |
| 9041 | pWDICtx->wdiReqStatusCB = pwdiAddTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9042 | pWDICtx->pReqStatusUserData = pwdiAddTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9043 | |
| 9044 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9045 | Send Add TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9046 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9047 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9048 | wdiAddTSRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9049 | WDI_ADD_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9050 | }/*WDI_ProcessAddTSpecReq*/ |
| 9051 | |
| 9052 | |
| 9053 | /** |
| 9054 | @brief Process Del TSpec Request function (called when Main FSM |
| 9055 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9056 | |
| 9057 | @param pWDICtx: pointer to the WLAN DAL context |
| 9058 | pEventData: pointer to the event information structure |
| 9059 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9060 | @see |
| 9061 | @return Result of the function call |
| 9062 | */ |
| 9063 | WDI_Status |
| 9064 | WDI_ProcessDelTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9065 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9066 | WDI_ControlBlockType* pWDICtx, |
| 9067 | WDI_EventInfoType* pEventData |
| 9068 | ) |
| 9069 | { |
| 9070 | WDI_DelTSReqParamsType* pwdiDelTSParams; |
| 9071 | WDI_DelTsRspCb wdiDelTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9072 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9073 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9074 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9075 | wpt_uint16 usDataOffset = 0; |
| 9076 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9077 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9078 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9079 | |
| 9080 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9081 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9082 | -------------------------------------------------------------------------*/ |
| 9083 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9084 | ( NULL == pEventData->pCBfnc )) |
| 9085 | { |
| 9086 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9087 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9088 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9089 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9090 | } |
| 9091 | |
| 9092 | pwdiDelTSParams = (WDI_DelTSReqParamsType*)pEventData->pEventData; |
| 9093 | wdiDelTSRspCb = (WDI_DelTsRspCb)pEventData->pCBfnc; |
| 9094 | |
| 9095 | /*------------------------------------------------------------------------- |
| 9096 | 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] | 9097 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9098 | -------------------------------------------------------------------------*/ |
| 9099 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9100 | |
| 9101 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9102 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9103 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9104 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 9105 | pwdiDelTSParams->wdiDelTSInfo.macBSSID, |
| 9106 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9107 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9108 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9109 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9110 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9111 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9112 | __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID)); |
| 9113 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9114 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9115 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9116 | } |
| 9117 | |
| 9118 | /*------------------------------------------------------------------------ |
| 9119 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9120 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9121 | ------------------------------------------------------------------------*/ |
| 9122 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9123 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9124 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9125 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9126 | __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9127 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9128 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9129 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9130 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9131 | } |
| 9132 | |
| 9133 | |
| 9134 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9135 | /*----------------------------------------------------------------------- |
| 9136 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9137 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9138 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9139 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_TS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9140 | sizeof(pwdiDelTSParams->wdiDelTSInfo), |
| 9141 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9142 | ( usSendSize < (usDataOffset + sizeof(pwdiDelTSParams->wdiDelTSInfo) ))) |
| 9143 | { |
| 9144 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9145 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9146 | pEventData, pwdiDelTSParams, wdiDelTSRspCb); |
| 9147 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9148 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9149 | } |
| 9150 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9151 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9152 | &pwdiDelTSParams->wdiDelTSInfo, |
| 9153 | sizeof(pwdiDelTSParams->wdiDelTSInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9154 | |
| 9155 | pWDICtx->wdiReqStatusCB = pwdiDelTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9156 | pWDICtx->pReqStatusUserData = pwdiDelTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9157 | |
| 9158 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9159 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9160 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9161 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9162 | wdiDelTSRspCb, pEventData->pUserData, WDI_DEL_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9163 | }/*WDI_ProcessDelTSpecReq*/ |
| 9164 | |
| 9165 | /** |
| 9166 | @brief Process Update EDCA Params Request function (called when |
| 9167 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9168 | |
| 9169 | @param pWDICtx: pointer to the WLAN DAL context |
| 9170 | pEventData: pointer to the event information structure |
| 9171 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9172 | @see |
| 9173 | @return Result of the function call |
| 9174 | */ |
| 9175 | WDI_Status |
| 9176 | WDI_ProcessUpdateEDCAParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9177 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9178 | WDI_ControlBlockType* pWDICtx, |
| 9179 | WDI_EventInfoType* pEventData |
| 9180 | ) |
| 9181 | { |
| 9182 | WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams; |
| 9183 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9184 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9185 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9186 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9187 | wpt_uint16 usDataOffset = 0; |
| 9188 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9189 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9190 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9191 | |
| 9192 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9193 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9194 | -------------------------------------------------------------------------*/ |
| 9195 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9196 | ( NULL == pEventData->pCBfnc )) |
| 9197 | { |
| 9198 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9199 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9200 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9201 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9202 | } |
| 9203 | |
| 9204 | pwdiUpdateEDCAParams = (WDI_UpdateEDCAParamsType*)pEventData->pEventData; |
| 9205 | wdiUpdateEDCARspCb = (WDI_UpdateEDCAParamsRspCb)pEventData->pCBfnc; |
| 9206 | /*------------------------------------------------------------------------- |
| 9207 | 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] | 9208 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9209 | -------------------------------------------------------------------------*/ |
| 9210 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9211 | |
| 9212 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9213 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9214 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9215 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 9216 | pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx, |
| 9217 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9218 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9219 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9220 | { |
| 9221 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9222 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 9223 | __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9224 | |
| 9225 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9226 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9227 | } |
| 9228 | |
| 9229 | /*------------------------------------------------------------------------ |
| 9230 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9231 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9232 | ------------------------------------------------------------------------*/ |
| 9233 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9234 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9235 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9236 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 9237 | __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9238 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9239 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9240 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9241 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9242 | } |
| 9243 | |
| 9244 | |
| 9245 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9246 | /*----------------------------------------------------------------------- |
| 9247 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9248 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9249 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9250 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_EDCA_PRMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9251 | sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo), |
| 9252 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9253 | ( usSendSize < (usDataOffset + sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo) ))) |
| 9254 | { |
| 9255 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9256 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9257 | pEventData, pwdiUpdateEDCAParams, wdiUpdateEDCARspCb); |
| 9258 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9259 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9260 | } |
| 9261 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9262 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9263 | &pwdiUpdateEDCAParams->wdiEDCAInfo, |
| 9264 | sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9265 | |
| 9266 | pWDICtx->wdiReqStatusCB = pwdiUpdateEDCAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9267 | pWDICtx->pReqStatusUserData = pwdiUpdateEDCAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9268 | |
| 9269 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9270 | Send Update EDCA Params Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9271 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9272 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9273 | wdiUpdateEDCARspCb, pEventData->pUserData, |
| 9274 | WDI_UPD_EDCA_PRMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9275 | }/*WDI_ProcessUpdateEDCAParamsReq*/ |
| 9276 | |
| 9277 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9278 | @brief Process Add BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9279 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9280 | |
| 9281 | @param pWDICtx: pointer to the WLAN DAL context |
| 9282 | pEventData: pointer to the event information structure |
| 9283 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9284 | @see |
| 9285 | @return Result of the function call |
| 9286 | */ |
| 9287 | WDI_Status |
| 9288 | WDI_ProcessAddBASessionReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9289 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9290 | WDI_ControlBlockType* pWDICtx, |
| 9291 | WDI_EventInfoType* pEventData |
| 9292 | ) |
| 9293 | { |
| 9294 | WDI_AddBASessionReqParamsType* pwdiAddBASessionParams; |
| 9295 | WDI_AddBASessionRspCb wdiAddBASessionRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9296 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9297 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9298 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9299 | wpt_uint16 usDataOffset = 0; |
| 9300 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9301 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9302 | wpt_macAddr macBSSID; |
| 9303 | |
| 9304 | tAddBASessionReqMsg halAddBASessionReq; |
| 9305 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9306 | |
| 9307 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9308 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9309 | -------------------------------------------------------------------------*/ |
| 9310 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9311 | ( NULL == pEventData->pCBfnc )) |
| 9312 | { |
| 9313 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9314 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9315 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9316 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9317 | } |
| 9318 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9319 | pwdiAddBASessionParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9320 | (WDI_AddBASessionReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9321 | wdiAddBASessionRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9322 | (WDI_AddBASessionRspCb)pEventData->pCBfnc; |
| 9323 | /*------------------------------------------------------------------------- |
| 9324 | 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] | 9325 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9326 | -------------------------------------------------------------------------*/ |
| 9327 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9328 | |
| 9329 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9330 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9331 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9332 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9333 | pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9334 | &macBSSID)) |
| 9335 | { |
| 9336 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9337 | "This station does not exist in the WDI Station Table %d"); |
| 9338 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9339 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9340 | } |
| 9341 | |
| 9342 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9343 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9344 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9345 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9346 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9347 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9348 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9349 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
| 9350 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9351 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9352 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9353 | } |
| 9354 | |
| 9355 | /*------------------------------------------------------------------------ |
| 9356 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9357 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9358 | ------------------------------------------------------------------------*/ |
| 9359 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9360 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9361 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9362 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9363 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9364 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9365 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9366 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9367 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9368 | } |
| 9369 | |
| 9370 | |
| 9371 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9372 | /*----------------------------------------------------------------------- |
| 9373 | Get message buffer |
| 9374 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9375 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 9376 | WDI_ADD_BA_SESSION_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9377 | sizeof(halAddBASessionReq.addBASessionParams), |
| 9378 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9379 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9380 | (usDataOffset + sizeof(halAddBASessionReq.addBASessionParams) ))) |
| 9381 | { |
| 9382 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9383 | "Unable to get send buffer in Add BA session req %x %x %x", |
| 9384 | pEventData, pwdiAddBASessionParams, wdiAddBASessionRspCb); |
| 9385 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9386 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9387 | } |
| 9388 | |
| 9389 | halAddBASessionReq.addBASessionParams.staIdx = |
| 9390 | pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx; |
| 9391 | wpalMemoryCopy(halAddBASessionReq.addBASessionParams.peerMacAddr, |
| 9392 | pwdiAddBASessionParams->wdiBASessionInfoType.macPeerAddr, |
| 9393 | WDI_MAC_ADDR_LEN); |
| 9394 | halAddBASessionReq.addBASessionParams.baTID = |
| 9395 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaTID; |
| 9396 | halAddBASessionReq.addBASessionParams.baPolicy = |
| 9397 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaPolicy; |
| 9398 | halAddBASessionReq.addBASessionParams.baBufferSize = |
| 9399 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaBufferSize; |
| 9400 | halAddBASessionReq.addBASessionParams.baTimeout = |
| 9401 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaTimeout; |
| 9402 | halAddBASessionReq.addBASessionParams.baSSN = |
| 9403 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaSSN; |
| 9404 | halAddBASessionReq.addBASessionParams.baDirection = |
| 9405 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaDirection; |
| 9406 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9407 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9408 | &halAddBASessionReq.addBASessionParams, |
| 9409 | sizeof(halAddBASessionReq.addBASessionParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9410 | |
| 9411 | pWDICtx->wdiReqStatusCB = pwdiAddBASessionParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9412 | pWDICtx->pReqStatusUserData = pwdiAddBASessionParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9413 | |
| 9414 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9415 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9416 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9417 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9418 | wdiAddBASessionRspCb, pEventData->pUserData, |
| 9419 | WDI_ADD_BA_SESSION_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9420 | }/*WDI_ProcessAddBASessionReq*/ |
| 9421 | |
| 9422 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9423 | @brief Process Del BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9424 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9425 | |
| 9426 | @param pWDICtx: pointer to the WLAN DAL context |
| 9427 | pEventData: pointer to the event information structure |
| 9428 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9429 | @see |
| 9430 | @return Result of the function call |
| 9431 | */ |
| 9432 | WDI_Status |
| 9433 | WDI_ProcessDelBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9434 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9435 | WDI_ControlBlockType* pWDICtx, |
| 9436 | WDI_EventInfoType* pEventData |
| 9437 | ) |
| 9438 | { |
| 9439 | WDI_DelBAReqParamsType* pwdiDelBAParams; |
| 9440 | WDI_DelBARspCb wdiDelBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9441 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9442 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9443 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9444 | wpt_uint16 usDataOffset = 0; |
| 9445 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9446 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9447 | wpt_macAddr macBSSID; |
| 9448 | tDelBAParams halDelBAparam; |
| 9449 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9450 | |
| 9451 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9452 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9453 | -------------------------------------------------------------------------*/ |
| 9454 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9455 | ( NULL == pEventData->pCBfnc )) |
| 9456 | { |
| 9457 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9458 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9459 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9460 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9461 | } |
| 9462 | |
| 9463 | pwdiDelBAParams = (WDI_DelBAReqParamsType*)pEventData->pEventData; |
| 9464 | wdiDelBARspCb = (WDI_DelBARspCb)pEventData->pCBfnc; |
| 9465 | /*------------------------------------------------------------------------- |
| 9466 | 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] | 9467 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9468 | -------------------------------------------------------------------------*/ |
| 9469 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9470 | |
| 9471 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9472 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9473 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9474 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9475 | pwdiDelBAParams->wdiBAInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9476 | &macBSSID)) |
| 9477 | { |
| 9478 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9479 | "This station does not exist in the WDI Station Table %d"); |
| 9480 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9481 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9482 | } |
| 9483 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9484 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9485 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9486 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9487 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9488 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9489 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9490 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9491 | |
| 9492 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9493 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9494 | } |
| 9495 | |
| 9496 | /*------------------------------------------------------------------------ |
| 9497 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9498 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9499 | ------------------------------------------------------------------------*/ |
| 9500 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9501 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9502 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9503 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9504 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9505 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9506 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9507 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9508 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9509 | } |
| 9510 | |
| 9511 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9512 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9513 | sizeof(halDelBAparam), |
| 9514 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9515 | ( usSendSize < (usDataOffset + sizeof(halDelBAparam) ))) |
| 9516 | { |
| 9517 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9518 | "Unable to get send buffer for DEL BA req %x %x %x", |
| 9519 | pEventData, pwdiDelBAParams, wdiDelBARspCb); |
| 9520 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9521 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9522 | } |
| 9523 | |
| 9524 | halDelBAparam.staIdx = pwdiDelBAParams->wdiBAInfo.ucSTAIdx; |
| 9525 | halDelBAparam.baTID = pwdiDelBAParams->wdiBAInfo.ucBaTID; |
| 9526 | halDelBAparam.baDirection = pwdiDelBAParams->wdiBAInfo.ucBaDirection; |
| 9527 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9528 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9529 | &halDelBAparam, |
| 9530 | sizeof(halDelBAparam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9531 | |
| 9532 | pWDICtx->wdiReqStatusCB = pwdiDelBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9533 | pWDICtx->pReqStatusUserData = pwdiDelBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9534 | |
| 9535 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9536 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9537 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9538 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9539 | wdiDelBARspCb, pEventData->pUserData, WDI_DEL_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9540 | }/*WDI_ProcessDelBAReq*/ |
| 9541 | |
| 9542 | #ifdef FEATURE_WLAN_CCX |
| 9543 | |
| 9544 | WDI_Status |
| 9545 | WDI_ProcessTSMStatsReq |
| 9546 | ( |
| 9547 | WDI_ControlBlockType* pWDICtx, |
| 9548 | WDI_EventInfoType* pEventData |
| 9549 | ) |
| 9550 | { |
| 9551 | WDI_TSMStatsReqParamsType* pwdiTSMParams; |
| 9552 | WDI_TsmRspCb wdiTSMRspCb; |
| 9553 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 9554 | WDI_BSSSessionType* pBSSSes = NULL; |
| 9555 | wpt_uint8* pSendBuffer = NULL; |
| 9556 | wpt_uint16 usDataOffset = 0; |
| 9557 | wpt_uint16 usSendSize = 0; |
| 9558 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 9559 | tTsmStatsParams halTsmStatsReqParams = {0}; |
| 9560 | |
| 9561 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9562 | |
| 9563 | /*------------------------------------------------------------------------- |
| 9564 | Sanity check |
| 9565 | -------------------------------------------------------------------------*/ |
| 9566 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9567 | ( NULL == pEventData->pCBfnc )) |
| 9568 | { |
| 9569 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9570 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9571 | WDI_ASSERT(0); |
| 9572 | return WDI_STATUS_E_FAILURE; |
| 9573 | } |
| 9574 | |
| 9575 | pwdiTSMParams = (WDI_TSMStatsReqParamsType*)pEventData->pEventData; |
| 9576 | wdiTSMRspCb = (WDI_TsmRspCb)pEventData->pCBfnc; |
| 9577 | /*------------------------------------------------------------------------- |
| 9578 | Check to see if we are in the middle of an association, if so queue, if |
| 9579 | not it means it is free to process request |
| 9580 | -------------------------------------------------------------------------*/ |
| 9581 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9582 | |
| 9583 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, &pBSSSes); |
| 9584 | if ( NULL == pBSSSes ) |
| 9585 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9586 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9587 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9588 | __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9589 | |
| 9590 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9591 | return WDI_STATUS_E_NOT_ALLOWED; |
| 9592 | } |
| 9593 | |
| 9594 | /*------------------------------------------------------------------------ |
| 9595 | Check if this BSS is being currently processed or queued, |
| 9596 | if queued - queue the new request as well |
| 9597 | ------------------------------------------------------------------------*/ |
| 9598 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9599 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9600 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9601 | "s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9602 | __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9603 | |
| 9604 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
| 9605 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9606 | return wdiStatus; |
| 9607 | } |
| 9608 | |
| 9609 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9610 | /*----------------------------------------------------------------------- |
| 9611 | Get message buffer |
| 9612 | ! TO DO : proper conversion into the HAL Message Request Format |
| 9613 | -----------------------------------------------------------------------*/ |
| 9614 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_TSM_STATS_REQ, |
| 9615 | sizeof(halTsmStatsReqParams), |
| 9616 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9617 | ( usSendSize < (usDataOffset + sizeof(halTsmStatsReqParams) ))) |
| 9618 | { |
| 9619 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9620 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9621 | pEventData, pwdiTSMParams, wdiTSMRspCb); |
| 9622 | WDI_ASSERT(0); |
| 9623 | return WDI_STATUS_E_FAILURE; |
| 9624 | } |
| 9625 | |
| 9626 | halTsmStatsReqParams.tsmTID = pwdiTSMParams->wdiTsmStatsParamsInfo.ucTid; |
| 9627 | wpalMemoryCopy(halTsmStatsReqParams.bssId, |
| 9628 | pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, |
| 9629 | WDI_MAC_ADDR_LEN); |
| 9630 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9631 | &halTsmStatsReqParams, |
| 9632 | sizeof(halTsmStatsReqParams)); |
| 9633 | |
| 9634 | pWDICtx->wdiReqStatusCB = pwdiTSMParams->wdiReqStatusCB; |
| 9635 | pWDICtx->pReqStatusUserData = pwdiTSMParams->pUserData; |
| 9636 | |
| 9637 | /*------------------------------------------------------------------------- |
| 9638 | Send TSM Stats Request to HAL |
| 9639 | -------------------------------------------------------------------------*/ |
| 9640 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9641 | wdiTSMRspCb, pEventData->pUserData, |
| 9642 | WDI_TSM_STATS_RESP); |
| 9643 | }/*WDI_ProcessTSMStatsReq*/ |
| 9644 | |
| 9645 | #endif |
| 9646 | |
| 9647 | |
| 9648 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9649 | @brief Process Flush AC Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9650 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9651 | |
| 9652 | @param pWDICtx: pointer to the WLAN DAL context |
| 9653 | pEventData: pointer to the event information structure |
| 9654 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9655 | @see |
| 9656 | @return Result of the function call |
| 9657 | */ |
| 9658 | WDI_Status |
| 9659 | WDI_ProcessFlushAcReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9660 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9661 | WDI_ControlBlockType* pWDICtx, |
| 9662 | WDI_EventInfoType* pEventData |
| 9663 | ) |
| 9664 | { |
| 9665 | WDI_FlushAcReqParamsType* pwdiFlushAcParams = NULL; |
| 9666 | WDI_FlushAcRspCb wdiFlushAcRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9667 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9668 | wpt_uint16 usDataOffset = 0; |
| 9669 | wpt_uint16 usSendSize = 0; |
| 9670 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9671 | |
| 9672 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9673 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9674 | -------------------------------------------------------------------------*/ |
| 9675 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9676 | ( NULL == pEventData->pCBfnc )) |
| 9677 | { |
| 9678 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9679 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9680 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9681 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9682 | } |
| 9683 | |
| 9684 | pwdiFlushAcParams = (WDI_FlushAcReqParamsType*)pEventData->pEventData; |
| 9685 | wdiFlushAcRspCb = (WDI_FlushAcRspCb)pEventData->pCBfnc; |
| 9686 | /*----------------------------------------------------------------------- |
| 9687 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9688 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9689 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9690 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FLUSH_AC_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9691 | sizeof(pwdiFlushAcParams->wdiFlushAcInfo), |
| 9692 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9693 | ( usSendSize < (usDataOffset + sizeof(pwdiFlushAcParams->wdiFlushAcInfo) ))) |
| 9694 | { |
| 9695 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9696 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9697 | pEventData, pwdiFlushAcParams, wdiFlushAcRspCb); |
| 9698 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9699 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9700 | } |
| 9701 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9702 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9703 | &pwdiFlushAcParams->wdiFlushAcInfo, |
| 9704 | sizeof(pwdiFlushAcParams->wdiFlushAcInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9705 | |
| 9706 | pWDICtx->wdiReqStatusCB = pwdiFlushAcParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9707 | pWDICtx->pReqStatusUserData = pwdiFlushAcParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9708 | |
| 9709 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9710 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9711 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9712 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9713 | wdiFlushAcRspCb, pEventData->pUserData, WDI_FLUSH_AC_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9714 | }/*WDI_ProcessFlushAcReq*/ |
| 9715 | |
| 9716 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9717 | @brief Process BT AMP event Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9718 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9719 | |
| 9720 | @param pWDICtx: pointer to the WLAN DAL context |
| 9721 | pEventData: pointer to the event information structure |
| 9722 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9723 | @see |
| 9724 | @return Result of the function call |
| 9725 | */ |
| 9726 | WDI_Status |
| 9727 | WDI_ProcessBtAmpEventReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9728 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9729 | WDI_ControlBlockType* pWDICtx, |
| 9730 | WDI_EventInfoType* pEventData |
| 9731 | ) |
| 9732 | { |
| 9733 | WDI_BtAmpEventParamsType* pwdiBtAmpEventParams = NULL; |
| 9734 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9735 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9736 | wpt_uint16 usDataOffset = 0; |
| 9737 | wpt_uint16 usSendSize = 0; |
| 9738 | |
| 9739 | tBtAmpEventMsg haltBtAmpEventMsg; |
| 9740 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9741 | |
| 9742 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9743 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9744 | -------------------------------------------------------------------------*/ |
| 9745 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9746 | ( NULL == pEventData->pCBfnc )) |
| 9747 | { |
| 9748 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9749 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9750 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9751 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9752 | } |
| 9753 | |
| 9754 | pwdiBtAmpEventParams = (WDI_BtAmpEventParamsType*)pEventData->pEventData; |
| 9755 | wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pEventData->pCBfnc; |
| 9756 | /*----------------------------------------------------------------------- |
| 9757 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9758 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9759 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9760 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_BTAMP_EVENT_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9761 | sizeof(haltBtAmpEventMsg.btAmpEventParams), |
| 9762 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9763 | ( usSendSize < (usDataOffset + sizeof(haltBtAmpEventMsg.btAmpEventParams) ))) |
| 9764 | { |
| 9765 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9766 | "Unable to get send buffer in BT AMP event req %x %x %x", |
| 9767 | pEventData, pwdiBtAmpEventParams, wdiBtAmpEventRspCb); |
| 9768 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9769 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9770 | } |
| 9771 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9772 | haltBtAmpEventMsg.btAmpEventParams.btAmpEventType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9773 | pwdiBtAmpEventParams->wdiBtAmpEventInfo.ucBtAmpEventType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9774 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9775 | &haltBtAmpEventMsg.btAmpEventParams, |
| 9776 | sizeof(haltBtAmpEventMsg.btAmpEventParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9777 | |
| 9778 | pWDICtx->wdiReqStatusCB = pwdiBtAmpEventParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9779 | pWDICtx->pReqStatusUserData = pwdiBtAmpEventParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9780 | |
| 9781 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9782 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9783 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9784 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9785 | wdiBtAmpEventRspCb, pEventData->pUserData, WDI_BTAMP_EVENT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9786 | }/*WDI_ProcessBtAmpEventReq*/ |
| 9787 | |
| 9788 | /** |
| 9789 | @brief Process Add STA self Request function (called when Main FSM |
| 9790 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9791 | |
| 9792 | @param pWDICtx: pointer to the WLAN DAL context |
| 9793 | pEventData: pointer to the event information structure |
| 9794 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9795 | @see |
| 9796 | @return Result of the function call |
| 9797 | */ |
| 9798 | WDI_Status |
| 9799 | WDI_ProcessAddSTASelfReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9800 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9801 | WDI_ControlBlockType* pWDICtx, |
| 9802 | WDI_EventInfoType* pEventData |
| 9803 | ) |
| 9804 | { |
| 9805 | WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams; |
| 9806 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9807 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9808 | wpt_uint16 usDataOffset = 0; |
| 9809 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9810 | tAddStaSelfParams halAddSTASelfParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9811 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9812 | |
| 9813 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9814 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9815 | -------------------------------------------------------------------------*/ |
| 9816 | if (( NULL == pEventData ) || |
| 9817 | ( NULL == pEventData->pEventData) || |
| 9818 | ( NULL == pEventData->pCBfnc)) |
| 9819 | { |
| 9820 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9821 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9822 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9823 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9824 | } |
| 9825 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9826 | pwdiAddSTASelfReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9827 | (WDI_AddSTASelfReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9828 | wdiAddSTASelfReqRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9829 | (WDI_AddSTASelfParamsRspCb)pEventData->pCBfnc; |
| 9830 | /*----------------------------------------------------------------------- |
| 9831 | Get message buffer |
| 9832 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9833 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 9834 | WDI_ADD_STA_SELF_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9835 | sizeof(tAddStaSelfParams), |
| 9836 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9837 | ( usSendSize < (usDataOffset + sizeof(tAddStaSelfParams) ))) |
| 9838 | { |
| 9839 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9840 | "Unable to get send buffer in ADD STA SELF REQ %x %x %x", |
| 9841 | pEventData, pwdiAddSTASelfReqParams, wdiAddSTASelfReqRspCb); |
| 9842 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9843 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9844 | } |
| 9845 | |
| 9846 | /* Cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9847 | wpalMemoryCopy(&pWDICtx->wdiCacheAddSTASelfReq, pwdiAddSTASelfReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9848 | sizeof(pWDICtx->wdiCacheAddSTASelfReq)); |
| 9849 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9850 | wpalMemoryCopy(halAddSTASelfParams.selfMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9851 | pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.selfMacAddr, 6) ; |
| 9852 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9853 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halAddSTASelfParams, |
| 9854 | sizeof(tAddStaSelfParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9855 | |
| 9856 | pWDICtx->wdiReqStatusCB = pwdiAddSTASelfReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9857 | pWDICtx->pReqStatusUserData = pwdiAddSTASelfReqParams->pUserData; |
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 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9861 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9862 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9863 | wdiAddSTASelfReqRspCb, pEventData->pUserData, |
| 9864 | WDI_ADD_STA_SELF_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9865 | }/*WDI_ProcessAddSTASelfReq*/ |
| 9866 | |
| 9867 | |
| 9868 | |
| 9869 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9870 | @brief Process Del Sta Self Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9871 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9872 | |
| 9873 | @param pWDICtx: pointer to the WLAN DAL context |
| 9874 | pEventData: pointer to the event information structure |
| 9875 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9876 | @see |
| 9877 | @return Result of the function call |
| 9878 | */ |
| 9879 | WDI_Status |
| 9880 | WDI_ProcessDelSTASelfReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9881 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9882 | WDI_ControlBlockType* pWDICtx, |
| 9883 | WDI_EventInfoType* pEventData |
| 9884 | ) |
| 9885 | { |
| 9886 | WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams; |
| 9887 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9888 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9889 | wpt_uint16 usDataOffset = 0; |
| 9890 | wpt_uint16 usSendSize = 0; |
| 9891 | tDelStaSelfParams halSetDelSelfSTAParams; |
| 9892 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9893 | |
| 9894 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9895 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9896 | -------------------------------------------------------------------------*/ |
| 9897 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9898 | ( NULL == pEventData->pCBfnc )) |
| 9899 | { |
| 9900 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9901 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9902 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9903 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9904 | } |
| 9905 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9906 | pwdiDelStaSelfReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9907 | (WDI_DelSTASelfReqParamsType*)pEventData->pEventData; |
| 9908 | wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pEventData->pCBfnc; |
| 9909 | |
| 9910 | /*----------------------------------------------------------------------- |
| 9911 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9912 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9913 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9914 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_SELF_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9915 | sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo), |
| 9916 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9917 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9918 | (usDataOffset + sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo) ))) |
| 9919 | { |
| 9920 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9921 | "Unable to get send buffer in Del Sta Self req %x %x %x", |
| 9922 | pEventData, pwdiDelStaSelfReqParams, wdiDelStaSelfRspCb); |
| 9923 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9924 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9925 | } |
| 9926 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9927 | wpalMemoryCopy(halSetDelSelfSTAParams.selfMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9928 | pwdiDelStaSelfReqParams->wdiDelStaSelfInfo.selfMacAddr, 6) ; |
| 9929 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9930 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halSetDelSelfSTAParams, |
| 9931 | sizeof(tDelStaSelfParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9932 | |
| 9933 | pWDICtx->wdiReqStatusCB = pwdiDelStaSelfReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9934 | pWDICtx->pReqStatusUserData = pwdiDelStaSelfReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9935 | |
| 9936 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9937 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9938 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9939 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9940 | wdiDelStaSelfRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9941 | WDI_DEL_STA_SELF_RESP); |
| 9942 | |
| 9943 | } |
| 9944 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9945 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 9946 | /** |
| 9947 | @brief Process Start Oem Data Request function (called when Main |
| 9948 | FSM allows it) |
| 9949 | |
| 9950 | @param pWDICtx: pointer to the WLAN DAL context |
| 9951 | pEventData: pointer to the event information structure |
| 9952 | |
| 9953 | @see |
| 9954 | @return Result of the function call |
| 9955 | */ |
| 9956 | WDI_Status |
| 9957 | WDI_ProcessStartOemDataReq |
| 9958 | ( |
| 9959 | WDI_ControlBlockType* pWDICtx, |
| 9960 | WDI_EventInfoType* pEventData |
| 9961 | ) |
| 9962 | { |
| 9963 | WDI_oemDataReqParamsType* pwdiOemDataReqParams = NULL; |
| 9964 | WDI_oemDataRspCb wdiOemDataRspCb; |
| 9965 | wpt_uint8* pSendBuffer = NULL; |
| 9966 | wpt_uint16 usDataOffset = 0; |
| 9967 | wpt_uint16 usSendSize = 0; |
| 9968 | wpt_uint16 reqLen; |
| 9969 | tStartOemDataReqParams* halStartOemDataReqParams; |
| 9970 | |
| 9971 | /*------------------------------------------------------------------------- |
| 9972 | Sanity check |
| 9973 | -------------------------------------------------------------------------*/ |
| 9974 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9975 | ( NULL == pEventData->pCBfnc )) |
| 9976 | { |
| 9977 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9978 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9979 | WDI_ASSERT(0); |
| 9980 | return WDI_STATUS_E_FAILURE; |
| 9981 | } |
| 9982 | |
| 9983 | pwdiOemDataReqParams = (WDI_oemDataReqParamsType*)pEventData->pEventData; |
| 9984 | wdiOemDataRspCb = (WDI_oemDataRspCb)pEventData->pCBfnc; |
| 9985 | |
| 9986 | /*----------------------------------------------------------------------- |
| 9987 | Get message buffer |
| 9988 | -----------------------------------------------------------------------*/ |
| 9989 | |
| 9990 | reqLen = sizeof(tStartOemDataReqParams); |
| 9991 | |
| 9992 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 9993 | WDI_START_OEM_DATA_REQ, reqLen, |
| 9994 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9995 | (usSendSize < (usDataOffset + reqLen))) |
| 9996 | { |
| 9997 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9998 | "Unable to get send buffer in Start Oem Data req %x %x %x", |
| 9999 | pEventData, pwdiOemDataReqParams, wdiOemDataRspCb); |
| 10000 | WDI_ASSERT(0); |
| 10001 | return WDI_STATUS_E_FAILURE; |
| 10002 | } |
| 10003 | |
| 10004 | //copying WDI OEM DATA REQ PARAMS to shared memory |
| 10005 | halStartOemDataReqParams = (tStartOemDataReqParams *)(pSendBuffer + usDataOffset ); |
| 10006 | |
| 10007 | wpalMemoryCopy(&halStartOemDataReqParams->selfMacAddr, &pwdiOemDataReqParams->wdiOemDataReqInfo.selfMacAddr, sizeof(wpt_macAddr)); |
| 10008 | wpalMemoryCopy(&halStartOemDataReqParams->oemDataReq, &pwdiOemDataReqParams->wdiOemDataReqInfo.oemDataReq, OEM_DATA_REQ_SIZE); |
| 10009 | |
| 10010 | pWDICtx->wdiReqStatusCB = pwdiOemDataReqParams->wdiReqStatusCB; |
| 10011 | pWDICtx->pReqStatusUserData = pwdiOemDataReqParams->pUserData; |
| 10012 | |
| 10013 | /*------------------------------------------------------------------------- |
| 10014 | Send Start Request to HAL |
| 10015 | -------------------------------------------------------------------------*/ |
| 10016 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10017 | wdiOemDataRspCb, pEventData->pUserData, |
| 10018 | WDI_START_OEM_DATA_RESP); |
| 10019 | }/*WDI_ProcessStartOemDataReq*/ |
| 10020 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10021 | |
| 10022 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10023 | @brief Process Host Resume Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10024 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10025 | |
| 10026 | @param pWDICtx: pointer to the WLAN DAL context |
| 10027 | pEventData: pointer to the event information structure |
| 10028 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10029 | @see |
| 10030 | @return Result of the function call |
| 10031 | */ |
| 10032 | WDI_Status |
| 10033 | WDI_ProcessHostResumeReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10034 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10035 | WDI_ControlBlockType* pWDICtx, |
| 10036 | WDI_EventInfoType* pEventData |
| 10037 | ) |
| 10038 | { |
| 10039 | WDI_ResumeParamsType* pwdiHostResumeParams = NULL; |
| 10040 | WDI_HostResumeEventRspCb wdiHostResumeRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10041 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10042 | wpt_uint16 usDataOffset = 0; |
| 10043 | wpt_uint16 usSendSize = 0; |
| 10044 | tHalWlanHostResumeReqParam halResumeReqParams; |
| 10045 | |
| 10046 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10047 | |
| 10048 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10049 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10050 | -------------------------------------------------------------------------*/ |
| 10051 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10052 | ( NULL == pEventData->pCBfnc )) |
| 10053 | { |
| 10054 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10055 | "%s: Invalid parameters ",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10056 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10057 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10058 | } |
| 10059 | |
| 10060 | pwdiHostResumeParams = (WDI_ResumeParamsType*)pEventData->pEventData; |
| 10061 | wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pEventData->pCBfnc; |
| 10062 | |
| 10063 | /*----------------------------------------------------------------------- |
| 10064 | Get message buffer |
| 10065 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10066 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10067 | WDI_HOST_RESUME_REQ, sizeof(halResumeReqParams), |
| 10068 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10069 | (usSendSize < (usDataOffset + sizeof(halResumeReqParams)))) |
| 10070 | { |
| 10071 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10072 | "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] | 10073 | pEventData, pwdiHostResumeParams, wdiHostResumeRspCb); |
| 10074 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10075 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10076 | } |
| 10077 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10078 | halResumeReqParams.configuredMcstBcstFilterSetting = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10079 | pwdiHostResumeParams->wdiResumeParams.ucConfiguredMcstBcstFilterSetting; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10080 | |
| 10081 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10082 | &halResumeReqParams, |
| 10083 | sizeof(halResumeReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10084 | |
| 10085 | pWDICtx->wdiReqStatusCB = pwdiHostResumeParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10086 | pWDICtx->pReqStatusUserData = pwdiHostResumeParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10087 | |
| 10088 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10089 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10090 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10091 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10092 | wdiHostResumeRspCb, pEventData->pUserData, |
| 10093 | WDI_HOST_RESUME_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10094 | }/*WDI_ProcessHostResumeReq*/ |
| 10095 | |
| 10096 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10097 | @brief Process set Tx Per Tracking Parameters Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10098 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10099 | |
| 10100 | @param pWDICtx: pointer to the WLAN DAL context |
| 10101 | pEventData: pointer to the event information structure |
| 10102 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10103 | @see |
| 10104 | @return Result of the function call |
| 10105 | */ |
| 10106 | WDI_Status |
| 10107 | WDI_ProcessSetTxPerTrackingReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10108 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10109 | WDI_ControlBlockType* pWDICtx, |
| 10110 | WDI_EventInfoType* pEventData |
| 10111 | ) |
| 10112 | { |
| 10113 | WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams = NULL; |
| 10114 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10115 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10116 | wpt_uint16 usDataOffset = 0; |
| 10117 | wpt_uint16 usSendSize = 0; |
| 10118 | tHalTxPerTrackingReqParam halTxPerTrackingReqParam; |
| 10119 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10120 | |
| 10121 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10122 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10123 | -------------------------------------------------------------------------*/ |
| 10124 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10125 | ( NULL == pEventData->pCBfnc )) |
| 10126 | { |
| 10127 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10128 | "%s: Invalid parameters ",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10129 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10130 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10131 | } |
| 10132 | |
| 10133 | pwdiSetTxPerTrackingReqParams = (WDI_SetTxPerTrackingReqParamsType*)pEventData->pEventData; |
| 10134 | pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pEventData->pCBfnc; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10135 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10136 | /*----------------------------------------------------------------------- |
| 10137 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10138 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10139 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10140 | 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] | 10141 | sizeof(halTxPerTrackingReqParam), |
| 10142 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10143 | ( usSendSize < (usDataOffset + sizeof(halTxPerTrackingReqParam) ))) |
| 10144 | { |
| 10145 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10146 | "Unable to get send buffer in set tx per tracking req %x %x %x", |
| 10147 | pEventData, pwdiSetTxPerTrackingReqParams, pwdiSetTxPerTrackingRspCb); |
| 10148 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10149 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10150 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10151 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10152 | halTxPerTrackingReqParam.ucTxPerTrackingEnable = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingEnable; |
| 10153 | halTxPerTrackingReqParam.ucTxPerTrackingPeriod = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingPeriod; |
| 10154 | halTxPerTrackingReqParam.ucTxPerTrackingRatio = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingRatio; |
| 10155 | halTxPerTrackingReqParam.uTxPerTrackingWatermark = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.uTxPerTrackingWatermark; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10156 | |
| 10157 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10158 | &halTxPerTrackingReqParam, |
| 10159 | sizeof(halTxPerTrackingReqParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10160 | |
| 10161 | pWDICtx->wdiReqStatusCB = pwdiSetTxPerTrackingReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10162 | pWDICtx->pReqStatusUserData = pwdiSetTxPerTrackingReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10163 | |
| 10164 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10165 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10166 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10167 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10168 | pwdiSetTxPerTrackingRspCb, pEventData->pUserData, WDI_SET_TX_PER_TRACKING_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10169 | }/*WDI_ProcessSetTxPerTrackingReq*/ |
| 10170 | |
| 10171 | /*========================================================================= |
| 10172 | Indications |
| 10173 | =========================================================================*/ |
| 10174 | |
| 10175 | /** |
| 10176 | @brief Process Suspend Indications function (called when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10177 | |
| 10178 | @param pWDICtx: pointer to the WLAN DAL context |
| 10179 | pEventData: pointer to the event information structure |
| 10180 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10181 | @see |
| 10182 | @return Result of the function call |
| 10183 | */ |
| 10184 | WDI_Status |
| 10185 | WDI_ProcessHostSuspendInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10186 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10187 | WDI_ControlBlockType* pWDICtx, |
| 10188 | WDI_EventInfoType* pEventData |
| 10189 | ) |
| 10190 | { |
| 10191 | WDI_SuspendParamsType *pSuspendIndParams; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10192 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10193 | wpt_uint16 usDataOffset = 0; |
| 10194 | wpt_uint16 usSendSize = 0; |
| 10195 | WDI_Status wdiStatus; |
| 10196 | tHalWlanHostSuspendIndParam halWlanSuspendIndparams; |
| 10197 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10198 | |
| 10199 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10200 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10201 | -------------------------------------------------------------------------*/ |
| 10202 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData )) |
| 10203 | { |
| 10204 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10205 | "%s: Invalid parameters in Suspend ind",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10206 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10207 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10208 | } |
| 10209 | |
| 10210 | pSuspendIndParams = (WDI_SuspendParamsType *)pEventData->pEventData; |
| 10211 | |
| 10212 | /*----------------------------------------------------------------------- |
| 10213 | Get message buffer |
| 10214 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10215 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10216 | WDI_HOST_SUSPEND_IND, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10217 | sizeof(halWlanSuspendIndparams), |
| 10218 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10219 | (usSendSize < (usDataOffset + sizeof(halWlanSuspendIndparams)))) |
| 10220 | { |
| 10221 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10222 | "Unable to get send buffer in Suspend Ind "); |
| 10223 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10224 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10225 | } |
| 10226 | |
| 10227 | halWlanSuspendIndparams.configuredMcstBcstFilterSetting = |
| 10228 | pSuspendIndParams->wdiSuspendParams.ucConfiguredMcstBcstFilterSetting; |
| 10229 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10230 | halWlanSuspendIndparams.activeSessionCount = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10231 | WDI_GetActiveSessionsCount(pWDICtx); |
| 10232 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10233 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halWlanSuspendIndparams, |
| 10234 | sizeof(tHalWlanHostSuspendIndParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10235 | |
| 10236 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10237 | Send Suspend Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10238 | -------------------------------------------------------------------------*/ |
| 10239 | pWDICtx->wdiReqStatusCB = pSuspendIndParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10240 | pWDICtx->pReqStatusUserData = pSuspendIndParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10241 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10242 | wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10243 | return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC; |
| 10244 | }/*WDI_ProcessHostSuspendInd*/ |
| 10245 | |
| 10246 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10247 | MISC CONTROL PROCESSING REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10248 | ==========================================================================*/ |
| 10249 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10250 | @brief Process Channel Switch Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10251 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10252 | |
| 10253 | @param pWDICtx: pointer to the WLAN DAL context |
| 10254 | pEventData: pointer to the event information structure |
| 10255 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10256 | @see |
| 10257 | @return Result of the function call |
| 10258 | */ |
| 10259 | WDI_Status |
| 10260 | WDI_ProcessChannelSwitchReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10261 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10262 | WDI_ControlBlockType* pWDICtx, |
| 10263 | WDI_EventInfoType* pEventData |
| 10264 | ) |
| 10265 | { |
| 10266 | WDI_SwitchChReqParamsType* pwdiSwitchChParams; |
| 10267 | WDI_SwitchChRspCb wdiSwitchChRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10268 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10269 | wpt_uint16 usDataOffset = 0; |
| 10270 | wpt_uint16 usSendSize = 0; |
| 10271 | tSwitchChannelReqMsg halSwitchChannelReq = {{0}}; |
| 10272 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10273 | |
| 10274 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10275 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10276 | -------------------------------------------------------------------------*/ |
| 10277 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10278 | ( NULL == pEventData->pCBfnc )) |
| 10279 | { |
| 10280 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10281 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10282 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10283 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10284 | } |
| 10285 | |
| 10286 | pwdiSwitchChParams = (WDI_SwitchChReqParamsType*)pEventData->pEventData; |
| 10287 | wdiSwitchChRspCb = (WDI_SwitchChRspCb)pEventData->pCBfnc; |
| 10288 | /*----------------------------------------------------------------------- |
| 10289 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10290 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10291 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10292 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CH_SWITCH_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10293 | sizeof(halSwitchChannelReq.switchChannelParams), |
| 10294 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10295 | ( usSendSize < (usDataOffset + sizeof(halSwitchChannelReq.switchChannelParams) ))) |
| 10296 | { |
| 10297 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10298 | "Unable to get send buffer in channel switch req %x %x %x", |
| 10299 | pEventData, pwdiSwitchChParams, wdiSwitchChRspCb); |
| 10300 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10301 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10302 | } |
| 10303 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10304 | halSwitchChannelReq.switchChannelParams.channelNumber = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10305 | pwdiSwitchChParams->wdiChInfo.ucChannel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10306 | #ifndef WLAN_FEATURE_VOWIFI |
| 10307 | halSwitchChannelReq.switchChannelParams.localPowerConstraint = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10308 | pwdiSwitchChParams->wdiChInfo.ucLocalPowerConstraint; |
| 10309 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10310 | halSwitchChannelReq.switchChannelParams.secondaryChannelOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10311 | pwdiSwitchChParams->wdiChInfo.wdiSecondaryChannelOffset; |
| 10312 | |
| 10313 | #ifdef WLAN_FEATURE_VOWIFI |
| 10314 | halSwitchChannelReq.switchChannelParams.maxTxPower |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10315 | = pwdiSwitchChParams->wdiChInfo.cMaxTxPower; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10316 | wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.selfStaMacAddr, |
| 10317 | pwdiSwitchChParams->wdiChInfo.macSelfStaMacAddr, |
| 10318 | WDI_MAC_ADDR_LEN); |
| 10319 | wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.bssId, |
| 10320 | pwdiSwitchChParams->wdiChInfo.macBSSId, |
| 10321 | WDI_MAC_ADDR_LEN); |
| 10322 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10323 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10324 | &halSwitchChannelReq.switchChannelParams, |
| 10325 | sizeof(halSwitchChannelReq.switchChannelParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10326 | |
| 10327 | pWDICtx->wdiReqStatusCB = pwdiSwitchChParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10328 | pWDICtx->pReqStatusUserData = pwdiSwitchChParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10329 | |
| 10330 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10331 | Send Switch Channel Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10332 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10333 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10334 | wdiSwitchChRspCb, pEventData->pUserData, WDI_CH_SWITCH_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10335 | }/*WDI_ProcessChannelSwitchReq*/ |
| 10336 | |
| 10337 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10338 | @brief Process Config STA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10339 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10340 | |
| 10341 | @param pWDICtx: pointer to the WLAN DAL context |
| 10342 | pEventData: pointer to the event information structure |
| 10343 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10344 | @see |
| 10345 | @return Result of the function call |
| 10346 | */ |
| 10347 | WDI_Status |
| 10348 | WDI_ProcessConfigStaReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10349 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10350 | WDI_ControlBlockType* pWDICtx, |
| 10351 | WDI_EventInfoType* pEventData |
| 10352 | ) |
| 10353 | { |
| 10354 | WDI_ConfigSTAReqParamsType* pwdiConfigSTAParams; |
| 10355 | WDI_ConfigSTARspCb wdiConfigSTARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10356 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10357 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10358 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10359 | wpt_uint16 usDataOffset = 0; |
| 10360 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10361 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10362 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10363 | tConfigStaReqMsg halConfigStaReqMsg; |
| 10364 | wpt_uint16 uMsgSize = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10365 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10366 | |
| 10367 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10368 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10369 | -------------------------------------------------------------------------*/ |
| 10370 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10371 | ( NULL == pEventData->pCBfnc )) |
| 10372 | { |
| 10373 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10374 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10375 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10376 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10377 | } |
| 10378 | |
| 10379 | pwdiConfigSTAParams = (WDI_ConfigSTAReqParamsType*)pEventData->pEventData; |
| 10380 | wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pEventData->pCBfnc; |
| 10381 | /*------------------------------------------------------------------------- |
| 10382 | 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] | 10383 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10384 | -------------------------------------------------------------------------*/ |
| 10385 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10386 | |
| 10387 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10388 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10389 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10390 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 10391 | pwdiConfigSTAParams->wdiReqInfo.macBSSID, |
| 10392 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10393 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10394 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10395 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10396 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 10397 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 10398 | __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10399 | |
| 10400 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10401 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10402 | } |
| 10403 | |
| 10404 | /*------------------------------------------------------------------------ |
| 10405 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10406 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10407 | ------------------------------------------------------------------------*/ |
| 10408 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10409 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10410 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10411 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10412 | __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10413 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10414 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10415 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10416 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10417 | } |
| 10418 | |
| 10419 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10420 | |
| 10421 | /* Allocation of StaReqMsg Memory Based on Firmware Capabilities */ |
| 10422 | #ifdef WLAN_FEATURE_11AC |
| 10423 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 10424 | uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams_V1); // Version-1 For 11AC |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10425 | else |
| 10426 | #endif |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 10427 | uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams); // Version-0 Default |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10428 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10429 | /*----------------------------------------------------------------------- |
| 10430 | Get message buffer |
| 10431 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10432 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_STA_REQ, |
| 10433 | uMsgSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10434 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10435 | ( usSendSize < (usDataOffset + uMsgSize ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10436 | { |
| 10437 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10438 | "Unable to get send buffer in config sta req %x %x %x", |
| 10439 | pEventData, pwdiConfigSTAParams, wdiConfigSTARspCb); |
| 10440 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10441 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10442 | } |
| 10443 | |
| 10444 | /*Copy the station context*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10445 | WDI_CopyWDIStaCtxToHALStaCtx( &halConfigStaReqMsg.uStaParams.configStaParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10446 | &pwdiConfigSTAParams->wdiReqInfo); |
| 10447 | |
| 10448 | if(pwdiConfigSTAParams->wdiReqInfo.wdiSTAType == WDI_STA_ENTRY_SELF) |
| 10449 | { |
| 10450 | /* Need to fill in the self STA Index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10451 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10452 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 10453 | pwdiConfigSTAParams->wdiReqInfo.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10454 | (wpt_uint8*)&halConfigStaReqMsg.uStaParams.configStaParams.staIdx )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10455 | { |
| 10456 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10457 | "This station does not exist in the WDI Station Table %d"); |
| 10458 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10459 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10460 | } |
| 10461 | } |
| 10462 | else |
| 10463 | { |
| 10464 | /* Need to fill in the STA Index to invalid, since at this point we have not |
| 10465 | yet received it from HAL */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10466 | halConfigStaReqMsg.uStaParams.configStaParams.staIdx = WDI_STA_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10467 | } |
| 10468 | |
| 10469 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10470 | halConfigStaReqMsg.uStaParams.configStaParams.bssIdx = pBSSSes->ucBSSIdx; |
Madan Mohan Koyyalamudi | 0e4acab | 2012-11-02 12:46:40 -0700 | [diff] [blame] | 10471 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10472 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10473 | &halConfigStaReqMsg.uStaParams, |
Madan Mohan Koyyalamudi | 0e4acab | 2012-11-02 12:46:40 -0700 | [diff] [blame] | 10474 | uMsgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10475 | |
| 10476 | pWDICtx->wdiReqStatusCB = pwdiConfigSTAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10477 | pWDICtx->pReqStatusUserData = pwdiConfigSTAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10478 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10479 | wpalMemoryCopy( &pWDICtx->wdiCachedConfigStaReq, |
| 10480 | pwdiConfigSTAParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10481 | sizeof(pWDICtx->wdiCachedConfigStaReq)); |
| 10482 | |
| 10483 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10484 | Send Config STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10485 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10486 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10487 | wdiConfigSTARspCb, pEventData->pUserData, WDI_CONFIG_STA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10488 | }/*WDI_ProcessConfigStaReq*/ |
| 10489 | |
| 10490 | |
| 10491 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10492 | @brief Process Set Link State Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10493 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10494 | |
| 10495 | @param pWDICtx: pointer to the WLAN DAL context |
| 10496 | pEventData: pointer to the event information structure |
| 10497 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10498 | @see |
| 10499 | @return Result of the function call |
| 10500 | */ |
| 10501 | WDI_Status |
| 10502 | WDI_ProcessSetLinkStateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10503 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10504 | WDI_ControlBlockType* pWDICtx, |
| 10505 | WDI_EventInfoType* pEventData |
| 10506 | ) |
| 10507 | { |
| 10508 | WDI_SetLinkReqParamsType* pwdiSetLinkParams; |
| 10509 | WDI_SetLinkStateRspCb wdiSetLinkRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10510 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10511 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10512 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10513 | wpt_uint16 usDataOffset = 0; |
| 10514 | wpt_uint16 usSendSize = 0; |
| 10515 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10516 | tLinkStateParams halLinkStateReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10517 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10518 | |
| 10519 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10520 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10521 | -------------------------------------------------------------------------*/ |
| 10522 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10523 | ( NULL == pEventData->pCBfnc )) |
| 10524 | { |
| 10525 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10526 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10527 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10528 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10529 | } |
| 10530 | |
| 10531 | pwdiSetLinkParams = (WDI_SetLinkReqParamsType*)pEventData->pEventData; |
| 10532 | wdiSetLinkRspCb = (WDI_SetLinkStateRspCb)pEventData->pCBfnc; |
| 10533 | /*------------------------------------------------------------------------- |
| 10534 | 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] | 10535 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10536 | -------------------------------------------------------------------------*/ |
| 10537 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10538 | |
| 10539 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10540 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10541 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10542 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 10543 | pwdiSetLinkParams->wdiLinkInfo.macBSSID, |
| 10544 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10545 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10546 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10547 | { |
Madan Mohan Koyyalamudi | 891e949 | 2012-10-21 12:19:31 -0700 | [diff] [blame] | 10548 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10549 | "%s: Set link request received outside association session. macBSSID " MAC_ADDRESS_STR, |
| 10550 | __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10551 | } |
| 10552 | else |
| 10553 | { |
| 10554 | /*------------------------------------------------------------------------ |
| 10555 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10556 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10557 | ------------------------------------------------------------------------*/ |
| 10558 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10559 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10560 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10561 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10562 | __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID)); |
| 10563 | |
| 10564 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10565 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10566 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10567 | } |
| 10568 | } |
| 10569 | /* If the link is set to enter IDLE - the Session allocated for this BSS |
| 10570 | will be deleted on the Set Link State response coming from HAL |
| 10571 | - cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10572 | wpalMemoryCopy(&pWDICtx->wdiCacheSetLinkStReq, pwdiSetLinkParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10573 | sizeof(pWDICtx->wdiCacheSetLinkStReq)); |
| 10574 | |
| 10575 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 10576 | /*----------------------------------------------------------------------- |
| 10577 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10578 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10579 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10580 | |
| 10581 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_LINK_ST_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10582 | sizeof(halLinkStateReqMsg), |
| 10583 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10584 | ( usSendSize < (usDataOffset + sizeof(halLinkStateReqMsg) ))) |
| 10585 | { |
| 10586 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10587 | "Unable to get send buffer in set bss key req %x %x %x", |
| 10588 | pEventData, pwdiSetLinkParams, wdiSetLinkRspCb); |
| 10589 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10590 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10591 | } |
| 10592 | |
| 10593 | wpalMemoryCopy(halLinkStateReqMsg.bssid, |
| 10594 | pwdiSetLinkParams->wdiLinkInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 10595 | |
| 10596 | wpalMemoryCopy(halLinkStateReqMsg.selfMacAddr, |
| 10597 | pwdiSetLinkParams->wdiLinkInfo.macSelfStaMacAddr, WDI_MAC_ADDR_LEN); |
| 10598 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10599 | halLinkStateReqMsg.state = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10600 | WDI_2_HAL_LINK_STATE(pwdiSetLinkParams->wdiLinkInfo.wdiLinkState); |
| 10601 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10602 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10603 | &halLinkStateReqMsg, |
| 10604 | sizeof(halLinkStateReqMsg)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10605 | |
| 10606 | pWDICtx->wdiReqStatusCB = pwdiSetLinkParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10607 | pWDICtx->pReqStatusUserData = pwdiSetLinkParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10608 | |
| 10609 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10610 | Send Set Link State Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10611 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10612 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10613 | wdiSetLinkRspCb, pEventData->pUserData, WDI_SET_LINK_ST_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10614 | }/*WDI_ProcessSetLinkStateReq*/ |
| 10615 | |
| 10616 | |
| 10617 | /** |
| 10618 | @brief Process Get Stats Request function (called when Main FSM |
| 10619 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10620 | |
| 10621 | @param pWDICtx: pointer to the WLAN DAL context |
| 10622 | pEventData: pointer to the event information structure |
| 10623 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10624 | @see |
| 10625 | @return Result of the function call |
| 10626 | */ |
| 10627 | WDI_Status |
| 10628 | WDI_ProcessGetStatsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10629 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10630 | WDI_ControlBlockType* pWDICtx, |
| 10631 | WDI_EventInfoType* pEventData |
| 10632 | ) |
| 10633 | { |
| 10634 | WDI_GetStatsReqParamsType* pwdiGetStatsParams; |
| 10635 | WDI_GetStatsRspCb wdiGetStatsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10636 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10637 | wpt_uint16 usDataOffset = 0; |
| 10638 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10639 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10640 | WDI_BSSSessionType* pBSSSes = NULL; |
| 10641 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10642 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10643 | tHalStatsReqMsg halStatsReqMsg; |
| 10644 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10645 | |
| 10646 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10647 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10648 | -------------------------------------------------------------------------*/ |
| 10649 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) || |
| 10650 | ( NULL == pEventData->pCBfnc ) ) |
| 10651 | { |
| 10652 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10653 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10654 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10655 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10656 | } |
| 10657 | |
| 10658 | pwdiGetStatsParams = (WDI_GetStatsReqParamsType*)pEventData->pEventData; |
| 10659 | wdiGetStatsRspCb = (WDI_GetStatsRspCb)pEventData->pCBfnc; |
| 10660 | |
| 10661 | /*------------------------------------------------------------------------- |
| 10662 | 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] | 10663 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10664 | -------------------------------------------------------------------------*/ |
| 10665 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10666 | |
| 10667 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10668 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10669 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10670 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 10671 | pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10672 | &macBSSID)) |
| 10673 | { |
| 10674 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10675 | "This station does not exist in the WDI Station Table %d"); |
| 10676 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10677 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10678 | } |
| 10679 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10680 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 10681 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10682 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10683 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 10684 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 10685 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10686 | |
| 10687 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10688 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10689 | } |
| 10690 | |
| 10691 | /*------------------------------------------------------------------------ |
| 10692 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10693 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10694 | ------------------------------------------------------------------------*/ |
| 10695 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10696 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10697 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10698 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10699 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10700 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10701 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10702 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10703 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10704 | } |
| 10705 | |
| 10706 | |
| 10707 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 10708 | |
| 10709 | /*----------------------------------------------------------------------- |
| 10710 | Get message buffer |
| 10711 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10712 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GET_STATS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10713 | sizeof(halStatsReqMsg.statsReqParams), |
| 10714 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10715 | ( usSendSize < (usDataOffset + sizeof(halStatsReqMsg.statsReqParams) ))) |
| 10716 | { |
| 10717 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10718 | "Unable to get send buffer in set bss key req %x %x %x", |
| 10719 | pEventData, pwdiGetStatsParams, wdiGetStatsRspCb); |
| 10720 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10721 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10722 | } |
| 10723 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10724 | halStatsReqMsg.statsReqParams.staId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10725 | pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10726 | halStatsReqMsg.statsReqParams.statsMask = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10727 | pwdiGetStatsParams->wdiGetStatsParamsInfo.uStatsMask; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10728 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10729 | &halStatsReqMsg.statsReqParams, |
| 10730 | sizeof(halStatsReqMsg.statsReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10731 | |
| 10732 | pWDICtx->wdiReqStatusCB = pwdiGetStatsParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10733 | pWDICtx->pReqStatusUserData = pwdiGetStatsParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10734 | |
| 10735 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10736 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10737 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10738 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10739 | wdiGetStatsRspCb, pEventData->pUserData, WDI_GET_STATS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10740 | }/*WDI_ProcessGetStatsReq*/ |
| 10741 | |
| 10742 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10743 | @brief Process Update Cfg Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10744 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10745 | |
| 10746 | @param pWDICtx: pointer to the WLAN DAL context |
| 10747 | pEventData: pointer to the event information structure |
| 10748 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10749 | @see |
| 10750 | @return Result of the function call |
| 10751 | */ |
| 10752 | WDI_Status |
| 10753 | WDI_ProcessUpdateCfgReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10754 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10755 | WDI_ControlBlockType* pWDICtx, |
| 10756 | WDI_EventInfoType* pEventData |
| 10757 | ) |
| 10758 | { |
| 10759 | WDI_UpdateCfgReqParamsType* pwdiUpdateCfgParams = NULL; |
| 10760 | WDI_UpdateCfgRspCb wdiUpdateCfgRspCb = NULL; |
| 10761 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10762 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10763 | wpt_uint16 usDataOffset = 0; |
| 10764 | wpt_uint16 usSendSize = 0; |
| 10765 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10766 | |
| 10767 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10768 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10769 | -------------------------------------------------------------------------*/ |
| 10770 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10771 | ( NULL == pEventData->pCBfnc)) |
| 10772 | { |
| 10773 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10774 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10775 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10776 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10777 | } |
| 10778 | |
| 10779 | pwdiUpdateCfgParams = (WDI_UpdateCfgReqParamsType*)pEventData->pEventData; |
| 10780 | wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pEventData->pCBfnc; |
| 10781 | |
| 10782 | /*----------------------------------------------------------------------- |
| 10783 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10784 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10785 | -----------------------------------------------------------------------*/ |
| 10786 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10787 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_CFG_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10788 | pwdiUpdateCfgParams->uConfigBufferLen + sizeof(wpt_uint32), |
| 10789 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10790 | ( usSendSize < (usDataOffset + pwdiUpdateCfgParams->uConfigBufferLen))) |
| 10791 | { |
| 10792 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10793 | "Unable to get send buffer in set bss key req %x %x %x", |
| 10794 | pEventData, pwdiUpdateCfgParams, wdiUpdateCfgRspCb); |
| 10795 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10796 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10797 | } |
| 10798 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10799 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10800 | &pwdiUpdateCfgParams->uConfigBufferLen, |
| 10801 | sizeof(wpt_uint32)); |
| 10802 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(wpt_uint32), |
| 10803 | pwdiUpdateCfgParams->pConfigBuffer, |
| 10804 | pwdiUpdateCfgParams->uConfigBufferLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10805 | |
| 10806 | pWDICtx->wdiReqStatusCB = pwdiUpdateCfgParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10807 | pWDICtx->pReqStatusUserData = pwdiUpdateCfgParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10808 | |
| 10809 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10810 | Send Update Cfg Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10811 | -------------------------------------------------------------------------*/ |
| 10812 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10813 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10814 | wdiUpdateCfgRspCb, pEventData->pUserData, WDI_UPDATE_CFG_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10815 | |
| 10816 | }/*WDI_ProcessUpdateCfgReq*/ |
| 10817 | |
| 10818 | |
| 10819 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10820 | @brief Process Add BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10821 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10822 | |
| 10823 | @param pWDICtx: pointer to the WLAN DAL context |
| 10824 | pEventData: pointer to the event information structure |
| 10825 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10826 | @see |
| 10827 | @return Result of the function call |
| 10828 | */ |
| 10829 | WDI_Status |
| 10830 | WDI_ProcessAddBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10831 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10832 | WDI_ControlBlockType* pWDICtx, |
| 10833 | WDI_EventInfoType* pEventData |
| 10834 | ) |
| 10835 | { |
| 10836 | WDI_AddBAReqParamsType* pwdiAddBAParams; |
| 10837 | WDI_AddBARspCb wdiAddBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10838 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10839 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10840 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10841 | wpt_uint16 usDataOffset = 0; |
| 10842 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10843 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10844 | wpt_macAddr macBSSID; |
| 10845 | |
| 10846 | tAddBAReqMsg halAddBAReq; |
| 10847 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10848 | |
| 10849 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10850 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10851 | -------------------------------------------------------------------------*/ |
| 10852 | if (( NULL == pEventData ) || |
| 10853 | ( NULL == pEventData->pEventData) || |
| 10854 | ( NULL == pEventData->pCBfnc )) |
| 10855 | { |
| 10856 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10857 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10858 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10859 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10860 | } |
| 10861 | |
| 10862 | pwdiAddBAParams = (WDI_AddBAReqParamsType*)pEventData->pEventData; |
| 10863 | wdiAddBARspCb = (WDI_AddBARspCb)pEventData->pCBfnc; |
| 10864 | |
| 10865 | /*------------------------------------------------------------------------- |
| 10866 | 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] | 10867 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10868 | -------------------------------------------------------------------------*/ |
| 10869 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10870 | |
| 10871 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10872 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10873 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10874 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 10875 | pwdiAddBAParams->wdiBAInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10876 | &macBSSID)) |
| 10877 | { |
| 10878 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10879 | "This station does not exist in the WDI Station Table %d"); |
| 10880 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10881 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10882 | } |
| 10883 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10884 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 10885 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10886 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10887 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 10888 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 10889 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10890 | |
| 10891 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10892 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10893 | } |
| 10894 | |
| 10895 | /*------------------------------------------------------------------------ |
| 10896 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10897 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10898 | ------------------------------------------------------------------------*/ |
| 10899 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10900 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10901 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10902 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10903 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10904 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10905 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10906 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10907 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10908 | } |
| 10909 | |
| 10910 | |
| 10911 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 10912 | /*----------------------------------------------------------------------- |
| 10913 | Get message buffer |
| 10914 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10915 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10916 | sizeof(halAddBAReq.addBAParams), |
| 10917 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10918 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10919 | (usDataOffset + sizeof(halAddBAReq.addBAParams) ))) |
| 10920 | { |
| 10921 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10922 | "Unable to get send buffer in Add BA req %x %x %x", |
| 10923 | pEventData, pwdiAddBAParams, wdiAddBARspCb); |
| 10924 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10925 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10926 | } |
| 10927 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10928 | halAddBAReq.addBAParams.baSessionID = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10929 | pwdiAddBAParams->wdiBAInfoType.ucBaSessionID; |
| 10930 | halAddBAReq.addBAParams.winSize = pwdiAddBAParams->wdiBAInfoType.ucWinSize; |
| 10931 | #ifdef FEATURE_ON_CHIP_REORDERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10932 | halAddBAReq.addBAParams.isReorderingDoneOnChip = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10933 | pwdiAddBAParams->wdiBAInfoType.bIsReorderingDoneOnChip; |
| 10934 | #endif |
| 10935 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10936 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10937 | &halAddBAReq.addBAParams, |
| 10938 | sizeof(halAddBAReq.addBAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10939 | |
| 10940 | pWDICtx->wdiReqStatusCB = pwdiAddBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10941 | pWDICtx->pReqStatusUserData = pwdiAddBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10942 | |
| 10943 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10944 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10945 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10946 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10947 | wdiAddBARspCb, pEventData->pUserData, |
| 10948 | WDI_ADD_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10949 | }/*WDI_ProcessAddBAReq*/ |
| 10950 | |
| 10951 | |
| 10952 | |
| 10953 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10954 | @brief Process Trigger BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10955 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10956 | |
| 10957 | @param pWDICtx: pointer to the WLAN DAL context |
| 10958 | pEventData: pointer to the event information structure |
| 10959 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10960 | @see |
| 10961 | @return Result of the function call |
| 10962 | */ |
| 10963 | WDI_Status |
| 10964 | WDI_ProcessTriggerBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10965 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10966 | WDI_ControlBlockType* pWDICtx, |
| 10967 | WDI_EventInfoType* pEventData |
| 10968 | ) |
| 10969 | { |
| 10970 | WDI_TriggerBAReqParamsType* pwdiTriggerBAParams; |
| 10971 | WDI_TriggerBARspCb wdiTriggerBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10972 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10973 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10974 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10975 | wpt_uint16 usDataOffset = 0; |
| 10976 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10977 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10978 | wpt_uint16 index; |
| 10979 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10980 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10981 | tTriggerBAReqMsg halTriggerBAReq; |
| 10982 | tTriggerBaReqCandidate* halTriggerBACandidate; |
| 10983 | WDI_TriggerBAReqCandidateType* wdiTriggerBACandidate; |
| 10984 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10985 | |
| 10986 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10987 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10988 | -------------------------------------------------------------------------*/ |
| 10989 | if (( NULL == pEventData ) || |
| 10990 | ( NULL == pEventData->pEventData ) || |
| 10991 | ( NULL == pEventData->pCBfnc )) |
| 10992 | { |
| 10993 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10994 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10995 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10996 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10997 | } |
| 10998 | |
| 10999 | pwdiTriggerBAParams = (WDI_TriggerBAReqParamsType*)pEventData->pEventData; |
| 11000 | wdiTriggerBARspCb = (WDI_TriggerBARspCb)pEventData->pCBfnc; |
| 11001 | /*------------------------------------------------------------------------- |
| 11002 | 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] | 11003 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11004 | -------------------------------------------------------------------------*/ |
| 11005 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 11006 | |
| 11007 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11008 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11009 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11010 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 11011 | pwdiTriggerBAParams->wdiTriggerBAInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11012 | &macBSSID)) |
| 11013 | { |
| 11014 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11015 | "This station does not exist in the WDI Station Table %d"); |
| 11016 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11017 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11018 | } |
| 11019 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11020 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 11021 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11022 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11023 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11024 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 11025 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11026 | |
| 11027 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11028 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11029 | } |
| 11030 | |
| 11031 | /*------------------------------------------------------------------------ |
| 11032 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11033 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11034 | ------------------------------------------------------------------------*/ |
| 11035 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 11036 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11037 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11038 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 11039 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11040 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11041 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11042 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11043 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11044 | } |
| 11045 | |
| 11046 | |
| 11047 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11048 | /*----------------------------------------------------------------------- |
| 11049 | Get message buffer |
| 11050 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11051 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 11052 | WDI_TRIGGER_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11053 | sizeof(halTriggerBAReq.triggerBAParams) + |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11054 | (sizeof(tTriggerBaReqCandidate) * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11055 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt), |
| 11056 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11057 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11058 | (usDataOffset + sizeof(halTriggerBAReq.triggerBAParams)+ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11059 | (sizeof(tTriggerBaReqCandidate) * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11060 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt) ))) |
| 11061 | { |
| 11062 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11063 | "Unable to get send buffer in Trigger BA req %x %x %x", |
| 11064 | pEventData, pwdiTriggerBAParams, wdiTriggerBARspCb); |
| 11065 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11066 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11067 | } |
| 11068 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11069 | halTriggerBAReq.triggerBAParams.baSessionID = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11070 | pwdiTriggerBAParams->wdiTriggerBAInfoType.ucBASessionID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11071 | halTriggerBAReq.triggerBAParams.baCandidateCnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11072 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt; |
| 11073 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11074 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11075 | &halTriggerBAReq.triggerBAParams, |
| 11076 | sizeof(halTriggerBAReq.triggerBAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11077 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11078 | wdiTriggerBACandidate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11079 | (WDI_TriggerBAReqCandidateType*)(pwdiTriggerBAParams + 1); |
| 11080 | halTriggerBACandidate = (tTriggerBaReqCandidate*)(pSendBuffer+usDataOffset+ |
| 11081 | sizeof(halTriggerBAReq.triggerBAParams)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11082 | |
| 11083 | for(index = 0 ; index < halTriggerBAReq.triggerBAParams.baCandidateCnt ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11084 | index++) |
| 11085 | { |
| 11086 | halTriggerBACandidate->staIdx = wdiTriggerBACandidate->ucSTAIdx; |
| 11087 | halTriggerBACandidate->tidBitmap = wdiTriggerBACandidate->ucTidBitmap; |
| 11088 | halTriggerBACandidate++; |
| 11089 | wdiTriggerBACandidate++; |
| 11090 | } |
| 11091 | |
| 11092 | pWDICtx->wdiReqStatusCB = pwdiTriggerBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11093 | pWDICtx->pReqStatusUserData = pwdiTriggerBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11094 | |
| 11095 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11096 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11097 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11098 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11099 | wdiTriggerBARspCb, pEventData->pUserData, |
| 11100 | WDI_TRIGGER_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11101 | }/*WDI_ProcessTriggerBAReq*/ |
| 11102 | |
| 11103 | |
| 11104 | |
| 11105 | /** |
| 11106 | @brief Process Update Beacon Params Request function (called when Main FSM |
| 11107 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11108 | |
| 11109 | @param pWDICtx: pointer to the WLAN DAL context |
| 11110 | pEventData: pointer to the event information structure |
| 11111 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11112 | @see |
| 11113 | @return Result of the function call |
| 11114 | */ |
| 11115 | WDI_Status |
| 11116 | WDI_ProcessUpdateBeaconParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11117 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11118 | WDI_ControlBlockType* pWDICtx, |
| 11119 | WDI_EventInfoType* pEventData |
| 11120 | ) |
| 11121 | { |
| 11122 | WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams; |
| 11123 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11124 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11125 | wpt_uint16 usDataOffset = 0; |
| 11126 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11127 | tUpdateBeaconParams halUpdateBeaconParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11128 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11129 | |
| 11130 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11131 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11132 | -------------------------------------------------------------------------*/ |
| 11133 | if (( NULL == pEventData ) || |
| 11134 | ( NULL == pEventData->pEventData) || |
| 11135 | ( NULL == pEventData->pCBfnc)) |
| 11136 | { |
| 11137 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11138 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11139 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11140 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11141 | } |
| 11142 | |
| 11143 | pwdiUpdateBeaconParams = (WDI_UpdateBeaconParamsType*)pEventData->pEventData; |
| 11144 | wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pEventData->pCBfnc; |
| 11145 | /*----------------------------------------------------------------------- |
| 11146 | Get message buffer |
| 11147 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11148 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_BCON_PRMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11149 | sizeof(halUpdateBeaconParams), |
| 11150 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11151 | ( usSendSize < (usDataOffset + sizeof(halUpdateBeaconParams) ))) |
| 11152 | { |
| 11153 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11154 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11155 | pEventData, pwdiUpdateBeaconParams, wdiUpdateBeaconParamsRspCb); |
| 11156 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11157 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11158 | } |
| 11159 | |
| 11160 | /*BSS Index of the BSS*/ |
| 11161 | halUpdateBeaconParams.bssIdx = |
| 11162 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucBssIdx; |
| 11163 | /*shortPreamble mode. HAL should update all the STA rates when it |
| 11164 | receives this message*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11165 | halUpdateBeaconParams.fShortPreamble = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11166 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortPreamble; |
| 11167 | /* short Slot time.*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11168 | halUpdateBeaconParams.fShortSlotTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11169 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortSlotTime; |
| 11170 | /* Beacon Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11171 | halUpdateBeaconParams.beaconInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11172 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usBeaconInterval; |
| 11173 | |
| 11174 | /*Protection related */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11175 | halUpdateBeaconParams.llaCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11176 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllaCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11177 | halUpdateBeaconParams.llbCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11178 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllbCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11179 | halUpdateBeaconParams.llgCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11180 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllgCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11181 | halUpdateBeaconParams.ht20MhzCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11182 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucHt20MhzCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11183 | halUpdateBeaconParams.llnNonGFCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11184 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllnNonGFCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11185 | halUpdateBeaconParams.fLsigTXOPProtectionFullSupport = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11186 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfLsigTXOPProtectionFullSupport; |
| 11187 | halUpdateBeaconParams.fRIFSMode = |
| 11188 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfRIFSMode; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11189 | halUpdateBeaconParams.paramChangeBitmap = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11190 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usChangeBitmap; |
| 11191 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11192 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halUpdateBeaconParams, |
| 11193 | sizeof(halUpdateBeaconParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11194 | |
| 11195 | pWDICtx->wdiReqStatusCB = pwdiUpdateBeaconParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11196 | pWDICtx->pReqStatusUserData = pwdiUpdateBeaconParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11197 | |
| 11198 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11199 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11200 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11201 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11202 | wdiUpdateBeaconParamsRspCb, pEventData->pUserData, WDI_UPD_BCON_PRMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11203 | }/*WDI_ProcessUpdateBeaconParamsReq*/ |
| 11204 | |
| 11205 | |
| 11206 | |
| 11207 | /** |
| 11208 | @brief Process Send Beacon template Request function (called when Main FSM |
| 11209 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11210 | |
| 11211 | @param pWDICtx: pointer to the WLAN DAL context |
| 11212 | pEventData: pointer to the event information structure |
| 11213 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11214 | @see |
| 11215 | @return Result of the function call |
| 11216 | */ |
| 11217 | WDI_Status |
| 11218 | WDI_ProcessSendBeaconParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11219 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11220 | WDI_ControlBlockType* pWDICtx, |
| 11221 | WDI_EventInfoType* pEventData |
| 11222 | ) |
| 11223 | { |
| 11224 | WDI_SendBeaconParamsType* pwdiSendBeaconParams; |
| 11225 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11226 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11227 | wpt_uint16 usDataOffset = 0; |
| 11228 | wpt_uint16 usSendSize = 0; |
| 11229 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11230 | |
| 11231 | tSendBeaconReqMsg halSendBeaconReq; |
| 11232 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11233 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11234 | -------------------------------------------------------------------------*/ |
| 11235 | if (( NULL == pEventData ) || |
| 11236 | ( NULL == pEventData->pEventData ) || |
| 11237 | ( NULL == pEventData->pCBfnc )) |
| 11238 | { |
| 11239 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11240 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11241 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11242 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11243 | } |
| 11244 | |
| 11245 | pwdiSendBeaconParams = (WDI_SendBeaconParamsType*)pEventData->pEventData; |
| 11246 | wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pEventData->pCBfnc; |
| 11247 | /*----------------------------------------------------------------------- |
| 11248 | Get message buffer |
| 11249 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11250 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SND_BCON_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11251 | sizeof(halSendBeaconReq.sendBeaconParam), |
| 11252 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11253 | ( usSendSize < (usDataOffset + sizeof(halSendBeaconReq.sendBeaconParam) ))) |
| 11254 | { |
| 11255 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11256 | "Unable to get send buffer in send beacon req %x %x %x", |
| 11257 | pEventData, pwdiSendBeaconParams, wdiSendBeaconParamsRspCb); |
| 11258 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11259 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11260 | } |
| 11261 | |
| 11262 | wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.bssId, |
| 11263 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.macBSSID, |
| 11264 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11265 | halSendBeaconReq.sendBeaconParam.beaconLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11266 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength; |
| 11267 | wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.beacon, |
| 11268 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beacon, |
| 11269 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength); |
| 11270 | #ifdef WLAN_SOFTAP_FEATURE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11271 | halSendBeaconReq.sendBeaconParam.timIeOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11272 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.timIeOffset; |
| 11273 | #endif |
| 11274 | #ifdef WLAN_FEATURE_P2P |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11275 | halSendBeaconReq.sendBeaconParam.p2pIeOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11276 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset; |
| 11277 | #endif |
| 11278 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11279 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11280 | &halSendBeaconReq.sendBeaconParam, |
| 11281 | sizeof(halSendBeaconReq.sendBeaconParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11282 | |
| 11283 | pWDICtx->wdiReqStatusCB = pwdiSendBeaconParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11284 | pWDICtx->pReqStatusUserData = pwdiSendBeaconParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11285 | |
| 11286 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11287 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11288 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11289 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11290 | wdiSendBeaconParamsRspCb, pEventData->pUserData, WDI_SND_BCON_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11291 | }/*WDI_ProcessSendBeaconParamsReq*/ |
| 11292 | |
| 11293 | /** |
| 11294 | @brief Process Update Beacon Params Request function (called when Main FSM |
| 11295 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11296 | |
| 11297 | @param pWDICtx: pointer to the WLAN DAL context |
| 11298 | pEventData: pointer to the event information structure |
| 11299 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11300 | @see |
| 11301 | @return Result of the function call |
| 11302 | */ |
| 11303 | WDI_Status |
| 11304 | WDI_ProcessUpdateProbeRspTemplateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11305 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11306 | WDI_ControlBlockType* pWDICtx, |
| 11307 | WDI_EventInfoType* pEventData |
| 11308 | ) |
| 11309 | { |
| 11310 | WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRespTmplParams; |
| 11311 | WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRespTmplRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11312 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11313 | wpt_uint16 usDataOffset = 0; |
| 11314 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11315 | tSendProbeRespReqParams halUpdateProbeRspTmplParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11316 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11317 | |
| 11318 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11319 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11320 | -------------------------------------------------------------------------*/ |
| 11321 | if (( NULL == pEventData ) || |
| 11322 | ( NULL == pEventData->pEventData) || |
| 11323 | ( NULL == pEventData->pCBfnc)) |
| 11324 | { |
| 11325 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11326 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11327 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11328 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11329 | } |
| 11330 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11331 | pwdiUpdateProbeRespTmplParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11332 | (WDI_UpdateProbeRspTemplateParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11333 | wdiUpdateProbeRespTmplRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11334 | (WDI_UpdateProbeRspTemplateRspCb)pEventData->pCBfnc; |
| 11335 | /*----------------------------------------------------------------------- |
| 11336 | Get message buffer |
| 11337 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11338 | 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] | 11339 | sizeof(halUpdateProbeRspTmplParams), |
| 11340 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11341 | ( usSendSize < (usDataOffset + sizeof(halUpdateProbeRspTmplParams) ))) |
| 11342 | { |
| 11343 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11344 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11345 | pEventData, pwdiUpdateProbeRespTmplParams, wdiUpdateProbeRespTmplRspCb); |
| 11346 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11347 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11348 | } |
| 11349 | |
| 11350 | wpalMemoryCopy(halUpdateProbeRspTmplParams.bssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11351 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11352 | WDI_MAC_ADDR_LEN); |
| 11353 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11354 | halUpdateProbeRspTmplParams.probeRespTemplateLen = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11355 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uProbeRespTemplateLen; |
| 11356 | |
| 11357 | wpalMemoryCopy(halUpdateProbeRspTmplParams.pProbeRespTemplate, |
| 11358 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.pProbeRespTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11359 | BEACON_TEMPLATE_SIZE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11360 | |
| 11361 | |
| 11362 | wpalMemoryCopy(halUpdateProbeRspTmplParams.ucProxyProbeReqValidIEBmap, |
| 11363 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uaProxyProbeReqValidIEBmap, |
| 11364 | WDI_PROBE_REQ_BITMAP_IE_LEN); |
| 11365 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11366 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11367 | &halUpdateProbeRspTmplParams, |
| 11368 | sizeof(halUpdateProbeRspTmplParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11369 | |
| 11370 | pWDICtx->wdiReqStatusCB = pwdiUpdateProbeRespTmplParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11371 | pWDICtx->pReqStatusUserData = pwdiUpdateProbeRespTmplParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11372 | |
| 11373 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11374 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11375 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11376 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11377 | wdiUpdateProbeRespTmplRspCb, pEventData->pUserData, |
| 11378 | WDI_UPD_PROBE_RSP_TEMPLATE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11379 | }/*WDI_ProcessUpdateProbeRspTemplateReq*/ |
| 11380 | |
| 11381 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11382 | @brief Process NV blob download function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11383 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11384 | |
| 11385 | @param pWDICtx: pointer to the WLAN DAL context |
| 11386 | pEventData: pointer to the event information structure |
| 11387 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11388 | @see |
| 11389 | @return Result of the function call |
| 11390 | */ |
| 11391 | WDI_Status |
| 11392 | WDI_ProcessNvDownloadReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11393 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11394 | WDI_ControlBlockType* pWDICtx, |
| 11395 | WDI_EventInfoType* pEventData |
| 11396 | ) |
| 11397 | { |
| 11398 | |
| 11399 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams = NULL; |
| 11400 | WDI_NvDownloadRspCb wdiNvDownloadRspCb = NULL; |
| 11401 | |
| 11402 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11403 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11404 | -------------------------------------------------------------------------*/ |
| 11405 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11406 | ( NULL == (pwdiNvDownloadReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11407 | (WDI_NvDownloadReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11408 | ( NULL == (wdiNvDownloadRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11409 | (WDI_NvDownloadRspCb)pEventData->pCBfnc))) |
| 11410 | { |
| 11411 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11412 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11413 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11414 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11415 | } |
| 11416 | |
| 11417 | /*Intialize the Nv Blob Info */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11418 | pWDICtx->wdiNvBlobInfo.usTotalFragment = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11419 | TOTALFRAGMENTS(pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize); |
| 11420 | |
| 11421 | /*cache the wdi nv request message here if the the first fragment |
| 11422 | * To issue the request to HAL for the next fragment */ |
| 11423 | if( 0 == pWDICtx->wdiNvBlobInfo.usCurrentFragment) |
| 11424 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11425 | wpalMemoryCopy(&pWDICtx->wdiCachedNvDownloadReq, |
| 11426 | pwdiNvDownloadReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11427 | sizeof(pWDICtx->wdiCachedNvDownloadReq)); |
| 11428 | |
| 11429 | pWDICtx->pfncRspCB = pEventData->pCBfnc; |
| 11430 | pWDICtx->pRspCBUserData = pEventData->pUserData; |
| 11431 | } |
| 11432 | |
| 11433 | return WDI_SendNvBlobReq(pWDICtx,pEventData); |
| 11434 | } |
| 11435 | |
| 11436 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11437 | @brief Process Set Max Tx Power Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11438 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11439 | |
| 11440 | @param pWDICtx: pointer to the WLAN DAL context |
| 11441 | pEventData: pointer to the event information structure |
| 11442 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11443 | @see |
| 11444 | @return Result of the function call |
| 11445 | */ |
| 11446 | WDI_Status WDI_ProcessSetMaxTxPowerReq |
| 11447 | ( |
| 11448 | WDI_ControlBlockType* pWDICtx, |
| 11449 | WDI_EventInfoType* pEventData |
| 11450 | ) |
| 11451 | { |
| 11452 | WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams = NULL; |
| 11453 | WDA_SetMaxTxPowerRspCb wdiSetMaxTxPowerRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11454 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11455 | wpt_uint16 usDataOffset = 0; |
| 11456 | wpt_uint16 usSendSize = 0; |
| 11457 | tSetMaxTxPwrReq halSetMaxTxPower; |
| 11458 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11459 | |
| 11460 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11461 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11462 | -------------------------------------------------------------------------*/ |
| 11463 | if (( NULL == pEventData ) || |
| 11464 | ( NULL == pEventData->pEventData ) || |
| 11465 | ( NULL == pEventData->pCBfnc )) |
| 11466 | { |
| 11467 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11468 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11469 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11470 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11471 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11472 | pwdiSetMaxTxPowerParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11473 | (WDI_SetMaxTxPowerParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11474 | wdiSetMaxTxPowerRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11475 | (WDA_SetMaxTxPowerRspCb)pEventData->pCBfnc; |
| 11476 | |
| 11477 | /*----------------------------------------------------------------------- |
| 11478 | Get message buffer |
| 11479 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11480 | 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] | 11481 | sizeof(halSetMaxTxPower.setMaxTxPwrParams), |
| 11482 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11483 | ( usSendSize < (usDataOffset + sizeof(halSetMaxTxPower.setMaxTxPwrParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11484 | ))) |
| 11485 | { |
| 11486 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11487 | "Unable to get Set Max Tx Power req %x %x %x", |
| 11488 | pEventData, pwdiSetMaxTxPowerParams, wdiSetMaxTxPowerRspCb); |
| 11489 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11490 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11491 | } |
| 11492 | |
| 11493 | wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.bssId, |
| 11494 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macBSSId, |
| 11495 | WDI_MAC_ADDR_LEN); |
| 11496 | |
| 11497 | wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.selfStaMacAddr, |
| 11498 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macSelfStaMacAddr, |
| 11499 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11500 | halSetMaxTxPower.setMaxTxPwrParams.power = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11501 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.ucPower; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11502 | |
| 11503 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11504 | &halSetMaxTxPower.setMaxTxPwrParams, |
| 11505 | sizeof(halSetMaxTxPower.setMaxTxPwrParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11506 | |
| 11507 | pWDICtx->wdiReqStatusCB = pwdiSetMaxTxPowerParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11508 | pWDICtx->pReqStatusUserData = pwdiSetMaxTxPowerParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11509 | |
| 11510 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11511 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11512 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11513 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11514 | wdiSetMaxTxPowerRspCb, pEventData->pUserData, |
| 11515 | WDI_SET_MAX_TX_POWER_RESP); |
| 11516 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11517 | } |
| 11518 | |
| 11519 | #ifdef WLAN_FEATURE_P2P |
| 11520 | |
| 11521 | /** |
| 11522 | @brief Process P2P Notice Of Absence Request function (called when Main FSM |
| 11523 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11524 | |
| 11525 | @param pWDICtx: pointer to the WLAN DAL context |
| 11526 | pEventData: pointer to the event information structure |
| 11527 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11528 | @see |
| 11529 | @return Result of the function call |
| 11530 | */ |
| 11531 | WDI_Status |
| 11532 | WDI_ProcessP2PGONOAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11533 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11534 | WDI_ControlBlockType* pWDICtx, |
| 11535 | WDI_EventInfoType* pEventData |
| 11536 | ) |
| 11537 | { |
| 11538 | WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams; |
| 11539 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11540 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11541 | wpt_uint16 usDataOffset = 0; |
| 11542 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11543 | tSetP2PGONOAParams halSetP2PGONOAParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11544 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11545 | |
| 11546 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11547 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11548 | -------------------------------------------------------------------------*/ |
| 11549 | if (( NULL == pEventData ) || |
| 11550 | ( NULL == pEventData->pEventData) || |
| 11551 | ( NULL == pEventData->pCBfnc)) |
| 11552 | { |
| 11553 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11554 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11555 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11556 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11557 | } |
| 11558 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11559 | pwdiP2PGONOAReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11560 | (WDI_SetP2PGONOAReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11561 | wdiP2PGONOAReqRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11562 | (WDI_SetP2PGONOAReqParamsRspCb)pEventData->pCBfnc; |
| 11563 | /*----------------------------------------------------------------------- |
| 11564 | Get message buffer |
| 11565 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11566 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 11567 | WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11568 | sizeof(halSetP2PGONOAParams), |
| 11569 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11570 | ( usSendSize < (usDataOffset + sizeof(halSetP2PGONOAParams) ))) |
| 11571 | { |
| 11572 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11573 | "Unable to get send buffer in set P2P GO NOA REQ %x %x %x", |
| 11574 | pEventData, pwdiP2PGONOAReqParams, wdiP2PGONOAReqRspCb); |
| 11575 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11576 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11577 | } |
| 11578 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11579 | halSetP2PGONOAParams.opp_ps = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11580 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucOpp_ps; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11581 | halSetP2PGONOAParams.ctWindow = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11582 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uCtWindow; |
| 11583 | halSetP2PGONOAParams.count = pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucCount; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11584 | halSetP2PGONOAParams.duration = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11585 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uDuration; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11586 | halSetP2PGONOAParams.interval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11587 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11588 | halSetP2PGONOAParams.single_noa_duration = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11589 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uSingle_noa_duration; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11590 | halSetP2PGONOAParams.psSelection = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11591 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucPsSelection; |
| 11592 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11593 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11594 | &halSetP2PGONOAParams, |
| 11595 | sizeof(halSetP2PGONOAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11596 | |
| 11597 | pWDICtx->wdiReqStatusCB = pwdiP2PGONOAReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11598 | pWDICtx->pReqStatusUserData = pwdiP2PGONOAReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11599 | |
| 11600 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11601 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11602 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11603 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11604 | wdiP2PGONOAReqRspCb, pEventData->pUserData, |
| 11605 | WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11606 | }/*WDI_ProcessP2PGONOAReq*/ |
| 11607 | |
| 11608 | #endif |
| 11609 | |
| 11610 | |
| 11611 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11612 | @brief Function to handle the ack from DXE once the power |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11613 | state is set. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11614 | @param None |
| 11615 | |
| 11616 | @see |
| 11617 | @return void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11618 | */ |
| 11619 | void |
| 11620 | WDI_SetPowerStateCb |
| 11621 | ( |
| 11622 | wpt_status status, |
| 11623 | unsigned int dxePhyAddr, |
| 11624 | void *pContext |
| 11625 | ) |
| 11626 | { |
| 11627 | wpt_status wptStatus; |
| 11628 | WDI_ControlBlockType *pCB = NULL; |
| 11629 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 11630 | if(eWLAN_PAL_STATUS_E_FAILURE == status ) |
| 11631 | { |
| 11632 | //it shouldn't happen, put an error msg |
| 11633 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11634 | /* |
| 11635 | * Trigger the event to bring the Enter BMPS req function to come |
| 11636 | * out of wait |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11637 | */ |
| 11638 | if( NULL != pContext ) |
| 11639 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11640 | pCB = (WDI_ControlBlockType *)pContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11641 | } |
| 11642 | else |
| 11643 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11644 | //put an error msg |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11645 | pCB = &gWDICb; |
| 11646 | } |
| 11647 | pCB->dxePhyAddr = dxePhyAddr; |
| 11648 | wptStatus = wpalEventSet(&pCB->setPowerStateEvent); |
| 11649 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 11650 | { |
| 11651 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11652 | "Failed to set an event"); |
| 11653 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11654 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11655 | } |
| 11656 | return; |
| 11657 | } |
| 11658 | |
| 11659 | |
| 11660 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11661 | @brief Process Enter IMPS Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11662 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11663 | |
| 11664 | @param pWDICtx: pointer to the WLAN DAL context |
| 11665 | pEventData: pointer to the event information structure |
| 11666 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11667 | @see |
| 11668 | @return Result of the function call |
| 11669 | */ |
| 11670 | WDI_Status |
| 11671 | WDI_ProcessEnterImpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11672 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11673 | WDI_ControlBlockType* pWDICtx, |
| 11674 | WDI_EventInfoType* pEventData |
| 11675 | ) |
| 11676 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11677 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11678 | WDI_EnterImpsRspCb wdiEnterImpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11679 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11680 | wpt_uint16 usDataOffset = 0; |
| 11681 | wpt_uint16 usSendSize = 0; |
| 11682 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11683 | |
| 11684 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11685 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11686 | -------------------------------------------------------------------------*/ |
| 11687 | if (( NULL == pEventData ) || |
| 11688 | ( NULL == (wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pEventData->pCBfnc))) |
| 11689 | { |
| 11690 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11691 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11692 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11693 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11694 | } |
| 11695 | |
| 11696 | /*----------------------------------------------------------------------- |
| 11697 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11698 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11699 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11700 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_IMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11701 | 0, |
| 11702 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11703 | ( usSendSize < (usDataOffset ))) |
| 11704 | { |
| 11705 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11706 | "Unable to get send buffer in Enter IMPS req %x %x", |
| 11707 | pEventData, wdiEnterImpsRspCb); |
| 11708 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11709 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11710 | } |
| 11711 | |
| 11712 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11713 | wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 11714 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11715 | { |
| 11716 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11717 | "WDI Init failed to reset an event"); |
| 11718 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11719 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11720 | return VOS_STATUS_E_FAILURE; |
| 11721 | } |
| 11722 | |
| 11723 | // notify DTS that we are entering IMPS |
| 11724 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_IMPS, WDI_SetPowerStateCb); |
| 11725 | |
| 11726 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11727 | * 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] | 11728 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11729 | wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 11730 | WDI_SET_POWER_STATE_TIMEOUT); |
| 11731 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11732 | { |
| 11733 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11734 | "WDI Init failed to wait on an event"); |
| 11735 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11736 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11737 | return VOS_STATUS_E_FAILURE; |
| 11738 | } |
| 11739 | |
| 11740 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11741 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11742 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11743 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11744 | wdiEnterImpsRspCb, pEventData->pUserData, WDI_ENTER_IMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11745 | }/*WDI_ProcessEnterImpsReq*/ |
| 11746 | |
| 11747 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11748 | @brief Process Exit IMPS Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11749 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11750 | |
| 11751 | @param pWDICtx: pointer to the WLAN DAL context |
| 11752 | pEventData: pointer to the event information structure |
| 11753 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11754 | @see |
| 11755 | @return Result of the function call |
| 11756 | */ |
| 11757 | WDI_Status |
| 11758 | WDI_ProcessExitImpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11759 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11760 | WDI_ControlBlockType* pWDICtx, |
| 11761 | WDI_EventInfoType* pEventData |
| 11762 | ) |
| 11763 | { |
| 11764 | WDI_ExitImpsRspCb wdiExitImpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11765 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11766 | wpt_uint16 usDataOffset = 0; |
| 11767 | wpt_uint16 usSendSize = 0; |
| 11768 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11769 | |
| 11770 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11771 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11772 | -------------------------------------------------------------------------*/ |
| 11773 | if (( NULL == pEventData ) || |
| 11774 | ( NULL == (wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pEventData->pCBfnc))) |
| 11775 | { |
| 11776 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11777 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11778 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11779 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11780 | } |
| 11781 | |
| 11782 | /*----------------------------------------------------------------------- |
| 11783 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11784 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11785 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11786 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_IMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11787 | 0, |
| 11788 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11789 | ( usSendSize < (usDataOffset ))) |
| 11790 | { |
| 11791 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11792 | "Unable to get send buffer in Exit IMPS req %x %x", |
| 11793 | pEventData, wdiExitImpsRspCb); |
| 11794 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11795 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11796 | } |
| 11797 | |
| 11798 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11799 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11800 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11801 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11802 | wdiExitImpsRspCb, pEventData->pUserData, WDI_EXIT_IMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11803 | }/*WDI_ProcessExitImpsReq*/ |
| 11804 | |
| 11805 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11806 | @brief Process Enter BMPS Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11807 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11808 | |
| 11809 | @param pWDICtx: pointer to the WLAN DAL context |
| 11810 | pEventData: pointer to the event information structure |
| 11811 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11812 | @see |
| 11813 | @return Result of the function call |
| 11814 | */ |
| 11815 | WDI_Status |
| 11816 | WDI_ProcessEnterBmpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11817 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11818 | WDI_ControlBlockType* pWDICtx, |
| 11819 | WDI_EventInfoType* pEventData |
| 11820 | ) |
| 11821 | { |
| 11822 | WDI_EnterBmpsReqParamsType* pwdiEnterBmpsReqParams = NULL; |
| 11823 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11824 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11825 | wpt_uint16 usDataOffset = 0; |
| 11826 | wpt_uint16 usSendSize = 0; |
| 11827 | tHalEnterBmpsReqParams enterBmpsReq; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11828 | wpt_status wptStatus; |
| 11829 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11830 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11831 | |
| 11832 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11833 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11834 | -------------------------------------------------------------------------*/ |
| 11835 | if (( NULL == pEventData ) || |
| 11836 | ( NULL == (pwdiEnterBmpsReqParams = (WDI_EnterBmpsReqParamsType*)pEventData->pEventData)) || |
| 11837 | ( NULL == (wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pEventData->pCBfnc))) |
| 11838 | { |
| 11839 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11840 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11841 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11842 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11843 | } |
| 11844 | |
| 11845 | /*----------------------------------------------------------------------- |
| 11846 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11847 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11848 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11849 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_BMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11850 | sizeof(enterBmpsReq), |
| 11851 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11852 | ( usSendSize < (usDataOffset + sizeof(enterBmpsReq) ))) |
| 11853 | { |
| 11854 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11855 | "Unable to get send buffer in Enter BMPS req %x %x %x", |
| 11856 | pEventData, pwdiEnterBmpsReqParams, wdiEnterBmpsRspCb); |
| 11857 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11858 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11859 | } |
| 11860 | |
| 11861 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11862 | wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 11863 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11864 | { |
| 11865 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11866 | "WDI Init failed to reset an event"); |
| 11867 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11868 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11869 | return VOS_STATUS_E_FAILURE; |
| 11870 | } |
| 11871 | |
| 11872 | // notify DTS that we are entering BMPS |
| 11873 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, WDI_SetPowerStateCb); |
| 11874 | |
| 11875 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11876 | * 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] | 11877 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11878 | wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 11879 | WDI_SET_POWER_STATE_TIMEOUT); |
| 11880 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11881 | { |
| 11882 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11883 | "WDI Init failed to wait on an event"); |
| 11884 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11885 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11886 | return VOS_STATUS_E_FAILURE; |
| 11887 | } |
| 11888 | |
| 11889 | pWDICtx->bInBmps = eWLAN_PAL_TRUE; |
| 11890 | |
| 11891 | enterBmpsReq.bssIdx = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucBssIdx; |
| 11892 | enterBmpsReq.tbtt = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.uTbtt; |
| 11893 | enterBmpsReq.dtimCount = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimCount; |
| 11894 | enterBmpsReq.dtimPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimPeriod; |
| 11895 | |
| 11896 | // For CCX and 11R Roaming |
| 11897 | enterBmpsReq.rssiFilterPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.rssiFilterPeriod; |
| 11898 | enterBmpsReq.numBeaconPerRssiAverage = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.numBeaconPerRssiAverage; |
| 11899 | enterBmpsReq.bRssiFilterEnable = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.bRssiFilterEnable; |
| 11900 | |
| 11901 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11902 | &enterBmpsReq, |
| 11903 | sizeof(enterBmpsReq)); |
| 11904 | |
| 11905 | pWDICtx->wdiReqStatusCB = pwdiEnterBmpsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11906 | pWDICtx->pReqStatusUserData = pwdiEnterBmpsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11907 | |
| 11908 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11909 | Send Get STA Request to HAL |
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 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11912 | wdiEnterBmpsRspCb, pEventData->pUserData, WDI_ENTER_BMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11913 | }/*WDI_ProcessEnterBmpsReq*/ |
| 11914 | |
| 11915 | /** |
| 11916 | @brief Process Exit BMPS Request function (called when Main FSM |
| 11917 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11918 | |
| 11919 | @param pWDICtx: pointer to the WLAN DAL context |
| 11920 | pEventData: pointer to the event information structure |
| 11921 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11922 | @see |
| 11923 | @return Result of the function call |
| 11924 | */ |
| 11925 | WDI_Status |
| 11926 | WDI_ProcessExitBmpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11927 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11928 | WDI_ControlBlockType* pWDICtx, |
| 11929 | WDI_EventInfoType* pEventData |
| 11930 | ) |
| 11931 | { |
| 11932 | WDI_ExitBmpsReqParamsType* pwdiExitBmpsReqParams = NULL; |
| 11933 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11934 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11935 | wpt_uint16 usDataOffset = 0; |
| 11936 | wpt_uint16 usSendSize = 0; |
| 11937 | tHalExitBmpsReqParams exitBmpsReq; |
| 11938 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11939 | |
| 11940 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11941 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11942 | -------------------------------------------------------------------------*/ |
| 11943 | if (( NULL == pEventData ) || |
| 11944 | ( NULL == (pwdiExitBmpsReqParams = (WDI_ExitBmpsReqParamsType*)pEventData->pEventData)) || |
| 11945 | ( NULL == (wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pEventData->pCBfnc))) |
| 11946 | { |
| 11947 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11948 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11949 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11950 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11951 | } |
| 11952 | |
| 11953 | /*----------------------------------------------------------------------- |
| 11954 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11955 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11956 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11957 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_BMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11958 | sizeof(exitBmpsReq), |
| 11959 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11960 | ( usSendSize < (usDataOffset + sizeof(exitBmpsReq) ))) |
| 11961 | { |
| 11962 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11963 | "Unable to get send buffer in Exit BMPS req %x %x %x", |
| 11964 | pEventData, pwdiExitBmpsReqParams, wdiExitBmpsRspCb); |
| 11965 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11966 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11967 | } |
| 11968 | exitBmpsReq.sendDataNull = pwdiExitBmpsReqParams->wdiExitBmpsInfo.ucSendDataNull; |
| 11969 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11970 | exitBmpsReq.bssIdx = pwdiExitBmpsReqParams->wdiExitBmpsInfo.bssIdx; |
| 11971 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11972 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11973 | &exitBmpsReq, |
| 11974 | sizeof(exitBmpsReq)); |
| 11975 | |
| 11976 | pWDICtx->wdiReqStatusCB = pwdiExitBmpsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11977 | pWDICtx->pReqStatusUserData = pwdiExitBmpsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11978 | |
| 11979 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11980 | Send Get STA Request to HAL |
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 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11983 | wdiExitBmpsRspCb, pEventData->pUserData, WDI_EXIT_BMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11984 | }/*WDI_ProcessExitBmpsReq*/ |
| 11985 | |
| 11986 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11987 | @brief Process Enter UAPSD Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11988 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11989 | |
| 11990 | @param pWDICtx: pointer to the WLAN DAL context |
| 11991 | pEventData: pointer to the event information structure |
| 11992 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11993 | @see |
| 11994 | @return Result of the function call |
| 11995 | */ |
| 11996 | WDI_Status |
| 11997 | WDI_ProcessEnterUapsdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11998 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11999 | WDI_ControlBlockType* pWDICtx, |
| 12000 | WDI_EventInfoType* pEventData |
| 12001 | ) |
| 12002 | { |
| 12003 | WDI_EnterUapsdReqParamsType* pwdiEnterUapsdReqParams = NULL; |
| 12004 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12005 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12006 | wpt_uint16 usDataOffset = 0; |
| 12007 | wpt_uint16 usSendSize = 0; |
| 12008 | tUapsdReqParams enterUapsdReq; |
| 12009 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12010 | |
| 12011 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12012 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12013 | -------------------------------------------------------------------------*/ |
| 12014 | if (( NULL == pEventData ) || |
| 12015 | ( NULL == (pwdiEnterUapsdReqParams = (WDI_EnterUapsdReqParamsType*)pEventData->pEventData)) || |
| 12016 | ( NULL == (wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pEventData->pCBfnc))) |
| 12017 | { |
| 12018 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12019 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12020 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12021 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12022 | } |
| 12023 | |
| 12024 | /*----------------------------------------------------------------------- |
| 12025 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12026 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12027 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12028 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_UAPSD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12029 | sizeof(enterUapsdReq), |
| 12030 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12031 | ( usSendSize < (usDataOffset + sizeof(enterUapsdReq) ))) |
| 12032 | { |
| 12033 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12034 | "Unable to get send buffer in Enter UAPSD req %x %x %x", |
| 12035 | pEventData, pwdiEnterUapsdReqParams, wdiEnterUapsdRspCb); |
| 12036 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12037 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12038 | } |
| 12039 | |
| 12040 | enterUapsdReq.beDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeDeliveryEnabled; |
| 12041 | enterUapsdReq.beTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeTriggerEnabled; |
| 12042 | enterUapsdReq.bkDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkDeliveryEnabled; |
| 12043 | enterUapsdReq.bkTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkTriggerEnabled; |
| 12044 | enterUapsdReq.viDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViDeliveryEnabled; |
| 12045 | enterUapsdReq.viTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViTriggerEnabled; |
| 12046 | enterUapsdReq.voDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoDeliveryEnabled; |
| 12047 | enterUapsdReq.voTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoTriggerEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12048 | enterUapsdReq.bssIdx = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.bssIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12049 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12050 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12051 | &enterUapsdReq, |
| 12052 | sizeof(enterUapsdReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12053 | |
| 12054 | pWDICtx->wdiReqStatusCB = pwdiEnterUapsdReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12055 | pWDICtx->pReqStatusUserData = pwdiEnterUapsdReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12056 | |
| 12057 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12058 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12059 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12060 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12061 | wdiEnterUapsdRspCb, pEventData->pUserData, WDI_ENTER_UAPSD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12062 | }/*WDI_ProcessEnterUapsdReq*/ |
| 12063 | |
| 12064 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12065 | @brief Process Exit UAPSD Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12066 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12067 | |
| 12068 | @param pWDICtx: pointer to the WLAN DAL context |
| 12069 | pEventData: pointer to the event information structure |
| 12070 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12071 | @see |
| 12072 | @return Result of the function call |
| 12073 | */ |
| 12074 | WDI_Status |
| 12075 | WDI_ProcessExitUapsdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12076 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12077 | WDI_ControlBlockType* pWDICtx, |
| 12078 | WDI_EventInfoType* pEventData |
| 12079 | ) |
| 12080 | { |
| 12081 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12082 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12083 | wpt_uint16 usDataOffset = 0; |
| 12084 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12085 | WDI_ExitUapsdReqParamsType *pExitUapsdparams; |
| 12086 | wpt_uint8 bssIdx = 0; |
| 12087 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12088 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12089 | |
| 12090 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12091 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12092 | -------------------------------------------------------------------------*/ |
| 12093 | if (( NULL == pEventData ) || |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12094 | ( NULL == (pExitUapsdparams = (WDI_ExitUapsdReqParamsType *)pEventData->pEventData)) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12095 | ( NULL == (wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pEventData->pCBfnc))) |
| 12096 | { |
| 12097 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12098 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12099 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12100 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12101 | } |
| 12102 | |
| 12103 | /*----------------------------------------------------------------------- |
| 12104 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12105 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12106 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12107 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_UAPSD_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12108 | sizeof(wpt_uint8), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12109 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12110 | ( usSendSize < (usDataOffset + sizeof(wpt_uint8)))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12111 | { |
| 12112 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12113 | "Unable to get send buffer in Exit UAPSD req %x %x", |
| 12114 | pEventData, wdiExitUapsdRspCb); |
| 12115 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12116 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12117 | } |
| 12118 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12119 | bssIdx = pExitUapsdparams->wdiExitUapsdInfo.bssIdx; |
| 12120 | |
| 12121 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12122 | &bssIdx, |
| 12123 | sizeof(wpt_uint8)); |
| 12124 | |
| 12125 | pWDICtx->wdiReqStatusCB = pExitUapsdparams->wdiReqStatusCB; |
| 12126 | pWDICtx->pReqStatusUserData = pExitUapsdparams->pUserData; |
| 12127 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12128 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12129 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12130 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12131 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12132 | wdiExitUapsdRspCb, pEventData->pUserData, WDI_EXIT_UAPSD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12133 | }/*WDI_ProcessExitUapsdReq*/ |
| 12134 | |
| 12135 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12136 | @brief Process Set UAPSD params Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12137 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12138 | |
| 12139 | @param pWDICtx: pointer to the WLAN DAL context |
| 12140 | pEventData: pointer to the event information structure |
| 12141 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12142 | @see |
| 12143 | @return Result of the function call |
| 12144 | */ |
| 12145 | WDI_Status |
| 12146 | WDI_ProcessSetUapsdAcParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12147 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12148 | WDI_ControlBlockType* pWDICtx, |
| 12149 | WDI_EventInfoType* pEventData |
| 12150 | ) |
| 12151 | { |
| 12152 | WDI_SetUapsdAcParamsReqParamsType* pwdiSetUapsdAcParams = NULL; |
| 12153 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12154 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12155 | wpt_uint16 usDataOffset = 0; |
| 12156 | wpt_uint16 usSendSize = 0; |
| 12157 | tUapsdInfo uapsdAcParamsReq; |
| 12158 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12159 | |
| 12160 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12161 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12162 | -------------------------------------------------------------------------*/ |
| 12163 | if (( NULL == pEventData ) || |
| 12164 | ( NULL == (pwdiSetUapsdAcParams = (WDI_SetUapsdAcParamsReqParamsType*)pEventData->pEventData)) || |
| 12165 | ( NULL == (wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pEventData->pCBfnc))) |
| 12166 | { |
| 12167 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12168 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12169 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12170 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12171 | } |
| 12172 | |
| 12173 | /*----------------------------------------------------------------------- |
| 12174 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12175 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12176 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12177 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_UAPSD_PARAM_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12178 | sizeof(uapsdAcParamsReq), |
| 12179 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12180 | ( usSendSize < (usDataOffset + sizeof(uapsdAcParamsReq) ))) |
| 12181 | { |
| 12182 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12183 | "Unable to get send buffer in Set UAPSD params req %x %x %x", |
| 12184 | pEventData, pwdiSetUapsdAcParams, wdiSetUapsdAcParamsCb); |
| 12185 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12186 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12187 | } |
| 12188 | |
| 12189 | uapsdAcParamsReq.ac = pwdiSetUapsdAcParams->wdiUapsdInfo.ucAc; |
| 12190 | uapsdAcParamsReq.staidx = pwdiSetUapsdAcParams->wdiUapsdInfo.ucSTAIdx; |
| 12191 | uapsdAcParamsReq.up = pwdiSetUapsdAcParams->wdiUapsdInfo.ucUp; |
| 12192 | uapsdAcParamsReq.delayInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uDelayInterval; |
| 12193 | uapsdAcParamsReq.srvInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSrvInterval; |
| 12194 | uapsdAcParamsReq.susInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSusInterval; |
| 12195 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12196 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12197 | &uapsdAcParamsReq, |
| 12198 | sizeof(uapsdAcParamsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12199 | |
| 12200 | pWDICtx->wdiReqStatusCB = pwdiSetUapsdAcParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12201 | pWDICtx->pReqStatusUserData = pwdiSetUapsdAcParams->pUserData; |
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 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12205 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12206 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12207 | wdiSetUapsdAcParamsCb, pEventData->pUserData, WDI_SET_UAPSD_PARAM_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12208 | }/*WDI_ProcessSetUapsdAcParamsReq*/ |
| 12209 | |
| 12210 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12211 | @brief Process update UAPSD params Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12212 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12213 | |
| 12214 | @param pWDICtx: pointer to the WLAN DAL context |
| 12215 | pEventData: pointer to the event information structure |
| 12216 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12217 | @see |
| 12218 | @return Result of the function call |
| 12219 | */ |
| 12220 | WDI_Status |
| 12221 | WDI_ProcessUpdateUapsdParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12222 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12223 | WDI_ControlBlockType* pWDICtx, |
| 12224 | WDI_EventInfoType* pEventData |
| 12225 | ) |
| 12226 | { |
| 12227 | WDI_UpdateUapsdReqParamsType* pwdiUpdateUapsdReqParams = NULL; |
| 12228 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12229 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12230 | wpt_uint16 usDataOffset = 0; |
| 12231 | wpt_uint16 usSendSize = 0; |
| 12232 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12233 | |
| 12234 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12235 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12236 | -------------------------------------------------------------------------*/ |
| 12237 | if (( NULL == pEventData ) || |
| 12238 | ( NULL == (pwdiUpdateUapsdReqParams = (WDI_UpdateUapsdReqParamsType*)pEventData->pEventData)) || |
| 12239 | ( NULL == (wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pEventData->pCBfnc))) |
| 12240 | { |
| 12241 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12242 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12243 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12244 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12245 | } |
| 12246 | |
| 12247 | /*----------------------------------------------------------------------- |
| 12248 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12249 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12250 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12251 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_UAPSD_PARAM_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12252 | sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo), |
| 12253 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12254 | ( usSendSize < (usDataOffset + sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo) ))) |
| 12255 | { |
| 12256 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12257 | "Unable to get send buffer in Update UAPSD params req %x %x %x", |
| 12258 | pEventData, pwdiUpdateUapsdReqParams, wdiUpdateUapsdParamsCb); |
| 12259 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12260 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12261 | } |
| 12262 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12263 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12264 | &pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo, |
| 12265 | sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12266 | |
| 12267 | pWDICtx->wdiReqStatusCB = pwdiUpdateUapsdReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12268 | pWDICtx->pReqStatusUserData = pwdiUpdateUapsdReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12269 | |
| 12270 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12271 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12272 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12273 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12274 | wdiUpdateUapsdParamsCb, pEventData->pUserData, WDI_UPDATE_UAPSD_PARAM_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12275 | }/*WDI_ProcessUpdateUapsdParamsReq*/ |
| 12276 | |
| 12277 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12278 | @brief Process Configure RXP filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12279 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12280 | |
| 12281 | @param pWDICtx: pointer to the WLAN DAL context |
| 12282 | pEventData: pointer to the event information structure |
| 12283 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12284 | @see |
| 12285 | @return Result of the function call |
| 12286 | */ |
| 12287 | WDI_Status |
| 12288 | WDI_ProcessConfigureRxpFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12289 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12290 | WDI_ControlBlockType* pWDICtx, |
| 12291 | WDI_EventInfoType* pEventData |
| 12292 | ) |
| 12293 | { |
| 12294 | WDI_ConfigureRxpFilterReqParamsType* pwdiRxpFilterParams = NULL; |
| 12295 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12296 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12297 | wpt_uint16 usDataOffset = 0; |
| 12298 | wpt_uint16 usSendSize = 0; |
| 12299 | tHalConfigureRxpFilterReqParams halRxpFilterParams; |
| 12300 | |
| 12301 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12302 | |
| 12303 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12304 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12305 | -------------------------------------------------------------------------*/ |
| 12306 | if (( NULL == pEventData ) || |
| 12307 | ( NULL == (pwdiRxpFilterParams = (WDI_ConfigureRxpFilterReqParamsType*)pEventData->pEventData)) || |
| 12308 | ( NULL == (wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pEventData->pCBfnc))) |
| 12309 | { |
| 12310 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12311 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12312 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12313 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12314 | } |
| 12315 | |
| 12316 | /*----------------------------------------------------------------------- |
| 12317 | Get message buffer |
| 12318 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12319 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_RXP_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12320 | sizeof(halRxpFilterParams), |
| 12321 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12322 | ( usSendSize < (usDataOffset + sizeof(halRxpFilterParams) ))) |
| 12323 | { |
| 12324 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12325 | "Unable to get send buffer in Set UAPSD params req %x %x %x", |
| 12326 | pEventData, pwdiRxpFilterParams, wdiConfigureRxpFilterCb); |
| 12327 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12328 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12329 | } |
| 12330 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12331 | halRxpFilterParams.setMcstBcstFilterSetting = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12332 | pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12333 | halRxpFilterParams.setMcstBcstFilter = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12334 | pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter; |
| 12335 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12336 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12337 | &halRxpFilterParams, |
| 12338 | sizeof(halRxpFilterParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12339 | |
| 12340 | pWDICtx->wdiReqStatusCB = pwdiRxpFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12341 | pWDICtx->pReqStatusUserData = pwdiRxpFilterParams->pUserData; |
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 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12345 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12346 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12347 | wdiConfigureRxpFilterCb, pEventData->pUserData, WDI_CONFIGURE_RXP_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12348 | }/*WDI_ProcessConfigureRxpFilterReq*/ |
| 12349 | |
| 12350 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12351 | @brief Process set beacon filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12352 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12353 | |
| 12354 | @param pWDICtx: pointer to the WLAN DAL context |
| 12355 | pEventData: pointer to the event information structure |
| 12356 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12357 | @see |
| 12358 | @return Result of the function call |
| 12359 | */ |
| 12360 | WDI_Status |
| 12361 | WDI_ProcessSetBeaconFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12362 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12363 | WDI_ControlBlockType* pWDICtx, |
| 12364 | WDI_EventInfoType* pEventData |
| 12365 | ) |
| 12366 | { |
| 12367 | WDI_BeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL; |
| 12368 | WDI_SetBeaconFilterCb wdiBeaconFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12369 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12370 | wpt_uint16 usDataOffset = 0; |
| 12371 | wpt_uint16 usSendSize = 0; |
| 12372 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12373 | |
| 12374 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12375 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12376 | -------------------------------------------------------------------------*/ |
| 12377 | if (( NULL == pEventData ) || |
| 12378 | ( NULL == (pwdiBeaconFilterParams = (WDI_BeaconFilterReqParamsType*)pEventData->pEventData)) || |
| 12379 | ( NULL == (wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pEventData->pCBfnc))) |
| 12380 | { |
| 12381 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12382 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12383 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12384 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12385 | } |
| 12386 | |
| 12387 | /*----------------------------------------------------------------------- |
| 12388 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12389 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12390 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12391 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BEACON_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12392 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) + pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe), |
| 12393 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12394 | ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) ))) |
| 12395 | { |
| 12396 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12397 | "Unable to get send buffer in Set beacon filter req %x %x %x", |
| 12398 | pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb); |
| 12399 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12400 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12401 | } |
| 12402 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12403 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12404 | &pwdiBeaconFilterParams->wdiBeaconFilterInfo, |
| 12405 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo)); |
| 12406 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo), |
| 12407 | &pwdiBeaconFilterParams->aFilters[0], |
| 12408 | pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12409 | |
| 12410 | pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12411 | pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData; |
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 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12415 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12416 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12417 | wdiBeaconFilterCb, pEventData->pUserData, WDI_SET_BEACON_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12418 | }/*WDI_ProcessSetBeaconFilterReq*/ |
| 12419 | |
| 12420 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12421 | @brief Process remove beacon filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12422 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12423 | |
| 12424 | @param pWDICtx: pointer to the WLAN DAL context |
| 12425 | pEventData: pointer to the event information structure |
| 12426 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12427 | @see |
| 12428 | @return Result of the function call |
| 12429 | */ |
| 12430 | WDI_Status |
| 12431 | WDI_ProcessRemBeaconFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12432 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12433 | WDI_ControlBlockType* pWDICtx, |
| 12434 | WDI_EventInfoType* pEventData |
| 12435 | ) |
| 12436 | { |
| 12437 | WDI_RemBeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL; |
| 12438 | WDI_RemBeaconFilterCb wdiBeaconFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12439 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12440 | wpt_uint16 usDataOffset = 0; |
| 12441 | wpt_uint16 usSendSize = 0; |
| 12442 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12443 | |
| 12444 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12445 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12446 | -------------------------------------------------------------------------*/ |
| 12447 | if (( NULL == pEventData ) || |
| 12448 | ( NULL == (pwdiBeaconFilterParams = (WDI_RemBeaconFilterReqParamsType*)pEventData->pEventData)) || |
| 12449 | ( NULL == (wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pEventData->pCBfnc))) |
| 12450 | { |
| 12451 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12452 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12453 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12454 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12455 | } |
| 12456 | |
| 12457 | /*----------------------------------------------------------------------- |
| 12458 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12459 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12460 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12461 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_REM_BEACON_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12462 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo), |
| 12463 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12464 | ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) ))) |
| 12465 | { |
| 12466 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12467 | "Unable to get send buffer in remove beacon filter req %x %x %x", |
| 12468 | pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb); |
| 12469 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12470 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12471 | } |
| 12472 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12473 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12474 | &pwdiBeaconFilterParams->wdiBeaconFilterInfo, |
| 12475 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12476 | |
| 12477 | pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12478 | pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12479 | |
| 12480 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12481 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12482 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12483 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12484 | wdiBeaconFilterCb, pEventData->pUserData, WDI_REM_BEACON_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12485 | } |
| 12486 | |
| 12487 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12488 | @brief Process set RSSI thresholds Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12489 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12490 | |
| 12491 | @param pWDICtx: pointer to the WLAN DAL context |
| 12492 | pEventData: pointer to the event information structure |
| 12493 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12494 | @see |
| 12495 | @return Result of the function call |
| 12496 | */ |
| 12497 | WDI_Status |
| 12498 | WDI_ProcessSetRSSIThresholdsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12499 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12500 | WDI_ControlBlockType* pWDICtx, |
| 12501 | WDI_EventInfoType* pEventData |
| 12502 | ) |
| 12503 | { |
| 12504 | WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams = NULL; |
| 12505 | WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12506 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12507 | wpt_uint16 usDataOffset = 0; |
| 12508 | wpt_uint16 usSendSize = 0; |
| 12509 | tHalRSSIThresholds rssiThresholdsReq; |
| 12510 | WDI_Status ret_status = 0; |
| 12511 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12512 | |
| 12513 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12514 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12515 | -------------------------------------------------------------------------*/ |
| 12516 | if (( NULL == pEventData ) || |
| 12517 | ( NULL == (pwdiRSSIThresholdsParams = (WDI_SetRSSIThresholdsReqParamsType*)pEventData->pEventData)) || |
| 12518 | ( NULL == (wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pEventData->pCBfnc))) |
| 12519 | { |
| 12520 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12521 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12522 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12523 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12524 | } |
| 12525 | |
| 12526 | /*----------------------------------------------------------------------- |
| 12527 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12528 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12529 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12530 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_RSSI_THRESHOLDS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12531 | sizeof(rssiThresholdsReq), |
| 12532 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12533 | ( usSendSize < (usDataOffset + sizeof(rssiThresholdsReq) ))) |
| 12534 | { |
| 12535 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12536 | "Unable to get send buffer in remove beacon filter req %x %x %x", |
| 12537 | pEventData, pwdiRSSIThresholdsParams, wdiRSSIThresholdsCb); |
| 12538 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12539 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12540 | } |
| 12541 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12542 | rssiThresholdsReq.bReserved10 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12543 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bReserved10; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12544 | rssiThresholdsReq.bRssiThres1NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12545 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12546 | rssiThresholdsReq.bRssiThres1PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12547 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12548 | rssiThresholdsReq.bRssiThres2NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12549 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12550 | rssiThresholdsReq.bRssiThres2PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12551 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12552 | rssiThresholdsReq.bRssiThres3NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12553 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12554 | rssiThresholdsReq.bRssiThres3PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12555 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12556 | rssiThresholdsReq.ucRssiThreshold1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12557 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12558 | rssiThresholdsReq.ucRssiThreshold2 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12559 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold2; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12560 | rssiThresholdsReq.ucRssiThreshold3 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12561 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold3; |
| 12562 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12563 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12564 | &rssiThresholdsReq, |
| 12565 | sizeof(rssiThresholdsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12566 | |
| 12567 | pWDICtx->wdiReqStatusCB = pwdiRSSIThresholdsParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12568 | pWDICtx->pReqStatusUserData = pwdiRSSIThresholdsParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12569 | |
| 12570 | /*------------------------------------------------------------------------- |
| 12571 | Send Set threshold req to HAL |
| 12572 | -------------------------------------------------------------------------*/ |
| 12573 | if ((ret_status = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12574 | wdiRSSIThresholdsCb, pEventData->pUserData, WDI_SET_RSSI_THRESHOLDS_RESP)) == WDI_STATUS_SUCCESS) |
| 12575 | { |
| 12576 | // When we are in idle state WDI_STARTED_ST and we receive indication for threshold |
| 12577 | // req. Then as a result of processing the threshold cross ind, we trigger |
| 12578 | // a Set threshold req, then we need to indicate to WDI that it needs to |
| 12579 | // go to busy state as a result of the indication as we sent a req in the |
| 12580 | // same WDI context. |
| 12581 | // Hence expected state transition is to busy. |
| 12582 | pWDICtx->ucExpectedStateTransition = WDI_BUSY_ST; |
| 12583 | } |
| 12584 | |
| 12585 | return ret_status; |
| 12586 | } |
| 12587 | |
| 12588 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12589 | @brief Process set RSSI thresholds Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12590 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12591 | |
| 12592 | @param pWDICtx: pointer to the WLAN DAL context |
| 12593 | pEventData: pointer to the event information structure |
| 12594 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12595 | @see |
| 12596 | @return Result of the function call |
| 12597 | */ |
| 12598 | WDI_Status |
| 12599 | WDI_ProcessHostOffloadReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12600 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12601 | WDI_ControlBlockType* pWDICtx, |
| 12602 | WDI_EventInfoType* pEventData |
| 12603 | ) |
| 12604 | { |
| 12605 | WDI_HostOffloadReqParamsType* pwdiHostOffloadParams = NULL; |
| 12606 | WDI_HostOffloadCb wdiHostOffloadCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12607 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12608 | wpt_uint16 usDataOffset = 0; |
| 12609 | wpt_uint16 usSendSize = 0; |
| 12610 | tHalHostOffloadReq hostOffloadParams; |
| 12611 | tHalNSOffloadParams nsOffloadParams; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12612 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 12613 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12614 | |
| 12615 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12616 | |
| 12617 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12618 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12619 | -------------------------------------------------------------------------*/ |
| 12620 | if (( NULL == pEventData ) || |
| 12621 | ( NULL == (pwdiHostOffloadParams = (WDI_HostOffloadReqParamsType*)pEventData->pEventData)) || |
| 12622 | ( NULL == (wdiHostOffloadCb = (WDI_HostOffloadCb)pEventData->pCBfnc))) |
| 12623 | { |
| 12624 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12625 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12626 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12627 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12628 | } |
| 12629 | |
| 12630 | /*----------------------------------------------------------------------- |
| 12631 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12632 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12633 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12634 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HOST_OFFLOAD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12635 | sizeof(hostOffloadParams)+sizeof(nsOffloadParams), |
| 12636 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12637 | ( usSendSize < (usDataOffset + sizeof(hostOffloadParams) + sizeof(nsOffloadParams) ))) |
| 12638 | { |
| 12639 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12640 | "Unable to get send buffer in host offload req %x %x %x", |
| 12641 | pEventData, pwdiHostOffloadParams, wdiHostOffloadCb); |
| 12642 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12643 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12644 | } |
| 12645 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12646 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 12647 | pwdiHostOffloadParams->wdiHostOffloadInfo.bssId, |
| 12648 | &pBSSSes); |
| 12649 | if ( NULL == pBSSSes ) |
| 12650 | { |
| 12651 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12652 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12653 | return WDI_STATUS_E_FAILURE; |
| 12654 | } |
| 12655 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12656 | hostOffloadParams.offloadType = pwdiHostOffloadParams->wdiHostOffloadInfo.ucOffloadType; |
| 12657 | hostOffloadParams.enableOrDisable = pwdiHostOffloadParams->wdiHostOffloadInfo.ucEnableOrDisable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12658 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12659 | if( HAL_IPV4_ARP_REPLY_OFFLOAD == hostOffloadParams.offloadType ) |
| 12660 | { |
| 12661 | // ARP Offload |
| 12662 | wpalMemoryCopy(hostOffloadParams.params.hostIpv4Addr, |
| 12663 | pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv4Addr, |
| 12664 | 4); |
| 12665 | } |
| 12666 | else |
| 12667 | { |
| 12668 | // NS Offload |
| 12669 | wpalMemoryCopy(hostOffloadParams.params.hostIpv6Addr, |
| 12670 | pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv6Addr, |
| 12671 | 16); |
| 12672 | |
| 12673 | #ifdef WLAN_NS_OFFLOAD |
| 12674 | // copy pwdiHostOffloadParams->wdiNsOffloadParams into nsOffloadParams |
| 12675 | wpalMemoryCopy(nsOffloadParams.srcIPv6Addr, |
| 12676 | pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6Addr, |
| 12677 | 16); |
| 12678 | wpalMemoryCopy(nsOffloadParams.selfIPv6Addr, |
| 12679 | pwdiHostOffloadParams->wdiNsOffloadParams.selfIPv6Addr, |
| 12680 | 16); |
| 12681 | wpalMemoryCopy(nsOffloadParams.targetIPv6Addr1, |
| 12682 | pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1, |
| 12683 | 16); |
| 12684 | wpalMemoryCopy(nsOffloadParams.targetIPv6Addr2, |
| 12685 | pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2, |
| 12686 | 16); |
| 12687 | wpalMemoryCopy(nsOffloadParams.selfMacAddr, |
| 12688 | pwdiHostOffloadParams->wdiNsOffloadParams.selfMacAddr, |
| 12689 | 6); |
| 12690 | nsOffloadParams.srcIPv6AddrValid = pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6AddrValid; |
| 12691 | nsOffloadParams.targetIPv6Addr1Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1Valid; |
| 12692 | nsOffloadParams.targetIPv6Addr2Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2Valid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12693 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12694 | #endif // WLAN_NS_OFFLOAD |
| 12695 | } |
| 12696 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12697 | nsOffloadParams.bssIdx = pBSSSes->ucBSSIdx; |
| 12698 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12699 | // copy hostOffloadParams into pSendBuffer |
| 12700 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12701 | &hostOffloadParams, |
| 12702 | sizeof(hostOffloadParams)); |
| 12703 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12704 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12705 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12706 | // copy nsOffloadParams into pSendBuffer |
| 12707 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12708 | &nsOffloadParams, |
| 12709 | sizeof(nsOffloadParams)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12710 | } |
| 12711 | else |
| 12712 | { |
| 12713 | #ifdef WLAN_NS_OFFLOAD |
| 12714 | if( HAL_IPV6_NS_OFFLOAD == hostOffloadParams.offloadType ) |
| 12715 | { |
| 12716 | // copy nsOffloadParams into pSendBuffer |
| 12717 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams), |
| 12718 | &nsOffloadParams, |
| 12719 | sizeof(nsOffloadParams)); |
| 12720 | } |
| 12721 | #endif |
| 12722 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12723 | |
| 12724 | pWDICtx->wdiReqStatusCB = pwdiHostOffloadParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12725 | pWDICtx->pReqStatusUserData = pwdiHostOffloadParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12726 | |
| 12727 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12728 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12729 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12730 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12731 | wdiHostOffloadCb, pEventData->pUserData, WDI_HOST_OFFLOAD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12732 | }/*WDI_ProcessHostOffloadReq*/ |
| 12733 | |
| 12734 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12735 | @brief Process Keep Alive Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12736 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12737 | |
| 12738 | @param pWDICtx: pointer to the WLAN DAL context |
| 12739 | pEventData: pointer to the event information structure |
| 12740 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12741 | @see |
| 12742 | @return Result of the function call |
| 12743 | */ |
| 12744 | WDI_Status |
| 12745 | WDI_ProcessKeepAliveReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12746 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12747 | WDI_ControlBlockType* pWDICtx, |
| 12748 | WDI_EventInfoType* pEventData |
| 12749 | ) |
| 12750 | { |
| 12751 | WDI_KeepAliveReqParamsType* pwdiKeepAliveParams = NULL; |
| 12752 | WDI_KeepAliveCb wdiKeepAliveCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12753 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12754 | wpt_uint16 usDataOffset = 0; |
| 12755 | wpt_uint16 usSendSize = 0; |
| 12756 | tHalKeepAliveReq keepAliveReq; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12757 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 12758 | WDI_BSSSessionType* pBSSSes = NULL; |
| 12759 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12760 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12761 | |
| 12762 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12763 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12764 | -------------------------------------------------------------------------*/ |
| 12765 | if (( NULL == pEventData ) || |
| 12766 | ( NULL == (pwdiKeepAliveParams = (WDI_KeepAliveReqParamsType*)pEventData->pEventData)) || |
| 12767 | ( NULL == (wdiKeepAliveCb = (WDI_KeepAliveCb)pEventData->pCBfnc))) |
| 12768 | { |
| 12769 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 12770 | "Invalid parameters in Keep Alive req"); |
| 12771 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12772 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12773 | } |
| 12774 | |
| 12775 | /*----------------------------------------------------------------------- |
| 12776 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12777 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12778 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12779 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_KEEP_ALIVE_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12780 | sizeof(keepAliveReq), |
| 12781 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12782 | ( usSendSize < (usDataOffset + sizeof(keepAliveReq) ))) |
| 12783 | { |
| 12784 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 12785 | "Unable to get send buffer in keep alive req %x %x %x", |
| 12786 | pEventData, pwdiKeepAliveParams, wdiKeepAliveCb); |
| 12787 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12788 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12789 | } |
| 12790 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12791 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 12792 | pwdiKeepAliveParams->wdiKeepAliveInfo.bssId, |
| 12793 | &pBSSSes); |
| 12794 | if ( NULL == pBSSSes ) |
| 12795 | { |
| 12796 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12797 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12798 | return WDI_STATUS_E_FAILURE; |
| 12799 | } |
| 12800 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12801 | keepAliveReq.packetType = pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType; |
| 12802 | keepAliveReq.timePeriod = pwdiKeepAliveParams->wdiKeepAliveInfo.ucTimePeriod; |
| 12803 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12804 | keepAliveReq.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12805 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12806 | if(pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType == 2) |
| 12807 | { |
| 12808 | wpalMemoryCopy(keepAliveReq.hostIpv4Addr, |
| 12809 | pwdiKeepAliveParams->wdiKeepAliveInfo.aHostIpv4Addr, |
| 12810 | HAL_IPV4_ADDR_LEN); |
| 12811 | wpalMemoryCopy(keepAliveReq.destIpv4Addr, |
| 12812 | pwdiKeepAliveParams->wdiKeepAliveInfo.aDestIpv4Addr, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12813 | HAL_IPV4_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12814 | wpalMemoryCopy(keepAliveReq.destMacAddr, |
| 12815 | pwdiKeepAliveParams->wdiKeepAliveInfo.aDestMacAddr, |
| 12816 | HAL_MAC_ADDR_LEN); |
| 12817 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12818 | |
| 12819 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12820 | &keepAliveReq, |
| 12821 | sizeof(keepAliveReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12822 | |
| 12823 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 12824 | "Process keep alive req %d",sizeof(keepAliveReq)); |
| 12825 | |
| 12826 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 12827 | "Process keep alive req time period %d",keepAliveReq.timePeriod); |
| 12828 | |
| 12829 | pWDICtx->wdiReqStatusCB = pwdiKeepAliveParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12830 | pWDICtx->pReqStatusUserData = pwdiKeepAliveParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12831 | |
| 12832 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 12833 | "Sending keep alive req to HAL"); |
| 12834 | |
| 12835 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12836 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12837 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12838 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12839 | wdiKeepAliveCb, pEventData->pUserData, WDI_KEEP_ALIVE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12840 | }/*WDI_ProcessKeepAliveReq*/ |
| 12841 | |
| 12842 | |
| 12843 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12844 | @brief Process Wowl add bc ptrn Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12845 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12846 | |
| 12847 | @param pWDICtx: pointer to the WLAN DAL context |
| 12848 | pEventData: pointer to the event information structure |
| 12849 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12850 | @see |
| 12851 | @return Result of the function call |
| 12852 | */ |
| 12853 | WDI_Status |
| 12854 | WDI_ProcessWowlAddBcPtrnReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12855 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12856 | WDI_ControlBlockType* pWDICtx, |
| 12857 | WDI_EventInfoType* pEventData |
| 12858 | ) |
| 12859 | { |
| 12860 | WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams = NULL; |
| 12861 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12862 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12863 | wpt_uint16 usDataOffset = 0; |
| 12864 | wpt_uint16 usSendSize = 0; |
| 12865 | tHalWowlAddBcastPtrn wowlAddBcPtrnReq; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12866 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 12867 | WDI_BSSSessionType* pBSSSes = NULL; |
| 12868 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12869 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12870 | |
| 12871 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12872 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12873 | -------------------------------------------------------------------------*/ |
| 12874 | if (( NULL == pEventData ) || |
| 12875 | ( NULL == (pwdiWowlAddBcPtrnParams = (WDI_WowlAddBcPtrnReqParamsType*)pEventData->pEventData)) || |
| 12876 | ( NULL == (wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pEventData->pCBfnc))) |
| 12877 | { |
| 12878 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12879 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12880 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12881 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12882 | } |
| 12883 | |
| 12884 | /*----------------------------------------------------------------------- |
| 12885 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12886 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12887 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12888 | 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] | 12889 | sizeof(wowlAddBcPtrnReq), |
| 12890 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12891 | ( usSendSize < (usDataOffset + sizeof(wowlAddBcPtrnReq) ))) |
| 12892 | { |
| 12893 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12894 | "Unable to get send buffer in Wowl add bc ptrn req %x %x %x", |
| 12895 | pEventData, pwdiWowlAddBcPtrnParams, wdiWowlAddBcPtrnCb); |
| 12896 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12897 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12898 | } |
| 12899 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12900 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 12901 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.bssId, |
| 12902 | &pBSSSes); |
| 12903 | if ( NULL == pBSSSes ) |
| 12904 | { |
| 12905 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12906 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12907 | return WDI_STATUS_E_FAILURE; |
| 12908 | } |
| 12909 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12910 | wowlAddBcPtrnReq.ucPatternId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12911 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12912 | wowlAddBcPtrnReq.ucPatternByteOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12913 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternByteOffset; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12914 | wowlAddBcPtrnReq.ucPatternMaskSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12915 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12916 | wowlAddBcPtrnReq.ucPatternSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12917 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize; |
| 12918 | |
| 12919 | if (pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize <= HAL_WOWL_BCAST_PATTERN_MAX_SIZE) |
| 12920 | { |
| 12921 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 12922 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 12923 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize); |
| 12924 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 12925 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 12926 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize); |
| 12927 | } |
| 12928 | else |
| 12929 | { |
| 12930 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 12931 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 12932 | HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 12933 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 12934 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 12935 | HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 12936 | |
| 12937 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 12938 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 12939 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 12940 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 12941 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 12942 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 12943 | } |
| 12944 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12945 | wowlAddBcPtrnReq.bssIdx = pBSSSes->ucBSSIdx; |
| 12946 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12947 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12948 | &wowlAddBcPtrnReq, |
| 12949 | sizeof(wowlAddBcPtrnReq)); |
| 12950 | |
| 12951 | pWDICtx->wdiReqStatusCB = pwdiWowlAddBcPtrnParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12952 | pWDICtx->pReqStatusUserData = pwdiWowlAddBcPtrnParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12953 | |
| 12954 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12955 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12956 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12957 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12958 | wdiWowlAddBcPtrnCb, pEventData->pUserData, WDI_WOWL_ADD_BC_PTRN_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12959 | }/*WDI_ProcessWowlAddBcPtrnReq*/ |
| 12960 | |
| 12961 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12962 | @brief Process Wowl delete bc ptrn Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12963 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12964 | |
| 12965 | @param pWDICtx: pointer to the WLAN DAL context |
| 12966 | pEventData: pointer to the event information structure |
| 12967 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12968 | @see |
| 12969 | @return Result of the function call |
| 12970 | */ |
| 12971 | WDI_Status |
| 12972 | WDI_ProcessWowlDelBcPtrnReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12973 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12974 | WDI_ControlBlockType* pWDICtx, |
| 12975 | WDI_EventInfoType* pEventData |
| 12976 | ) |
| 12977 | { |
| 12978 | WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams = NULL; |
| 12979 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12980 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12981 | wpt_uint16 usDataOffset = 0; |
| 12982 | wpt_uint16 usSendSize = 0; |
| 12983 | tHalWowlDelBcastPtrn wowlDelBcPtrnReq; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12984 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 12985 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12986 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12987 | |
| 12988 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12989 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12990 | -------------------------------------------------------------------------*/ |
| 12991 | if (( NULL == pEventData ) || |
| 12992 | ( NULL == (pwdiWowlDelBcPtrnParams = (WDI_WowlDelBcPtrnReqParamsType*)pEventData->pEventData)) || |
| 12993 | ( NULL == (wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pEventData->pCBfnc))) |
| 12994 | { |
| 12995 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12996 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12997 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12998 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12999 | } |
| 13000 | |
| 13001 | /*----------------------------------------------------------------------- |
| 13002 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13003 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13004 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13005 | 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] | 13006 | sizeof(wowlDelBcPtrnReq), |
| 13007 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13008 | ( usSendSize < (usDataOffset + sizeof(wowlDelBcPtrnReq) ))) |
| 13009 | { |
| 13010 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13011 | "Unable to get send buffer in Wowl del bc ptrn req %x %x %x", |
| 13012 | pEventData, pwdiWowlDelBcPtrnParams, wdiWowlDelBcPtrnCb); |
| 13013 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13014 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13015 | } |
| 13016 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13017 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 13018 | pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.bssId, |
| 13019 | &pBSSSes); |
| 13020 | if ( NULL == pBSSSes ) |
| 13021 | { |
| 13022 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13023 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13024 | return WDI_STATUS_E_FAILURE; |
| 13025 | } |
| 13026 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13027 | wowlDelBcPtrnReq.ucPatternId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13028 | pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.ucPatternId; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13029 | |
| 13030 | wowlDelBcPtrnReq.bssIdx = pBSSSes->ucBSSIdx; |
| 13031 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13032 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13033 | &wowlDelBcPtrnReq, |
| 13034 | sizeof(wowlDelBcPtrnReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13035 | |
| 13036 | pWDICtx->wdiReqStatusCB = pwdiWowlDelBcPtrnParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13037 | pWDICtx->pReqStatusUserData = pwdiWowlDelBcPtrnParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13038 | |
| 13039 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13040 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13041 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13042 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13043 | wdiWowlDelBcPtrnCb, pEventData->pUserData, WDI_WOWL_DEL_BC_PTRN_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13044 | }/*WDI_ProcessWowlDelBcPtrnReq*/ |
| 13045 | |
| 13046 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13047 | @brief Process Wowl enter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13048 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13049 | |
| 13050 | @param pWDICtx: pointer to the WLAN DAL context |
| 13051 | pEventData: pointer to the event information structure |
| 13052 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13053 | @see |
| 13054 | @return Result of the function call |
| 13055 | */ |
| 13056 | WDI_Status |
| 13057 | WDI_ProcessWowlEnterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13058 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13059 | WDI_ControlBlockType* pWDICtx, |
| 13060 | WDI_EventInfoType* pEventData |
| 13061 | ) |
| 13062 | { |
| 13063 | WDI_WowlEnterReqParamsType* pwdiWowlEnterParams = NULL; |
| 13064 | WDI_WowlEnterReqCb wdiWowlEnterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13065 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13066 | wpt_uint16 usDataOffset = 0; |
| 13067 | wpt_uint16 usSendSize = 0; |
| 13068 | tHalWowlEnterParams wowlEnterReq; |
| 13069 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13070 | |
| 13071 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13072 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13073 | -------------------------------------------------------------------------*/ |
| 13074 | if (( NULL == pEventData ) || |
| 13075 | ( NULL == (pwdiWowlEnterParams = (WDI_WowlEnterReqParamsType*)pEventData->pEventData)) || |
| 13076 | ( NULL == (wdiWowlEnterCb = (WDI_WowlEnterReqCb)pEventData->pCBfnc))) |
| 13077 | { |
| 13078 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13079 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13080 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13081 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13082 | } |
| 13083 | |
| 13084 | /*----------------------------------------------------------------------- |
| 13085 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13086 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13087 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13088 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ENTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13089 | sizeof(wowlEnterReq), |
| 13090 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13091 | ( usSendSize < (usDataOffset + sizeof(wowlEnterReq) ))) |
| 13092 | { |
| 13093 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13094 | "Unable to get send buffer in Wowl enter req %x %x %x", |
| 13095 | pEventData, pwdiWowlEnterParams, wdiWowlEnterCb); |
| 13096 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13097 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13098 | } |
| 13099 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13100 | wowlEnterReq.ucMagicPktEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13101 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucMagicPktEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13102 | wowlEnterReq.ucPatternFilteringEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13103 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucPatternFilteringEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13104 | wowlEnterReq.ucUcastPatternFilteringEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13105 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucUcastPatternFilteringEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13106 | wowlEnterReq.ucWowChnlSwitchRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13107 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowChnlSwitchRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13108 | wowlEnterReq.ucWowDeauthRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13109 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDeauthRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13110 | wowlEnterReq.ucWowDisassocRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13111 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDisassocRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13112 | wowlEnterReq.ucWowMaxMissedBeacons = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13113 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxMissedBeacons; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13114 | wowlEnterReq.ucWowMaxSleepUsec = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13115 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxSleepUsec; |
| 13116 | |
| 13117 | #ifdef WLAN_WAKEUP_EVENTS |
| 13118 | wowlEnterReq.ucWoWEAPIDRequestEnable = |
| 13119 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPIDRequestEnable; |
| 13120 | |
| 13121 | wowlEnterReq.ucWoWEAPOL4WayEnable = |
| 13122 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPOL4WayEnable; |
| 13123 | |
| 13124 | wowlEnterReq.ucWowNetScanOffloadMatch = |
| 13125 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowNetScanOffloadMatch; |
| 13126 | |
| 13127 | wowlEnterReq.ucWowGTKRekeyError = |
| 13128 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowGTKRekeyError; |
| 13129 | |
| 13130 | wowlEnterReq.ucWoWBSSConnLoss = |
| 13131 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWBSSConnLoss; |
| 13132 | #endif // WLAN_WAKEUP_EVENTS |
| 13133 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13134 | wowlEnterReq.bssIdx = pwdiWowlEnterParams->wdiWowlEnterInfo.bssIdx; |
| 13135 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13136 | wpalMemoryCopy(wowlEnterReq.magicPtrn, |
| 13137 | pwdiWowlEnterParams->wdiWowlEnterInfo.magicPtrn, |
| 13138 | sizeof(tSirMacAddr)); |
| 13139 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13140 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13141 | &wowlEnterReq, |
| 13142 | sizeof(wowlEnterReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13143 | |
| 13144 | pWDICtx->wdiReqStatusCB = pwdiWowlEnterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13145 | pWDICtx->pReqStatusUserData = pwdiWowlEnterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13146 | |
| 13147 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13148 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13149 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13150 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13151 | wdiWowlEnterCb, pEventData->pUserData, WDI_WOWL_ENTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13152 | }/*WDI_ProcessWowlEnterReq*/ |
| 13153 | |
| 13154 | /** |
| 13155 | @brief Process Wowl exit Request function (called when Main FSM |
| 13156 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13157 | |
| 13158 | @param pWDICtx: pointer to the WLAN DAL context |
| 13159 | pEventData: pointer to the event information structure |
| 13160 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13161 | @see |
| 13162 | @return Result of the function call |
| 13163 | */ |
| 13164 | WDI_Status |
| 13165 | WDI_ProcessWowlExitReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13166 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13167 | WDI_ControlBlockType* pWDICtx, |
| 13168 | WDI_EventInfoType* pEventData |
| 13169 | ) |
| 13170 | { |
| 13171 | WDI_WowlExitReqCb wdiWowlExitCb = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13172 | WDI_WowlExitReqParamsType* pwdiWowlExitParams = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13173 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13174 | wpt_uint16 usDataOffset = 0; |
| 13175 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13176 | tHalWowlExitParams wowlExitparams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13177 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13178 | |
| 13179 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13180 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13181 | -------------------------------------------------------------------------*/ |
| 13182 | if (( NULL == pEventData ) || |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13183 | ( NULL == (pwdiWowlExitParams = (WDI_WowlExitReqParamsType *)pEventData->pEventData)) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13184 | ( NULL == (wdiWowlExitCb = (WDI_WowlExitReqCb)pEventData->pCBfnc))) |
| 13185 | { |
| 13186 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13187 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13188 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13189 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13190 | } |
| 13191 | |
| 13192 | /*----------------------------------------------------------------------- |
| 13193 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13194 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13195 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13196 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_EXIT_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13197 | sizeof(wowlExitparams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13198 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13199 | ( usSendSize < (usDataOffset + sizeof(wowlExitparams)))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13200 | { |
| 13201 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13202 | "Unable to get send buffer in Wowl Exit req %x %x", |
| 13203 | pEventData, wdiWowlExitCb); |
| 13204 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13205 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13206 | } |
| 13207 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13208 | wowlExitparams.bssIdx = pwdiWowlExitParams->wdiWowlExitInfo.bssIdx; |
| 13209 | |
| 13210 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13211 | &wowlExitparams, |
| 13212 | sizeof(wowlExitparams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13213 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13214 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13215 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13216 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13217 | wdiWowlExitCb, pEventData->pUserData, WDI_WOWL_EXIT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13218 | }/*WDI_ProcessWowlExitReq*/ |
| 13219 | |
| 13220 | /** |
| 13221 | @brief Process Configure Apps Cpu Wakeup State Request function |
| 13222 | (called when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13223 | |
| 13224 | @param pWDICtx: pointer to the WLAN DAL context |
| 13225 | pEventData: pointer to the event information structure |
| 13226 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13227 | @see |
| 13228 | @return Result of the function call |
| 13229 | */ |
| 13230 | WDI_Status |
| 13231 | WDI_ProcessConfigureAppsCpuWakeupStateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13232 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13233 | WDI_ControlBlockType* pWDICtx, |
| 13234 | WDI_EventInfoType* pEventData |
| 13235 | ) |
| 13236 | { |
| 13237 | WDI_ConfigureAppsCpuWakeupStateReqParamsType* pwdiAppsCpuWakeupStateParams = NULL; |
| 13238 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13239 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13240 | wpt_uint16 usDataOffset = 0; |
| 13241 | wpt_uint16 usSendSize = 0; |
| 13242 | tHalConfigureAppsCpuWakeupStateReqParams halCfgAppsCpuWakeupStateReqParams; |
| 13243 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13244 | |
| 13245 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13246 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13247 | -------------------------------------------------------------------------*/ |
| 13248 | if (( NULL == pEventData ) || |
| 13249 | ( NULL == (pwdiAppsCpuWakeupStateParams = (WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEventData->pEventData)) || |
| 13250 | ( NULL == (wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pEventData->pCBfnc))) |
| 13251 | { |
| 13252 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13253 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13254 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13255 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13256 | } |
| 13257 | |
| 13258 | /*----------------------------------------------------------------------- |
| 13259 | Get message buffer |
| 13260 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13261 | 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] | 13262 | sizeof(halCfgAppsCpuWakeupStateReqParams), |
| 13263 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13264 | ( usSendSize < (usDataOffset + sizeof(pwdiAppsCpuWakeupStateParams->bIsAppsAwake) ))) |
| 13265 | { |
| 13266 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13267 | "Unable to get send buffer in Apps CPU Wakeup State req %x %x %x", |
| 13268 | pEventData, pwdiAppsCpuWakeupStateParams, wdiConfigureAppsCpuWakeupStateCb); |
| 13269 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13270 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13271 | } |
| 13272 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13273 | halCfgAppsCpuWakeupStateReqParams.isAppsCpuAwake = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13274 | pwdiAppsCpuWakeupStateParams->bIsAppsAwake; |
| 13275 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13276 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13277 | &halCfgAppsCpuWakeupStateReqParams, |
| 13278 | sizeof(halCfgAppsCpuWakeupStateReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13279 | |
| 13280 | pWDICtx->wdiReqStatusCB = pwdiAppsCpuWakeupStateParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13281 | pWDICtx->pReqStatusUserData = pwdiAppsCpuWakeupStateParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13282 | |
| 13283 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13284 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13285 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13286 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13287 | wdiConfigureAppsCpuWakeupStateCb, pEventData->pUserData, |
| 13288 | WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13289 | }/*WDI_ProcessConfigureAppsCpuWakeupStateReq*/ |
| 13290 | |
| 13291 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 13292 | /** |
| 13293 | @brief Process Aggregated Add TSpec Request function (called when Main FSM |
| 13294 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13295 | |
| 13296 | @param pWDICtx: pointer to the WLAN DAL context |
| 13297 | pEventData: pointer to the event information structure |
| 13298 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13299 | @see |
| 13300 | @return Result of the function call |
| 13301 | */ |
| 13302 | WDI_Status |
| 13303 | WDI_ProcessAggrAddTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13304 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13305 | WDI_ControlBlockType* pWDICtx, |
| 13306 | WDI_EventInfoType* pEventData |
| 13307 | ) |
| 13308 | { |
| 13309 | WDI_AggrAddTSReqParamsType* pwdiAggrAddTSParams; |
| 13310 | WDI_AggrAddTsRspCb wdiAggrAddTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13311 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13312 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13313 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13314 | wpt_uint16 usDataOffset = 0; |
| 13315 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13316 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13317 | wpt_macAddr macBSSID; |
| 13318 | tAggrAddTsReq halAggrAddTsReq; |
| 13319 | int i; |
| 13320 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13321 | |
| 13322 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13323 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13324 | -------------------------------------------------------------------------*/ |
| 13325 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 13326 | ( NULL == pEventData->pCBfnc )) |
| 13327 | { |
| 13328 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13329 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13330 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13331 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13332 | } |
| 13333 | wpalMemoryFill( &halAggrAddTsReq, sizeof(tAggrAddTsReq), 0 ); |
| 13334 | pwdiAggrAddTSParams = (WDI_AggrAddTSReqParamsType*)pEventData->pEventData; |
| 13335 | wdiAggrAddTSRspCb = (WDI_AggrAddTsRspCb)pEventData->pCBfnc; |
| 13336 | /*------------------------------------------------------------------------- |
| 13337 | 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] | 13338 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13339 | -------------------------------------------------------------------------*/ |
| 13340 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 13341 | |
| 13342 | /*------------------------------------------------------------------------ |
| 13343 | Find the BSS for which the request is made and identify WDI session |
| 13344 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13345 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 13346 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13347 | &macBSSID)) |
| 13348 | { |
| 13349 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13350 | "This station does not exist in the WDI Station Table %d"); |
| 13351 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13352 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13353 | } |
| 13354 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13355 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 13356 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13357 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13358 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13359 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 13360 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13361 | |
| 13362 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13363 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13364 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13365 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13366 | /*------------------------------------------------------------------------ |
| 13367 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13368 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13369 | ------------------------------------------------------------------------*/ |
| 13370 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 13371 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13372 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13373 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 13374 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13375 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13376 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13377 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13378 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13379 | } |
| 13380 | |
| 13381 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13382 | /*----------------------------------------------------------------------- |
| 13383 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13384 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13385 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13386 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_AGGR_ADD_TS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13387 | sizeof(tAggrAddTsParams), |
| 13388 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13389 | ( usSendSize < (usDataOffset + sizeof(tAggrAddTsParams) ))) |
| 13390 | { |
| 13391 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13392 | "Unable to get send buffer in set bss key req %x %x %x", |
| 13393 | pEventData, pwdiAggrAddTSParams, wdiAggrAddTSRspCb); |
| 13394 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13395 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13396 | } |
| 13397 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13398 | halAggrAddTsReq.aggrAddTsParam.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13399 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13400 | halAggrAddTsReq.aggrAddTsParam.tspecIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13401 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucTspecIdx; |
| 13402 | |
| 13403 | for( i = 0; i < WLAN_HAL_MAX_AC; i++ ) |
| 13404 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13405 | halAggrAddTsReq.aggrAddTsParam.tspec[i].type = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13406 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13407 | halAggrAddTsReq.aggrAddTsParam.tspec[i].length = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13408 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucLength; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13409 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.ackPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13410 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13411 | ackPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13412 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.accessPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13413 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13414 | accessPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13415 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.userPrio = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13416 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13417 | userPrio; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13418 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.psb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13419 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13420 | psb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13421 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.aggregation = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13422 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13423 | aggregation; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13424 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.direction = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13425 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13426 | direction; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13427 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13428 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13429 | trafficType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13430 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13431 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13432 | trafficType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13433 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.rsvd = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13434 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.rsvd; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13435 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.schedule = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13436 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.schedule; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13437 | |
| 13438 | |
| 13439 | halAggrAddTsReq.aggrAddTsParam.tspec[i].nomMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13440 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usNomMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13441 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13442 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMaxMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13443 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13444 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13445 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13446 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13447 | halAggrAddTsReq.aggrAddTsParam.tspec[i].inactInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13448 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uInactInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13449 | halAggrAddTsReq.aggrAddTsParam.tspec[i].suspendInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13450 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSuspendInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13451 | halAggrAddTsReq.aggrAddTsParam.tspec[i].svcStartTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13452 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSvcStartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13453 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13454 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13455 | halAggrAddTsReq.aggrAddTsParam.tspec[i].meanDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13456 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMeanDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13457 | halAggrAddTsReq.aggrAddTsParam.tspec[i].peakDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13458 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uPeakDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13459 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxBurstSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13460 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxBurstSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13461 | halAggrAddTsReq.aggrAddTsParam.tspec[i].delayBound = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13462 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uDelayBound; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13463 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minPhyRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13464 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinPhyRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13465 | halAggrAddTsReq.aggrAddTsParam.tspec[i].surplusBw = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13466 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usSurplusBw; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13467 | halAggrAddTsReq.aggrAddTsParam.tspec[i].mediumTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13468 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMediumTime; |
| 13469 | } |
| 13470 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13471 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13472 | &halAggrAddTsReq, |
| 13473 | sizeof(halAggrAddTsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13474 | |
| 13475 | pWDICtx->wdiReqStatusCB = pwdiAggrAddTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13476 | pWDICtx->pReqStatusUserData = pwdiAggrAddTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13477 | |
| 13478 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13479 | Send Add TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13480 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13481 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13482 | wdiAggrAddTSRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13483 | WDI_AGGR_ADD_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13484 | }/*WDI_ProcessAggrAddTSpecReq*/ |
| 13485 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 13486 | |
| 13487 | /** |
| 13488 | @brief Process Shutdown Request function (called when Main FSM |
| 13489 | allows it) |
| 13490 | |
| 13491 | @param pWDICtx: pointer to the WLAN DAL context |
| 13492 | pEventData: pointer to the event information structure |
| 13493 | |
| 13494 | @see |
| 13495 | @return Result of the function call |
| 13496 | */ |
| 13497 | WDI_Status |
| 13498 | WDI_ProcessShutdownReq |
| 13499 | ( |
| 13500 | WDI_ControlBlockType* pWDICtx, |
| 13501 | WDI_EventInfoType* pEventData |
| 13502 | ) |
| 13503 | { |
| 13504 | wpt_status wptStatus; |
| 13505 | |
| 13506 | |
| 13507 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13508 | |
| 13509 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13510 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13511 | -------------------------------------------------------------------------*/ |
| 13512 | if ( NULL == pEventData ) |
| 13513 | { |
| 13514 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13515 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13516 | WDI_ASSERT(0); |
| 13517 | return WDI_STATUS_E_FAILURE; |
| 13518 | } |
| 13519 | |
| 13520 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 13521 | |
| 13522 | |
| 13523 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 13524 | /*! TO DO: stop the data services */ |
| 13525 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 13526 | { |
| 13527 | /*Stop the STA Table !UT- check this logic again |
| 13528 | It is safer to do it here than on the response - because a stop is imminent*/ |
| 13529 | WDI_STATableStop(pWDICtx); |
| 13530 | |
| 13531 | /* Stop Transport Driver, DXE */ |
| 13532 | WDTS_Stop(pWDICtx); |
| 13533 | } |
| 13534 | |
| 13535 | /*Clear all pending request*/ |
| 13536 | WDI_ClearPendingRequests(pWDICtx); |
| 13537 | /* Close Data transport*/ |
| 13538 | /* FTM mode does not open Data Path */ |
| 13539 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 13540 | { |
| 13541 | WDTS_Close(pWDICtx); |
| 13542 | } |
| 13543 | /*Close the STA Table !UT- check this logic again*/ |
| 13544 | WDI_STATableClose(pWDICtx); |
| 13545 | /*close the PAL */ |
| 13546 | wptStatus = wpalClose(pWDICtx->pPALContext); |
| 13547 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 13548 | { |
| 13549 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13550 | "Failed to wpal Close %d", wptStatus); |
| 13551 | WDI_ASSERT(0); |
| 13552 | } |
| 13553 | |
| 13554 | /*Transition back to init state*/ |
| 13555 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
| 13556 | |
| 13557 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13558 | |
| 13559 | /*Make sure the expected state is properly defaulted to Init*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13560 | pWDICtx->ucExpectedStateTransition = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13561 | |
| 13562 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13563 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13564 | }/*WDI_ProcessShutdownReq*/ |
| 13565 | |
| 13566 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13567 | Main DAL Control Path Response Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13568 | ========================================================================*/ |
| 13569 | |
| 13570 | /** |
| 13571 | @brief Process Start Response function (called when a response |
| 13572 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13573 | |
| 13574 | @param pWDICtx: pointer to the WLAN DAL context |
| 13575 | pEventData: pointer to the event information structure |
| 13576 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13577 | @see |
| 13578 | @return Result of the function call |
| 13579 | */ |
| 13580 | WDI_Status |
| 13581 | WDI_ProcessStartRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13582 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13583 | WDI_ControlBlockType* pWDICtx, |
| 13584 | WDI_EventInfoType* pEventData |
| 13585 | ) |
| 13586 | { |
| 13587 | WDI_StartRspParamsType wdiRspParams; |
| 13588 | WDI_StartRspCb wdiStartRspCb = NULL; |
| 13589 | |
| 13590 | tHalMacStartRspParams* startRspParams; |
| 13591 | |
| 13592 | #ifndef HAL_SELF_STA_PER_BSS |
| 13593 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 13594 | #endif |
| 13595 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13596 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13597 | wdiStartRspCb = (WDI_StartRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13598 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13599 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13600 | -------------------------------------------------------------------------*/ |
| 13601 | if (( NULL == pEventData ) || |
| 13602 | ( NULL == pEventData->pEventData) || |
| 13603 | ( NULL == wdiStartRspCb )) |
| 13604 | { |
| 13605 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13606 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13607 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13608 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13609 | } |
| 13610 | |
| 13611 | /*------------------------------------------------------------------------- |
| 13612 | Extract response and send it to UMAC |
| 13613 | -------------------------------------------------------------------------*/ |
| 13614 | if ( sizeof(tHalMacStartRspParams) > pEventData->uEventDataSize ) |
| 13615 | { |
| 13616 | // not enough data was received |
| 13617 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 13618 | "Invalid response length in Start Resp Expect %x Rcvd %x", |
| 13619 | sizeof(tHalMacStartRspParams), pEventData->uEventDataSize); |
| 13620 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13621 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13622 | } |
| 13623 | |
| 13624 | /*------------------------------------------------------------------------- |
| 13625 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13626 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13627 | -------------------------------------------------------------------------*/ |
| 13628 | startRspParams = (tHalMacStartRspParams *) pEventData->pEventData; |
| 13629 | |
| 13630 | wdiRspParams.ucMaxBssids = startRspParams->ucMaxBssids; |
| 13631 | wdiRspParams.ucMaxStations = startRspParams->ucMaxStations; |
| 13632 | wdiRspParams.wlanCompiledVersion.major = WLAN_HAL_VER_MAJOR; |
| 13633 | wdiRspParams.wlanCompiledVersion.minor = WLAN_HAL_VER_MINOR; |
| 13634 | wdiRspParams.wlanCompiledVersion.version = WLAN_HAL_VER_VERSION; |
| 13635 | wdiRspParams.wlanCompiledVersion.revision = WLAN_HAL_VER_REVISION; |
| 13636 | wdiRspParams.wlanReportedVersion.major = |
| 13637 | startRspParams->wcnssWlanVersion.major; |
| 13638 | wdiRspParams.wlanReportedVersion.minor = |
| 13639 | startRspParams->wcnssWlanVersion.minor; |
| 13640 | wdiRspParams.wlanReportedVersion.version = |
| 13641 | startRspParams->wcnssWlanVersion.version; |
| 13642 | wdiRspParams.wlanReportedVersion.revision = |
| 13643 | startRspParams->wcnssWlanVersion.revision; |
| 13644 | wpalMemoryCopy(wdiRspParams.wcnssSoftwareVersion, |
| 13645 | startRspParams->wcnssCrmVersionString, |
| 13646 | sizeof(wdiRspParams.wcnssSoftwareVersion)); |
| 13647 | wpalMemoryCopy(wdiRspParams.wcnssHardwareVersion, |
| 13648 | startRspParams->wcnssWlanVersionString, |
| 13649 | sizeof(wdiRspParams.wcnssHardwareVersion)); |
| 13650 | wdiRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(startRspParams->status); |
| 13651 | |
| 13652 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 13653 | if ( WDI_STATUS_SUCCESS == wdiRspParams.wdiStatus ) |
| 13654 | { |
| 13655 | pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST; |
| 13656 | |
| 13657 | /*Cache the start response for further use*/ |
| 13658 | wpalMemoryCopy( &pWDICtx->wdiCachedStartRspParams , |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13659 | &wdiRspParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13660 | sizeof(pWDICtx->wdiCachedStartRspParams)); |
| 13661 | |
| 13662 | } |
| 13663 | else |
| 13664 | { |
| 13665 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13666 | "Failed to start device with status %s(%d)", |
| 13667 | WDI_getHALStatusMsgString(startRspParams->status), |
| 13668 | startRspParams->status); |
| 13669 | |
| 13670 | /*Set the expected state transition to stopped - because the start has |
| 13671 | failed*/ |
| 13672 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 13673 | |
| 13674 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13675 | |
| 13676 | /*Notify UMAC*/ |
| 13677 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13678 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13679 | WDI_DetectedDeviceError(pWDICtx, wdiRspParams.wdiStatus); |
| 13680 | |
| 13681 | /*Although the response is an error - it was processed by our function |
| 13682 | so as far as the caller is concerned this is a succesful reponse processing*/ |
| 13683 | return WDI_STATUS_SUCCESS; |
| 13684 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13685 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13686 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13687 | |
| 13688 | if(eDRIVER_TYPE_MFG == pWDICtx->driverMode) |
| 13689 | { |
| 13690 | /* FTM mode does not need to execute below */ |
| 13691 | /* Notify UMAC */ |
| 13692 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
| 13693 | return WDI_STATUS_SUCCESS; |
| 13694 | } |
| 13695 | |
| 13696 | /* START the Data transport */ |
| 13697 | WDTS_startTransport(pWDICtx); |
| 13698 | |
| 13699 | /*Start the STA Table !- check this logic again*/ |
| 13700 | WDI_STATableStart(pWDICtx); |
| 13701 | |
| 13702 | #ifndef HAL_SELF_STA_PER_BSS |
| 13703 | /* Store the Self STA Index */ |
| 13704 | pWDICtx->ucSelfStaId = halStartRspMsg.startRspParams.selfStaIdx; |
| 13705 | |
| 13706 | pWDICtx->usSelfStaDpuId = wdiRspParams.usSelfStaDpuId; |
| 13707 | wpalMemoryCopy(pWDICtx->macSelfSta, wdiRspParams.macSelfSta, |
| 13708 | WDI_MAC_ADDR_LEN); |
| 13709 | |
| 13710 | /* At this point add the self-STA */ |
| 13711 | |
| 13712 | /*! TO DO: wdiAddSTAParam.bcastMgmtDpuSignature */ |
| 13713 | /* !TO DO: wdiAddSTAParam.bcastDpuSignature */ |
| 13714 | /*! TO DO: wdiAddSTAParam.dpuSig */ |
| 13715 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 13716 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 13717 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 13718 | |
| 13719 | //all DPU indices are the same for self STA |
| 13720 | wdiAddSTAParam.bcastDpuIndex = wdiRspParams.usSelfStaDpuId; |
| 13721 | wdiAddSTAParam.bcastMgmtDpuIndex = wdiRspParams.usSelfStaDpuId; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 13722 | wdiAddSTAParam.dpuIndex = wdiRspParams.usSelfStaDpuId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13723 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiRspParams.macSelfSta, |
| 13724 | WDI_MAC_ADDR_LEN); |
| 13725 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */ |
| 13726 | wdiAddSTAParam.ucSTAIdx = halStartRspMsg.startRspParams.selfStaIdx; |
| 13727 | |
| 13728 | /* Note: Since we don't get an explicit config STA request for self STA, we |
| 13729 | add the self STA upon receiving the Start response message. But the |
| 13730 | self STA entry in the table is deleted when WDI gets an explicit delete STA |
| 13731 | request */ |
| 13732 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 13733 | #endif |
| 13734 | |
| 13735 | /*Notify UMAC*/ |
| 13736 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
| 13737 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13738 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13739 | }/*WDI_ProcessStartRsp*/ |
| 13740 | |
| 13741 | |
| 13742 | /** |
| 13743 | @brief Process Stop Response function (called when a response |
| 13744 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13745 | |
| 13746 | @param pWDICtx: pointer to the WLAN DAL context |
| 13747 | pEventData: pointer to the event information structure |
| 13748 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13749 | @see |
| 13750 | @return Result of the function call |
| 13751 | */ |
| 13752 | WDI_Status |
| 13753 | WDI_ProcessStopRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13754 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13755 | WDI_ControlBlockType* pWDICtx, |
| 13756 | WDI_EventInfoType* pEventData |
| 13757 | ) |
| 13758 | { |
| 13759 | WDI_Status wdiStatus; |
| 13760 | WDI_StopRspCb wdiStopRspCb = NULL; |
| 13761 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13762 | tHalMacStopRspMsg halMacStopRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13763 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13764 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13765 | wdiStopRspCb = (WDI_StopRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13766 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13767 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13768 | -------------------------------------------------------------------------*/ |
| 13769 | if (( NULL == pEventData ) || |
| 13770 | ( NULL == pEventData->pEventData) || |
| 13771 | ( NULL == wdiStopRspCb )) |
| 13772 | { |
| 13773 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13774 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13775 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13776 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13777 | } |
| 13778 | |
| 13779 | /*------------------------------------------------------------------------- |
| 13780 | Extract response and send it to UMAC |
| 13781 | -------------------------------------------------------------------------*/ |
| 13782 | if ( sizeof(halMacStopRspMsg) < pEventData->uEventDataSize ) |
| 13783 | { |
| 13784 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13785 | "Invalid response length in Stop Resp %x %x", |
| 13786 | pEventData->uEventDataSize); |
| 13787 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13788 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13789 | } |
| 13790 | |
| 13791 | /*------------------------------------------------------------------------- |
| 13792 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13793 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13794 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13795 | wpalMemoryCopy( &halMacStopRspMsg.stopRspParams, |
| 13796 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13797 | sizeof(halMacStopRspMsg.stopRspParams)); |
| 13798 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13799 | wdiStatus = WDI_HAL_2_WDI_STATUS(halMacStopRspMsg.stopRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13800 | |
| 13801 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 13802 | |
| 13803 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13804 | Check to see if the stop went OK |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13805 | --------------------------------------------------------------------------*/ |
| 13806 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 13807 | { |
| 13808 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13809 | "Failed to stop the device with status %s (%d)", |
| 13810 | WDI_getHALStatusMsgString(halMacStopRspMsg.stopRspParams.status), |
| 13811 | halMacStopRspMsg.stopRspParams.status); |
| 13812 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13813 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 13814 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13815 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13816 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13817 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13818 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13819 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 13820 | |
| 13821 | /*Transition now as WDI may get preempted imediately after it sends |
| 13822 | up the Stop Response and it will not get to process the state transition |
| 13823 | from Main Rsp function*/ |
| 13824 | WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition); |
| 13825 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13826 | |
| 13827 | /*! TO DO: - STOP the Data transport */ |
| 13828 | |
| 13829 | /*Notify UMAC*/ |
| 13830 | wdiStopRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 13831 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13832 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13833 | }/*WDI_ProcessStopRsp*/ |
| 13834 | |
| 13835 | /** |
| 13836 | @brief Process Close Rsp function (called when a response |
| 13837 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13838 | |
| 13839 | @param pWDICtx: pointer to the WLAN DAL context |
| 13840 | pEventData: pointer to the event information structure |
| 13841 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13842 | @see |
| 13843 | @return Result of the function call |
| 13844 | */ |
| 13845 | WDI_Status |
| 13846 | WDI_ProcessCloseRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13847 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13848 | WDI_ControlBlockType* pWDICtx, |
| 13849 | WDI_EventInfoType* pEventData |
| 13850 | ) |
| 13851 | { |
| 13852 | /*There is no close response comming from HAL - function just kept for |
| 13853 | simmetry */ |
| 13854 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13855 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13856 | }/*WDI_ProcessCloseRsp*/ |
| 13857 | |
| 13858 | |
| 13859 | /*============================================================================ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13860 | SCAN RESPONSE PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13861 | ============================================================================*/ |
| 13862 | |
| 13863 | /** |
| 13864 | @brief Process Init Scan Rsp function (called when a response |
| 13865 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13866 | |
| 13867 | @param pWDICtx: pointer to the WLAN DAL context |
| 13868 | pEventData: pointer to the event information structure |
| 13869 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13870 | @see |
| 13871 | @return Result of the function call |
| 13872 | */ |
| 13873 | WDI_Status |
| 13874 | WDI_ProcessInitScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13875 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13876 | WDI_ControlBlockType* pWDICtx, |
| 13877 | WDI_EventInfoType* pEventData |
| 13878 | ) |
| 13879 | { |
| 13880 | WDI_Status wdiStatus; |
| 13881 | WDI_InitScanRspCb wdiInitScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13882 | tHalInitScanRspMsg halInitScanRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13883 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13884 | |
| 13885 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13886 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13887 | -------------------------------------------------------------------------*/ |
| 13888 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 13889 | ( NULL == pEventData->pEventData)) |
| 13890 | { |
| 13891 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13892 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13893 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13894 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13895 | } |
| 13896 | |
| 13897 | wdiInitScanRspCb = (WDI_InitScanRspCb)pWDICtx->pfncRspCB; |
| 13898 | if( NULL == wdiInitScanRspCb) |
| 13899 | { |
| 13900 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13901 | "%s: call back function is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13902 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13903 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13904 | } |
| 13905 | |
| 13906 | /*------------------------------------------------------------------------- |
| 13907 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13908 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13909 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13910 | wpalMemoryCopy( &halInitScanRspMsg.initScanRspParams, |
| 13911 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13912 | sizeof(halInitScanRspMsg.initScanRspParams)); |
| 13913 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13914 | wdiStatus = WDI_HAL_2_WDI_STATUS(halInitScanRspMsg.initScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13915 | |
| 13916 | if ( pWDICtx->bInBmps ) |
| 13917 | { |
| 13918 | // notify DTS that we are entering Full power |
| 13919 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 13920 | } |
| 13921 | |
| 13922 | /*Notify UMAC*/ |
| 13923 | wdiInitScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 13924 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13925 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13926 | }/*WDI_ProcessInitScanRsp*/ |
| 13927 | |
| 13928 | |
| 13929 | /** |
| 13930 | @brief Process Start Scan Rsp function (called when a response |
| 13931 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13932 | |
| 13933 | @param pWDICtx: pointer to the WLAN DAL context |
| 13934 | pEventData: pointer to the event information structure |
| 13935 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13936 | @see |
| 13937 | @return Result of the function call |
| 13938 | */ |
| 13939 | WDI_Status |
| 13940 | WDI_ProcessStartScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13941 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13942 | WDI_ControlBlockType* pWDICtx, |
| 13943 | WDI_EventInfoType* pEventData |
| 13944 | ) |
| 13945 | { |
| 13946 | WDI_StartScanRspParamsType wdiStartScanParams; |
| 13947 | WDI_StartScanRspCb wdiStartScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13948 | |
| 13949 | tHalStartScanRspMsg halStartScanRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13950 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13951 | |
| 13952 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13953 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13954 | -------------------------------------------------------------------------*/ |
| 13955 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 13956 | ( NULL == pEventData->pEventData)) |
| 13957 | { |
| 13958 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13959 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13960 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13961 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13962 | } |
| 13963 | |
| 13964 | wdiStartScanRspCb = (WDI_StartScanRspCb)pWDICtx->pfncRspCB; |
| 13965 | if( NULL == wdiStartScanRspCb) |
| 13966 | { |
| 13967 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13968 | "%s: call back function is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13969 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13970 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13971 | } |
| 13972 | |
| 13973 | /*------------------------------------------------------------------------- |
| 13974 | Extract response and send it to UMAC |
| 13975 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13976 | wpalMemoryCopy( &halStartScanRspMsg.startScanRspParams, |
| 13977 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13978 | sizeof(halStartScanRspMsg.startScanRspParams)); |
| 13979 | |
| 13980 | wdiStartScanParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 13981 | halStartScanRspMsg.startScanRspParams.status); |
| 13982 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13983 | wdiStartScanParams.ucTxMgmtPower = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13984 | halStartScanRspMsg.startScanRspParams.txMgmtPower; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13985 | wpalMemoryCopy( wdiStartScanParams.aStartTSF, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13986 | halStartScanRspMsg.startScanRspParams.startTSF, |
| 13987 | 2); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13988 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13989 | |
| 13990 | if ( eHAL_STATUS_SUCCESS != halStartScanRspMsg.startScanRspParams.status ) |
| 13991 | { |
| 13992 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13993 | "Start scan failed with status %s (%d)", |
| 13994 | WDI_getHALStatusMsgString(halStartScanRspMsg.startScanRspParams.status), |
| 13995 | halStartScanRspMsg.startScanRspParams.status); |
| 13996 | /* send the status to UMAC, don't return from here*/ |
| 13997 | } |
| 13998 | |
| 13999 | /*Notify UMAC*/ |
| 14000 | wdiStartScanRspCb( &wdiStartScanParams, pWDICtx->pRspCBUserData); |
| 14001 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14002 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14003 | |
| 14004 | }/*WDI_ProcessStartScanRsp*/ |
| 14005 | |
| 14006 | |
| 14007 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14008 | @brief Process End Scan Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14009 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14010 | |
| 14011 | @param pWDICtx: pointer to the WLAN DAL context |
| 14012 | pEventData: pointer to the event information structure |
| 14013 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14014 | @see |
| 14015 | @return Result of the function call |
| 14016 | */ |
| 14017 | WDI_Status |
| 14018 | WDI_ProcessEndScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14019 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14020 | WDI_ControlBlockType* pWDICtx, |
| 14021 | WDI_EventInfoType* pEventData |
| 14022 | ) |
| 14023 | { |
| 14024 | WDI_Status wdiStatus; |
| 14025 | tHalEndScanRspMsg halEndScanRspMsg; |
| 14026 | WDI_EndScanRspCb wdiEndScanRspCb; |
| 14027 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14028 | |
| 14029 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14030 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14031 | -------------------------------------------------------------------------*/ |
| 14032 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14033 | ( NULL == pEventData->pEventData)) |
| 14034 | { |
| 14035 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14036 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14037 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14038 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14039 | } |
| 14040 | |
| 14041 | wdiEndScanRspCb = (WDI_EndScanRspCb)pWDICtx->pfncRspCB; |
| 14042 | |
| 14043 | /*------------------------------------------------------------------------- |
| 14044 | Extract response and send it to UMAC |
| 14045 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14046 | wpalMemoryCopy( &halEndScanRspMsg.endScanRspParams, |
| 14047 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14048 | sizeof(halEndScanRspMsg.endScanRspParams)); |
| 14049 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14050 | wdiStatus = WDI_HAL_2_WDI_STATUS(halEndScanRspMsg.endScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14051 | |
| 14052 | if ( eHAL_STATUS_SUCCESS != halEndScanRspMsg.endScanRspParams.status ) |
| 14053 | { |
| 14054 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14055 | "End Scan failed with status %s (%d )", |
| 14056 | WDI_getHALStatusMsgString(halEndScanRspMsg.endScanRspParams.status), |
| 14057 | halEndScanRspMsg.endScanRspParams.status); |
| 14058 | /* send the status to UMAC, don't return from here*/ |
| 14059 | } |
| 14060 | |
| 14061 | /*Notify UMAC*/ |
| 14062 | wdiEndScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14063 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14064 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14065 | }/*WDI_ProcessEndScanRsp*/ |
| 14066 | |
| 14067 | |
| 14068 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14069 | @brief Process Finish Scan Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14070 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14071 | |
| 14072 | @param pWDICtx: pointer to the WLAN DAL context |
| 14073 | pEventData: pointer to the event information structure |
| 14074 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14075 | @see |
| 14076 | @return Result of the function call |
| 14077 | */ |
| 14078 | WDI_Status |
| 14079 | WDI_ProcessFinishScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14080 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14081 | WDI_ControlBlockType* pWDICtx, |
| 14082 | WDI_EventInfoType* pEventData |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14083 | ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14084 | { |
| 14085 | WDI_Status wdiStatus; |
| 14086 | WDI_FinishScanRspCb wdiFinishScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14087 | |
| 14088 | tHalFinishScanRspMsg halFinishScanRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14089 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14090 | |
| 14091 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14092 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14093 | -------------------------------------------------------------------------*/ |
| 14094 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14095 | ( NULL == pEventData->pEventData)) |
| 14096 | { |
| 14097 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14098 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14099 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14100 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14101 | } |
| 14102 | |
| 14103 | wdiFinishScanRspCb = (WDI_FinishScanRspCb)pWDICtx->pfncRspCB; |
| 14104 | |
| 14105 | /*------------------------------------------------------------------------- |
| 14106 | Extract response and send it to UMAC |
| 14107 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14108 | wpalMemoryCopy( (void *)&halFinishScanRspMsg.finishScanRspParams.status, |
| 14109 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14110 | sizeof(halFinishScanRspMsg.finishScanRspParams.status)); |
| 14111 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14112 | wdiStatus = WDI_HAL_2_WDI_STATUS(halFinishScanRspMsg.finishScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14113 | |
| 14114 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14115 | "Finish scan response reported status: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14116 | halFinishScanRspMsg.finishScanRspParams.status); |
| 14117 | |
| 14118 | if (( eHAL_STATUS_SUCCESS != halFinishScanRspMsg.finishScanRspParams.status )&& |
| 14119 | ( eHAL_STATUS_NOTIFY_BSS_FAIL != halFinishScanRspMsg.finishScanRspParams.status )) |
| 14120 | { |
| 14121 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14122 | "Finish Scan failed with status %s (%d)", |
| 14123 | WDI_getHALStatusMsgString(halFinishScanRspMsg.finishScanRspParams.status), |
| 14124 | halFinishScanRspMsg.finishScanRspParams.status); |
| 14125 | /* send the status to UMAC, don't return from here*/ |
| 14126 | } |
| 14127 | |
| 14128 | /*Notify UMAC*/ |
| 14129 | wdiFinishScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14130 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14131 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14132 | }/*WDI_ProcessFinishScanRsp*/ |
| 14133 | |
| 14134 | /** |
| 14135 | @brief Process Join Response function (called when a response |
| 14136 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14137 | |
| 14138 | @param pWDICtx: pointer to the WLAN DAL context |
| 14139 | pEventData: pointer to the event information structure |
| 14140 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14141 | @see |
| 14142 | @return Result of the function call |
| 14143 | */ |
| 14144 | WDI_Status |
| 14145 | WDI_ProcessJoinRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14146 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14147 | WDI_ControlBlockType* pWDICtx, |
| 14148 | WDI_EventInfoType* pEventData |
| 14149 | ) |
| 14150 | { |
| 14151 | WDI_Status wdiStatus; |
| 14152 | WDI_JoinRspCb wdiJoinRspCb; |
| 14153 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14154 | |
| 14155 | tHalJoinRspMsg halJoinRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14156 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14157 | |
| 14158 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14159 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14160 | -------------------------------------------------------------------------*/ |
| 14161 | if (( NULL == pWDICtx ) || |
| 14162 | ( NULL == pWDICtx->pfncRspCB ) || |
| 14163 | ( NULL == pEventData ) || |
| 14164 | ( NULL == pEventData->pEventData)) |
| 14165 | { |
| 14166 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14167 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14168 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14169 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14170 | } |
| 14171 | |
| 14172 | wdiJoinRspCb = (WDI_JoinRspCb)pWDICtx->pfncRspCB; |
| 14173 | |
| 14174 | /*------------------------------------------------------------------------- |
| 14175 | Extract response and send it to UMAC |
| 14176 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14177 | wpalMemoryCopy( &halJoinRspMsg.joinRspParams, |
| 14178 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14179 | sizeof(halJoinRspMsg.joinRspParams)); |
| 14180 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14181 | wdiStatus = WDI_HAL_2_WDI_STATUS(halJoinRspMsg.joinRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14182 | |
| 14183 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14184 | |
| 14185 | /*----------------------------------------------------------------------- |
| 14186 | Join response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14187 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14188 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14189 | if (( !WDI_VALID_SESSION_IDX(pWDICtx->ucCurrentBSSSesIdx )) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14190 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 14191 | { |
| 14192 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14193 | "%s: Association sequence for this BSS does not yet exist (bssIdx %d) or " |
| 14194 | "association no longer in progress %d - mysterious HAL response", |
| 14195 | __func__, pWDICtx->ucCurrentBSSSesIdx, pWDICtx->bAssociationInProgress); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14196 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14197 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14198 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14199 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14200 | } |
| 14201 | |
| 14202 | pBSSSes = &pWDICtx->aBSSSessions[pWDICtx->ucCurrentBSSSesIdx]; |
| 14203 | |
| 14204 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14205 | Join Response is only allowed in init state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14206 | -----------------------------------------------------------------------*/ |
| 14207 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 14208 | { |
| 14209 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14210 | "Join only allowed in Joining state - failure state is %d " |
| 14211 | "strange HAL response", pBSSSes->wdiAssocState); |
| 14212 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14213 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14214 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14215 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14216 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14217 | } |
| 14218 | |
| 14219 | |
| 14220 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14221 | If assoc has failed the current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14222 | -----------------------------------------------------------------------*/ |
| 14223 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 14224 | { |
| 14225 | /*Association was failed by HAL - remove session*/ |
| 14226 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 14227 | |
| 14228 | /*Association no longer in progress */ |
| 14229 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 14230 | |
| 14231 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 14232 | WDI_DequeueAssocRequest(pWDICtx); |
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 | else |
| 14236 | { |
| 14237 | /*Transition to state Joining - this may be redundant as we are supposed |
| 14238 | to be in this state already - but just to be safe*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14239 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14240 | } |
| 14241 | |
| 14242 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14243 | |
| 14244 | /*Notify UMAC*/ |
| 14245 | wdiJoinRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14246 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14247 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14248 | }/*WDI_ProcessJoinRsp*/ |
| 14249 | |
| 14250 | |
| 14251 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14252 | @brief Process Config BSS Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14253 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14254 | |
| 14255 | @param pWDICtx: pointer to the WLAN DAL context |
| 14256 | pEventData: pointer to the event information structure |
| 14257 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14258 | @see |
| 14259 | @return Result of the function call |
| 14260 | */ |
| 14261 | WDI_Status |
| 14262 | WDI_ProcessConfigBSSRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14263 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14264 | WDI_ControlBlockType* pWDICtx, |
| 14265 | WDI_EventInfoType* pEventData |
| 14266 | ) |
| 14267 | { |
| 14268 | WDI_ConfigBSSRspParamsType wdiConfigBSSParams; |
| 14269 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14270 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14271 | WDI_BSSSessionType* pBSSSes = NULL; |
| 14272 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14273 | tConfigBssRspMsg halConfigBssRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14274 | WDI_AddStaParams wdiBcastAddSTAParam = {0}; |
| 14275 | WDI_AddStaParams wdiAddSTAParam = {0}; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14276 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14277 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14278 | |
| 14279 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14280 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14281 | -------------------------------------------------------------------------*/ |
| 14282 | if (( NULL == pEventData ) || |
| 14283 | ( NULL == pEventData->pEventData)) |
| 14284 | { |
| 14285 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14286 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14287 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14288 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14289 | } |
| 14290 | |
| 14291 | wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pWDICtx->pfncRspCB; |
| 14292 | |
| 14293 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14294 | Extract response and send it to UMAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14295 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14296 | wpalMemoryCopy( &halConfigBssRspMsg.configBssRspParams, |
| 14297 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14298 | sizeof(halConfigBssRspMsg.configBssRspParams)); |
| 14299 | |
| 14300 | wdiConfigBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 14301 | halConfigBssRspMsg.configBssRspParams.status); |
| 14302 | if(WDI_STATUS_SUCCESS == wdiConfigBSSParams.wdiStatus) |
| 14303 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14304 | wpalMemoryCopy( wdiConfigBSSParams.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14305 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.macBSSID, |
| 14306 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14307 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14308 | wdiConfigBSSParams.ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14309 | |
| 14310 | wdiConfigBSSParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14311 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14312 | |
| 14313 | wdiConfigBSSParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14314 | halConfigBssRspMsg.configBssRspParams.ucastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14315 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14316 | wdiConfigBSSParams.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14317 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14318 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14319 | wdiConfigBSSParams.ucTxMgmtPower = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14320 | halConfigBssRspMsg.configBssRspParams.txMgmtPower; |
| 14321 | #endif |
| 14322 | wpalMemoryCopy( wdiConfigBSSParams.macSTA, |
| 14323 | halConfigBssRspMsg.configBssRspParams.staMac, |
| 14324 | WDI_MAC_ADDR_LEN ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14325 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14326 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14327 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14328 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14329 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14330 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 14331 | wdiConfigBSSParams.macBSSID, |
| 14332 | &pBSSSes); |
| 14333 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14334 | /*----------------------------------------------------------------------- |
| 14335 | Config BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14336 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14337 | -----------------------------------------------------------------------*/ |
| 14338 | if ( NULL == pBSSSes ) |
| 14339 | { |
| 14340 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14341 | "Association sequence for this BSS does not yet exist " |
| 14342 | "- mysterious HAL response"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14343 | |
| 14344 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14345 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14346 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14347 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14348 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14349 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14350 | /*Save data for this BSS*/ |
| 14351 | pBSSSes->wdiBssType = pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiBSSType; |
| 14352 | pBSSSes->ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14353 | pBSSSes->bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14354 | halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14355 | pBSSSes->bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14356 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14357 | pBSSSes->bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14358 | halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14359 | pBSSSes->bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14360 | halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14361 | pBSSSes->ucRmfEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14362 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled; |
| 14363 | pBSSSes->bcastStaIdx = |
| 14364 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14365 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14366 | /* !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] | 14367 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14368 | /*------------------------------------------------------------------------- |
| 14369 | Add Peer STA |
| 14370 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14371 | wdiAddSTAParam.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14372 | wdiAddSTAParam.dpuIndex = halConfigBssRspMsg.configBssRspParams.dpuDescIndx; |
| 14373 | wdiAddSTAParam.dpuSig = halConfigBssRspMsg.configBssRspParams.ucastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14374 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14375 | /*This info can be retrieved from the cached initial request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14376 | wdiAddSTAParam.ucWmmEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14377 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucWMMEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14378 | wdiAddSTAParam.ucHTCapable = |
| 14379 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucHTCapable; |
| 14380 | wdiAddSTAParam.ucStaType = |
| 14381 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.wdiSTAType; |
| 14382 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14383 | /* MAC Address of STA */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14384 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, |
| 14385 | halConfigBssRspMsg.configBssRspParams.staMac, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14386 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14387 | |
| 14388 | wpalMemoryCopy(wdiAddSTAParam.macBSSID, |
| 14389 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.macBSSID , |
| 14390 | WDI_MAC_ADDR_LEN); |
| 14391 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14392 | /*Add BSS specific parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14393 | wdiAddSTAParam.bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14394 | halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14395 | wdiAddSTAParam.bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14396 | halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14397 | wdiAddSTAParam.bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14398 | halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14399 | wdiAddSTAParam.bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14400 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14401 | wdiAddSTAParam.ucRmfEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14402 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14403 | wdiAddSTAParam.ucBSSIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14404 | halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14405 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14406 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 14407 | "Add STA to the table index: %d", wdiAddSTAParam.ucSTAIdx ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14408 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14409 | WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 14410 | /*------------------------------------------------------------------------- |
| 14411 | Add Broadcast STA only in AP mode |
| 14412 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14413 | if( pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucOperMode == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14414 | WDI_BSS_OPERATIONAL_MODE_AP ) |
| 14415 | { |
| 14416 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 14417 | "Add BCAST STA to table for index: %d", |
| 14418 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14419 | |
| 14420 | wpalMemoryCopy( &wdiBcastAddSTAParam, &wdiAddSTAParam, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14421 | sizeof(WDI_AddStaParams) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14422 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14423 | WDI_AddBcastSTAtoSTATable( pWDICtx, &wdiBcastAddSTAParam, |
| 14424 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx ); |
| 14425 | } |
| 14426 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14427 | } |
| 14428 | else |
| 14429 | { |
| 14430 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14431 | "Config BSS RSP failed with status : %s(%d)", |
| 14432 | WDI_getHALStatusMsgString( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14433 | halConfigBssRspMsg.configBssRspParams.status), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14434 | halConfigBssRspMsg.configBssRspParams.status); |
| 14435 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14436 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14437 | /*Association was failed by HAL - remove session*/ |
| 14438 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 14439 | |
| 14440 | /*Association no longer in progress */ |
| 14441 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 14442 | |
| 14443 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 14444 | WDI_DequeueAssocRequest(pWDICtx); |
| 14445 | |
| 14446 | } |
| 14447 | |
| 14448 | /*Notify UMAC*/ |
| 14449 | wdiConfigBSSRspCb( &wdiConfigBSSParams, pWDICtx->pRspCBUserData); |
| 14450 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14451 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14452 | }/*WDI_ProcessConfigBSSRsp*/ |
| 14453 | |
| 14454 | |
| 14455 | /** |
| 14456 | @brief Process Del BSS Response function (called when a response |
| 14457 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14458 | |
| 14459 | @param pWDICtx: pointer to the WLAN DAL context |
| 14460 | pEventData: pointer to the event information structure |
| 14461 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14462 | @see |
| 14463 | @return Result of the function call |
| 14464 | */ |
| 14465 | WDI_Status |
| 14466 | WDI_ProcessDelBSSRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14467 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14468 | WDI_ControlBlockType* pWDICtx, |
| 14469 | WDI_EventInfoType* pEventData |
| 14470 | ) |
| 14471 | { |
| 14472 | WDI_DelBSSRspParamsType wdiDelBSSParams; |
| 14473 | WDI_DelBSSRspCb wdiDelBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14474 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14475 | WDI_BSSSessionType* pBSSSes = NULL; |
| 14476 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14477 | tDeleteBssRspMsg halDelBssRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14478 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14479 | |
| 14480 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14481 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14482 | -------------------------------------------------------------------------*/ |
| 14483 | if (( NULL == pEventData ) || |
| 14484 | ( NULL == pEventData->pEventData)) |
| 14485 | { |
| 14486 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14487 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14488 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14489 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14490 | } |
| 14491 | |
| 14492 | wdiDelBSSRspCb = (WDI_DelBSSRspCb)pWDICtx->pfncRspCB; |
| 14493 | |
| 14494 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14495 | Extract response and send it to UMAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14496 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14497 | wpalMemoryCopy( &halDelBssRspMsg.deleteBssRspParams, |
| 14498 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14499 | sizeof(halDelBssRspMsg.deleteBssRspParams)); |
| 14500 | |
| 14501 | |
| 14502 | wdiDelBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14503 | halDelBssRspMsg.deleteBssRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14504 | |
| 14505 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14506 | |
| 14507 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14508 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14509 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14510 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 14511 | halDelBssRspMsg.deleteBssRspParams.bssIdx, |
| 14512 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14513 | |
| 14514 | /*----------------------------------------------------------------------- |
| 14515 | Del BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14516 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14517 | -----------------------------------------------------------------------*/ |
| 14518 | if ( NULL == pBSSSes ) |
| 14519 | { |
| 14520 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14521 | "Association sequence for this BSS does not yet exist or " |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame^] | 14522 | "association no longer in progress - mysterious HAL response"); |
| 14523 | |
| 14524 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14525 | |
| 14526 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14527 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14528 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame^] | 14529 | |
| 14530 | /*Extract BSSID for the response to UMAC*/ |
| 14531 | wpalMemoryCopy(wdiDelBSSParams.macBSSID, |
| 14532 | pBSSSes->macBSSID, WDI_MAC_ADDR_LEN); |
| 14533 | |
| 14534 | wdiDelBSSParams.ucBssIdx = halDelBssRspMsg.deleteBssRspParams.bssIdx; |
| 14535 | |
| 14536 | /*----------------------------------------------------------------------- |
| 14537 | The current session will be deleted |
| 14538 | -----------------------------------------------------------------------*/ |
| 14539 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 14540 | |
| 14541 | |
| 14542 | /* Delete the BCAST STA entry from the STA table if SAP/GO session is deleted */ |
| 14543 | if(WDI_INFRA_AP_MODE == pBSSSes->wdiBssType) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14544 | { |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame^] | 14545 | (void)WDI_STATableDelSta( pWDICtx, pBSSSes->bcastStaIdx ); |
Madan Mohan Koyyalamudi | f371f17 | 2012-10-31 16:35:43 -0700 | [diff] [blame] | 14546 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame^] | 14547 | |
| 14548 | /* Delete the STA's in this BSS */ |
| 14549 | WDI_STATableBSSDelSta(pWDICtx, halDelBssRspMsg.deleteBssRspParams.bssIdx); |
| 14550 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14551 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14552 | |
| 14553 | /*Notify UMAC*/ |
| 14554 | wdiDelBSSRspCb( &wdiDelBSSParams, pWDICtx->pRspCBUserData); |
| 14555 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14556 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14557 | }/*WDI_ProcessDelBSSRsp*/ |
| 14558 | |
| 14559 | /** |
| 14560 | @brief Process Post Assoc Rsp function (called when a response |
| 14561 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14562 | |
| 14563 | @param pWDICtx: pointer to the WLAN DAL context |
| 14564 | pEventData: pointer to the event information structure |
| 14565 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14566 | @see |
| 14567 | @return Result of the function call |
| 14568 | */ |
| 14569 | WDI_Status |
| 14570 | WDI_ProcessPostAssocRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14571 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14572 | WDI_ControlBlockType* pWDICtx, |
| 14573 | WDI_EventInfoType* pEventData |
| 14574 | ) |
| 14575 | { |
| 14576 | WDI_PostAssocRspParamsType wdiPostAssocParams; |
| 14577 | WDI_PostAssocRspCb wdiPostAssocRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14578 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14579 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14580 | tPostAssocRspMsg halPostAssocRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14581 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14582 | |
| 14583 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14584 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14585 | -------------------------------------------------------------------------*/ |
| 14586 | if (( NULL == pEventData ) || |
| 14587 | ( NULL == pEventData->pEventData)) |
| 14588 | { |
| 14589 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14590 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14591 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14592 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14593 | } |
| 14594 | |
| 14595 | wdiPostAssocRspCb = (WDI_PostAssocRspCb)pWDICtx->pfncRspCB; |
| 14596 | |
| 14597 | /*------------------------------------------------------------------------- |
| 14598 | Extract response and send it to UMAC |
| 14599 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14600 | wpalMemoryCopy( &halPostAssocRspMsg.postAssocRspParams, |
| 14601 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14602 | sizeof(halPostAssocRspMsg.postAssocRspParams)); |
| 14603 | |
| 14604 | /*Extract the Post Assoc STA Params */ |
| 14605 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14606 | wdiPostAssocParams.staParams.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14607 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.staIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14608 | wdiPostAssocParams.staParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14609 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14610 | wdiPostAssocParams.staParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14611 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig; |
| 14612 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14613 | wdiPostAssocParams.wdiStatus = |
| 14614 | WDI_HAL_2_WDI_STATUS(halPostAssocRspMsg.postAssocRspParams.configStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14615 | |
| 14616 | /*Copy the MAC addresses from the cached storage in the WDI CB as they are not |
| 14617 | included in the response */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14618 | wpalMemoryCopy( wdiPostAssocParams.staParams.macSTA, |
| 14619 | pWDICtx->wdiCachedPostAssocReq.wdiSTAParams.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14620 | WDI_MAC_ADDR_LEN); |
| 14621 | |
| 14622 | /* Extract Post Assoc BSS Params */ |
| 14623 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14624 | wpalMemoryCopy( wdiPostAssocParams.bssParams.macBSSID, |
| 14625 | pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.macBSSID, |
| 14626 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14627 | |
| 14628 | /*Copy the MAC addresses from the cached storage in the WDI CB as they are not |
| 14629 | included in the response */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14630 | wpalMemoryCopy( wdiPostAssocParams.bssParams.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14631 | pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.wdiSTAContext |
| 14632 | .macSTA, WDI_MAC_ADDR_LEN); |
| 14633 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14634 | wdiPostAssocParams.bssParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14635 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig; |
| 14636 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14637 | wdiPostAssocParams.bssParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14638 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig; |
| 14639 | |
| 14640 | wdiPostAssocParams.bssParams.ucBSSIdx = |
| 14641 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx; |
| 14642 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14643 | wdiPostAssocParams.bssParams.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14644 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssStaIdx; |
| 14645 | |
| 14646 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14647 | |
| 14648 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14649 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14650 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14651 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14652 | wdiPostAssocParams.bssParams. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14653 | macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14654 | |
| 14655 | /*----------------------------------------------------------------------- |
| 14656 | Post assoc response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14657 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14658 | -----------------------------------------------------------------------*/ |
| 14659 | if (( NULL == pBSSSes ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14660 | ( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14661 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 14662 | { |
| 14663 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14664 | "Association sequence for this BSS does not yet exist or " |
| 14665 | "association no longer in progress - mysterious HAL response"); |
| 14666 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14667 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14668 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14669 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14670 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14671 | } |
| 14672 | |
| 14673 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14674 | Post Assoc Request is only allowed in Joining state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14675 | -----------------------------------------------------------------------*/ |
| 14676 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 14677 | { |
| 14678 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14679 | "Post Assoc not allowed before JOIN - failing request " |
| 14680 | "strange HAL response"); |
| 14681 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14682 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14683 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14684 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14685 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14686 | } |
| 14687 | |
| 14688 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14689 | If assoc has failed the current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14690 | -----------------------------------------------------------------------*/ |
| 14691 | if ( WDI_STATUS_SUCCESS != wdiPostAssocParams.wdiStatus ) |
| 14692 | { |
| 14693 | /*Association was failed by HAL - remove session*/ |
| 14694 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 14695 | } |
| 14696 | else |
| 14697 | { |
| 14698 | /*Transition to state POST Assoc*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14699 | pBSSSes->wdiAssocState = WDI_ASSOC_POST_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14700 | |
| 14701 | /*Save DPU Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14702 | pBSSSes->bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14703 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14704 | pBSSSes->bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14705 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14706 | pBSSSes->bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14707 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14708 | pBSSSes->bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14709 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuSignature; |
| 14710 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14711 | pBSSSes->ucBSSIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14712 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx; |
| 14713 | } |
| 14714 | |
| 14715 | /*Association no longer in progress */ |
| 14716 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 14717 | |
| 14718 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 14719 | WDI_DequeueAssocRequest(pWDICtx); |
| 14720 | |
| 14721 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14722 | |
| 14723 | /*Notify UMAC*/ |
| 14724 | wdiPostAssocRspCb( &wdiPostAssocParams, pWDICtx->pRspCBUserData); |
| 14725 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14726 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14727 | }/*WDI_ProcessPostAssocRsp*/ |
| 14728 | |
| 14729 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14730 | @brief Process Del STA Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14731 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14732 | |
| 14733 | @param pWDICtx: pointer to the WLAN DAL context |
| 14734 | pEventData: pointer to the event information structure |
| 14735 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14736 | @see |
| 14737 | @return Result of the function call |
| 14738 | */ |
| 14739 | WDI_Status |
| 14740 | WDI_ProcessDelSTARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14741 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14742 | WDI_ControlBlockType* pWDICtx, |
| 14743 | WDI_EventInfoType* pEventData |
| 14744 | ) |
| 14745 | { |
| 14746 | WDI_DelSTARspParamsType wdiDelSTARsp; |
| 14747 | WDI_DelSTARspCb wdiDelSTARspCb; |
| 14748 | wpt_uint8 staType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14749 | tDeleteStaRspMsg halDelStaRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14750 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14751 | |
| 14752 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14753 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14754 | -------------------------------------------------------------------------*/ |
| 14755 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14756 | ( NULL == pEventData->pEventData)) |
| 14757 | { |
| 14758 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14759 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14760 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14761 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14762 | } |
| 14763 | |
| 14764 | wdiDelSTARspCb = (WDI_DelSTARspCb)pWDICtx->pfncRspCB; |
| 14765 | |
| 14766 | /*------------------------------------------------------------------------- |
| 14767 | Extract response and send it to UMAC |
| 14768 | -------------------------------------------------------------------------*/ |
| 14769 | wpalMemoryCopy( &halDelStaRspMsg.delStaRspParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14770 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14771 | sizeof(halDelStaRspMsg.delStaRspParams)); |
| 14772 | |
| 14773 | wdiDelSTARsp.ucSTAIdx = halDelStaRspMsg.delStaRspParams.staId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14774 | wdiDelSTARsp.wdiStatus = |
| 14775 | WDI_HAL_2_WDI_STATUS(halDelStaRspMsg.delStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14776 | |
| 14777 | WDI_STATableGetStaType(pWDICtx, wdiDelSTARsp.ucSTAIdx, &staType); |
| 14778 | |
| 14779 | /* If the DEL STA request is for self STA do not delete it - Really weird!!What happens in concurrency */ |
| 14780 | if(staType == WDI_STA_ENTRY_SELF) |
| 14781 | { |
| 14782 | WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable; |
| 14783 | |
| 14784 | /* At this point add the self-STA */ |
| 14785 | |
| 14786 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 14787 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 14788 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 14789 | |
| 14790 | #define WDI_DPU_SELF_STA_DEFAULT_IDX 0 |
| 14791 | #define WDI_DPU_SELF_STA_DEFAULT_SIG 0 |
| 14792 | |
| 14793 | //all DPU indices are the same for self STA |
| 14794 | pSTATable[wdiDelSTARsp.ucSTAIdx].dpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 14795 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 14796 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 14797 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG; |
| 14798 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG; |
| 14799 | pSTATable[wdiDelSTARsp.ucSTAIdx].dpuSig = WDI_DPU_SELF_STA_DEFAULT_SIG; |
Madan Mohan Koyyalamudi | 15a48f0 | 2012-10-05 17:13:53 -0700 | [diff] [blame] | 14800 | |
| 14801 | pSTATable[wdiDelSTARsp.ucSTAIdx].bssIdx = WDI_BSS_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14802 | } |
| 14803 | else |
| 14804 | { |
| 14805 | //Delete the station in the table |
| 14806 | WDI_STATableDelSta( pWDICtx, wdiDelSTARsp.ucSTAIdx); |
| 14807 | } |
| 14808 | |
| 14809 | /*Notify UMAC*/ |
| 14810 | wdiDelSTARspCb( &wdiDelSTARsp, pWDICtx->pRspCBUserData); |
| 14811 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14812 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14813 | }/*WDI_ProcessDelSTARsp*/ |
| 14814 | |
| 14815 | |
| 14816 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14817 | Security Response Processing Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14818 | ==========================================================================*/ |
| 14819 | |
| 14820 | /** |
| 14821 | @brief Process Set BSS Key Rsp function (called when a response |
| 14822 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14823 | |
| 14824 | @param pWDICtx: pointer to the WLAN DAL context |
| 14825 | pEventData: pointer to the event information structure |
| 14826 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14827 | @see |
| 14828 | @return Result of the function call |
| 14829 | */ |
| 14830 | WDI_Status |
| 14831 | WDI_ProcessSetBssKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14832 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14833 | WDI_ControlBlockType* pWDICtx, |
| 14834 | WDI_EventInfoType* pEventData |
| 14835 | ) |
| 14836 | { |
| 14837 | WDI_Status wdiStatus; |
| 14838 | eHalStatus halStatus; |
| 14839 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb; |
| 14840 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14841 | |
| 14842 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14843 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14844 | -------------------------------------------------------------------------*/ |
| 14845 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14846 | ( NULL == pEventData->pEventData)) |
| 14847 | { |
| 14848 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14849 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14850 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14851 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14852 | } |
| 14853 | |
| 14854 | wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pWDICtx->pfncRspCB; |
| 14855 | |
| 14856 | /*------------------------------------------------------------------------- |
| 14857 | Extract response and send it to UMAC |
| 14858 | -------------------------------------------------------------------------*/ |
| 14859 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14860 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14861 | |
| 14862 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 14863 | { |
| 14864 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14865 | "Set BSS Key failed with status %s (%d)", |
| 14866 | WDI_getHALStatusMsgString(halStatus), |
| 14867 | halStatus); |
| 14868 | /* send the status to UMAC, don't return from here*/ |
| 14869 | } |
| 14870 | |
| 14871 | /*Notify UMAC*/ |
| 14872 | wdiSetBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14873 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14874 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14875 | }/*WDI_ProcessSetBssKeyRsp*/ |
| 14876 | |
| 14877 | /** |
| 14878 | @brief Process Remove BSS Key Rsp function (called when a response |
| 14879 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14880 | |
| 14881 | @param pWDICtx: pointer to the WLAN DAL context |
| 14882 | pEventData: pointer to the event information structure |
| 14883 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14884 | @see |
| 14885 | @return Result of the function call |
| 14886 | */ |
| 14887 | WDI_Status |
| 14888 | WDI_ProcessRemoveBssKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14889 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14890 | WDI_ControlBlockType* pWDICtx, |
| 14891 | WDI_EventInfoType* pEventData |
| 14892 | ) |
| 14893 | { |
| 14894 | WDI_Status wdiStatus; |
| 14895 | eHalStatus halStatus; |
| 14896 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb; |
| 14897 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14898 | |
| 14899 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14900 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14901 | -------------------------------------------------------------------------*/ |
| 14902 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14903 | ( NULL == pEventData->pEventData)) |
| 14904 | { |
| 14905 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14906 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14907 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14908 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14909 | } |
| 14910 | |
| 14911 | wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pWDICtx->pfncRspCB; |
| 14912 | |
| 14913 | /*------------------------------------------------------------------------- |
| 14914 | Extract response and send it to UMAC |
| 14915 | -------------------------------------------------------------------------*/ |
| 14916 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14917 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14918 | |
| 14919 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 14920 | { |
| 14921 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14922 | "Remove BSS Key failed with status %s (%d )", |
| 14923 | WDI_getHALStatusMsgString(halStatus), |
| 14924 | halStatus); |
| 14925 | /* send the status to UMAC, don't return from here*/ |
| 14926 | } |
| 14927 | |
| 14928 | /*Notify UMAC*/ |
| 14929 | wdiRemoveBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14930 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14931 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14932 | }/*WDI_ProcessSetBssKeyRsp*/ |
| 14933 | |
| 14934 | |
| 14935 | /** |
| 14936 | @brief Process Set STA Key Rsp function (called when a response |
| 14937 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14938 | |
| 14939 | @param pWDICtx: pointer to the WLAN DAL context |
| 14940 | pEventData: pointer to the event information structure |
| 14941 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14942 | @see |
| 14943 | @return Result of the function call |
| 14944 | */ |
| 14945 | WDI_Status |
| 14946 | WDI_ProcessSetStaKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14947 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14948 | WDI_ControlBlockType* pWDICtx, |
| 14949 | WDI_EventInfoType* pEventData |
| 14950 | ) |
| 14951 | { |
| 14952 | WDI_Status wdiStatus; |
| 14953 | eHalStatus halStatus; |
| 14954 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 14955 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14956 | |
| 14957 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14958 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14959 | -------------------------------------------------------------------------*/ |
| 14960 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14961 | ( NULL == pEventData->pEventData)) |
| 14962 | { |
| 14963 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14964 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14965 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14966 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14967 | } |
| 14968 | |
| 14969 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 14970 | |
| 14971 | /*------------------------------------------------------------------------- |
| 14972 | Extract response and send it to UMAC |
| 14973 | -------------------------------------------------------------------------*/ |
| 14974 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14975 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14976 | |
| 14977 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 14978 | { |
| 14979 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14980 | "Set STA Key failed with status %s (%d)", |
| 14981 | WDI_getHALStatusMsgString(halStatus), |
| 14982 | halStatus); |
| 14983 | /* send the status to UMAC, don't return from here*/ |
| 14984 | } |
| 14985 | |
| 14986 | /*Notify UMAC*/ |
| 14987 | wdiSetSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14988 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14989 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14990 | }/*WDI_ProcessSetSTAKeyRsp*/ |
| 14991 | |
| 14992 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14993 | @brief Process Remove STA Key Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14994 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14995 | |
| 14996 | @param pWDICtx: pointer to the WLAN DAL context |
| 14997 | pEventData: pointer to the event information structure |
| 14998 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14999 | @see |
| 15000 | @return Result of the function call |
| 15001 | */ |
| 15002 | WDI_Status |
| 15003 | WDI_ProcessRemoveStaKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15004 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15005 | WDI_ControlBlockType* pWDICtx, |
| 15006 | WDI_EventInfoType* pEventData |
| 15007 | ) |
| 15008 | { |
| 15009 | WDI_Status wdiStatus; |
| 15010 | eHalStatus halStatus; |
| 15011 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 15012 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15013 | |
| 15014 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15015 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15016 | -------------------------------------------------------------------------*/ |
| 15017 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15018 | ( NULL == pEventData->pEventData)) |
| 15019 | { |
| 15020 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15021 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15022 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15023 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15024 | } |
| 15025 | |
| 15026 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15027 | |
| 15028 | /*------------------------------------------------------------------------- |
| 15029 | Extract response and send it to UMAC |
| 15030 | -------------------------------------------------------------------------*/ |
| 15031 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15032 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15033 | |
| 15034 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15035 | { |
| 15036 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15037 | "Remove STA Key failed with status %s (%d)", |
| 15038 | WDI_getHALStatusMsgString(halStatus), |
| 15039 | halStatus); |
| 15040 | /* send the status to UMAC, don't return from here*/ |
| 15041 | } |
| 15042 | |
| 15043 | /*Notify UMAC*/ |
| 15044 | wdiRemoveSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15045 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15046 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15047 | }/*WDI_ProcessRemoveStaKeyRsp*/ |
| 15048 | |
| 15049 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15050 | @brief Process Set STA Bcast Key Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15051 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15052 | |
| 15053 | @param pWDICtx: pointer to the WLAN DAL context |
| 15054 | pEventData: pointer to the event information structure |
| 15055 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15056 | @see |
| 15057 | @return Result of the function call |
| 15058 | */ |
| 15059 | WDI_Status |
| 15060 | WDI_ProcessSetStaBcastKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15061 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15062 | WDI_ControlBlockType* pWDICtx, |
| 15063 | WDI_EventInfoType* pEventData |
| 15064 | ) |
| 15065 | { |
| 15066 | WDI_Status wdiStatus; |
| 15067 | eHalStatus halStatus; |
| 15068 | WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb; |
| 15069 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15070 | |
| 15071 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15072 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15073 | -------------------------------------------------------------------------*/ |
| 15074 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15075 | ( NULL == pEventData->pEventData)) |
| 15076 | { |
| 15077 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15078 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15079 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15080 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15081 | } |
| 15082 | |
| 15083 | wdiSetSTABcastKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15084 | |
| 15085 | /*------------------------------------------------------------------------- |
| 15086 | Extract response and send it to UMAC |
| 15087 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15088 | wpalMemoryCopy( &halStatus, |
| 15089 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15090 | sizeof(halStatus)); |
| 15091 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15092 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15093 | |
| 15094 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15095 | { |
| 15096 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15097 | "Set STA Key failed with status %s (%d)", |
| 15098 | WDI_getHALStatusMsgString(halStatus), |
| 15099 | halStatus); |
| 15100 | /* send the status to UMAC, don't return from here*/ |
| 15101 | } |
| 15102 | |
| 15103 | /*Notify UMAC*/ |
| 15104 | wdiSetSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15105 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15106 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15107 | }/*WDI_ProcessSetSTABcastKeyRsp*/ |
| 15108 | |
| 15109 | /** |
| 15110 | @brief Process Remove STA Bcast Key Rsp function (called when a |
| 15111 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15112 | |
| 15113 | @param pWDICtx: pointer to the WLAN DAL context |
| 15114 | pEventData: pointer to the event information structure |
| 15115 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15116 | @see |
| 15117 | @return Result of the function call |
| 15118 | */ |
| 15119 | WDI_Status |
| 15120 | WDI_ProcessRemoveStaBcastKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15121 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15122 | WDI_ControlBlockType* pWDICtx, |
| 15123 | WDI_EventInfoType* pEventData |
| 15124 | ) |
| 15125 | { |
| 15126 | WDI_Status wdiStatus; |
| 15127 | eHalStatus halStatus; |
| 15128 | WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb; |
| 15129 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15130 | |
| 15131 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15132 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15133 | -------------------------------------------------------------------------*/ |
| 15134 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15135 | ( NULL == pEventData->pEventData)) |
| 15136 | { |
| 15137 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15138 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15139 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15140 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15141 | } |
| 15142 | |
| 15143 | wdiRemoveSTABcastKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15144 | |
| 15145 | /*------------------------------------------------------------------------- |
| 15146 | Extract response and send it to UMAC |
| 15147 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15148 | wpalMemoryCopy( &halStatus, |
| 15149 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15150 | sizeof(halStatus)); |
| 15151 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15152 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15153 | |
| 15154 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15155 | { |
| 15156 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15157 | "Remove STA Key failed with status %s (%d)", |
| 15158 | WDI_getHALStatusMsgString(halStatus), |
| 15159 | halStatus); |
| 15160 | /* send the status to UMAC, don't return from here*/ |
| 15161 | } |
| 15162 | |
| 15163 | /*Notify UMAC*/ |
| 15164 | wdiRemoveSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15165 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15166 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15167 | }/*WDI_ProcessRemoveStaBcastKeyRsp*/ |
| 15168 | |
| 15169 | |
| 15170 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15171 | QoS and BA Response Processing Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15172 | ==========================================================================*/ |
| 15173 | |
| 15174 | /** |
| 15175 | @brief Process Add TSpec Rsp function (called when a response |
| 15176 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15177 | |
| 15178 | @param pWDICtx: pointer to the WLAN DAL context |
| 15179 | pEventData: pointer to the event information structure |
| 15180 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15181 | @see |
| 15182 | @return Result of the function call |
| 15183 | */ |
| 15184 | WDI_Status |
| 15185 | WDI_ProcessAddTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15186 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15187 | WDI_ControlBlockType* pWDICtx, |
| 15188 | WDI_EventInfoType* pEventData |
| 15189 | ) |
| 15190 | { |
| 15191 | WDI_Status wdiStatus; |
| 15192 | eHalStatus halStatus; |
| 15193 | WDI_AddTsRspCb wdiAddTsRspCb; |
| 15194 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15195 | |
| 15196 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15197 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15198 | -------------------------------------------------------------------------*/ |
| 15199 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15200 | ( NULL == pEventData->pEventData)) |
| 15201 | { |
| 15202 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15203 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15204 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15205 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15206 | } |
| 15207 | |
| 15208 | wdiAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB; |
| 15209 | |
| 15210 | /*------------------------------------------------------------------------- |
| 15211 | Extract response and send it to UMAC |
| 15212 | -------------------------------------------------------------------------*/ |
| 15213 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15214 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15215 | |
| 15216 | /*Notify UMAC*/ |
| 15217 | wdiAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15218 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15219 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15220 | }/*WDI_ProcessAddTSpecRsp*/ |
| 15221 | |
| 15222 | |
| 15223 | /** |
| 15224 | @brief Process Del TSpec Rsp function (called when a response |
| 15225 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15226 | |
| 15227 | @param pWDICtx: pointer to the WLAN DAL context |
| 15228 | pEventData: pointer to the event information structure |
| 15229 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15230 | @see |
| 15231 | @return Result of the function call |
| 15232 | */ |
| 15233 | WDI_Status |
| 15234 | WDI_ProcessDelTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15235 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15236 | WDI_ControlBlockType* pWDICtx, |
| 15237 | WDI_EventInfoType* pEventData |
| 15238 | ) |
| 15239 | { |
| 15240 | WDI_Status wdiStatus; |
| 15241 | eHalStatus halStatus; |
| 15242 | WDI_DelTsRspCb wdiDelTsRspCb; |
| 15243 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15244 | |
| 15245 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15246 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15247 | -------------------------------------------------------------------------*/ |
| 15248 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15249 | ( NULL == pEventData->pEventData)) |
| 15250 | { |
| 15251 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15252 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15253 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15254 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15255 | } |
| 15256 | |
| 15257 | wdiDelTsRspCb = (WDI_DelTsRspCb)pWDICtx->pfncRspCB; |
| 15258 | |
| 15259 | /*------------------------------------------------------------------------- |
| 15260 | Extract response and send it to UMAC |
| 15261 | -------------------------------------------------------------------------*/ |
| 15262 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15263 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15264 | |
| 15265 | /*Notify UMAC*/ |
| 15266 | wdiDelTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15267 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15268 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15269 | }/*WDI_ProcessDelTSpecRsp*/ |
| 15270 | |
| 15271 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15272 | @brief Process Update EDCA Parameters Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15273 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15274 | |
| 15275 | @param pWDICtx: pointer to the WLAN DAL context |
| 15276 | pEventData: pointer to the event information structure |
| 15277 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15278 | @see |
| 15279 | @return Result of the function call |
| 15280 | */ |
| 15281 | WDI_Status |
| 15282 | WDI_ProcessUpdateEDCAParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15283 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15284 | WDI_ControlBlockType* pWDICtx, |
| 15285 | WDI_EventInfoType* pEventData |
| 15286 | ) |
| 15287 | { |
| 15288 | WDI_Status wdiStatus; |
| 15289 | eHalStatus halStatus; |
| 15290 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb; |
| 15291 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15292 | |
| 15293 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15294 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15295 | -------------------------------------------------------------------------*/ |
| 15296 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15297 | ( NULL == pEventData->pEventData)) |
| 15298 | { |
| 15299 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15300 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15301 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15302 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15303 | } |
| 15304 | |
| 15305 | wdiUpdateEDCAParamsRspCb = (WDI_UpdateEDCAParamsRspCb)pWDICtx->pfncRspCB; |
| 15306 | |
| 15307 | /*------------------------------------------------------------------------- |
| 15308 | Extract response and send it to UMAC |
| 15309 | -------------------------------------------------------------------------*/ |
| 15310 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15311 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15312 | |
| 15313 | /*Notify UMAC*/ |
| 15314 | wdiUpdateEDCAParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15315 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15316 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15317 | }/*WDI_ProcessUpdateEDCAParamsRsp*/ |
| 15318 | |
| 15319 | |
| 15320 | /** |
| 15321 | @brief Process Add BA Rsp function (called when a response |
| 15322 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15323 | |
| 15324 | @param pWDICtx: pointer to the WLAN DAL context |
| 15325 | pEventData: pointer to the event information structure |
| 15326 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15327 | @see |
| 15328 | @return Result of the function call |
| 15329 | */ |
| 15330 | WDI_Status |
| 15331 | WDI_ProcessAddBASessionRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15332 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15333 | WDI_ControlBlockType* pWDICtx, |
| 15334 | WDI_EventInfoType* pEventData |
| 15335 | ) |
| 15336 | { |
| 15337 | WDI_AddBASessionRspCb wdiAddBASessionRspCb; |
| 15338 | |
| 15339 | tAddBASessionRspParams halBASessionRsp; |
| 15340 | WDI_AddBASessionRspParamsType wdiBASessionRsp; |
| 15341 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15342 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15343 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15344 | |
| 15345 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15346 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15347 | -------------------------------------------------------------------------*/ |
| 15348 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15349 | ( NULL == pEventData->pEventData)) |
| 15350 | { |
| 15351 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15352 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15353 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15354 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15355 | } |
| 15356 | |
| 15357 | wdiAddBASessionRspCb = (WDI_AddBASessionRspCb)pWDICtx->pfncRspCB; |
| 15358 | |
| 15359 | /*------------------------------------------------------------------------- |
| 15360 | Extract response and send it to UMAC |
| 15361 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15362 | wpalMemoryCopy( &halBASessionRsp, |
| 15363 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15364 | sizeof(halBASessionRsp)); |
| 15365 | |
| 15366 | wdiBASessionRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halBASessionRsp.status); |
| 15367 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 15368 | if ( WDI_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15369 | { |
| 15370 | wdiBASessionRsp.ucBaDialogToken = halBASessionRsp.baDialogToken; |
| 15371 | wdiBASessionRsp.ucBaTID = halBASessionRsp.baTID; |
| 15372 | wdiBASessionRsp.ucBaBufferSize = halBASessionRsp.baBufferSize; |
| 15373 | wdiBASessionRsp.usBaSessionID = halBASessionRsp.baSessionID; |
| 15374 | wdiBASessionRsp.ucWinSize = halBASessionRsp.winSize; |
| 15375 | wdiBASessionRsp.ucSTAIdx = halBASessionRsp.STAID; |
| 15376 | wdiBASessionRsp.usBaSSN = halBASessionRsp.SSN; |
| 15377 | } |
| 15378 | |
| 15379 | /*Notify UMAC*/ |
| 15380 | wdiAddBASessionRspCb( &wdiBASessionRsp, pWDICtx->pRspCBUserData); |
| 15381 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15382 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15383 | }/*WDI_ProcessAddSessionBARsp*/ |
| 15384 | |
| 15385 | |
| 15386 | /** |
| 15387 | @brief Process Del BA Rsp function (called when a response |
| 15388 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15389 | |
| 15390 | @param pWDICtx: pointer to the WLAN DAL context |
| 15391 | pEventData: pointer to the event information structure |
| 15392 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15393 | @see |
| 15394 | @return Result of the function call |
| 15395 | */ |
| 15396 | WDI_Status |
| 15397 | WDI_ProcessDelBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15398 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15399 | WDI_ControlBlockType* pWDICtx, |
| 15400 | WDI_EventInfoType* pEventData |
| 15401 | ) |
| 15402 | { |
| 15403 | WDI_Status wdiStatus; |
| 15404 | eHalStatus halStatus; |
| 15405 | WDI_DelBARspCb wdiDelBARspCb; |
| 15406 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15407 | |
| 15408 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15409 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15410 | -------------------------------------------------------------------------*/ |
| 15411 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15412 | ( NULL == pEventData->pEventData)) |
| 15413 | { |
| 15414 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15415 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15416 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15417 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15418 | } |
| 15419 | |
| 15420 | wdiDelBARspCb = (WDI_DelBARspCb)pWDICtx->pfncRspCB; |
| 15421 | |
| 15422 | /*------------------------------------------------------------------------- |
| 15423 | Extract response and send it to UMAC |
| 15424 | -------------------------------------------------------------------------*/ |
| 15425 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15426 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15427 | |
| 15428 | if ( eHAL_STATUS_SUCCESS == halStatus ) |
| 15429 | { |
| 15430 | /*! TO DO: I should notify the DAL Data Path that the BA was deleted*/ |
| 15431 | } |
| 15432 | |
| 15433 | /*Notify UMAC*/ |
| 15434 | wdiDelBARspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15435 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15436 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15437 | }/*WDI_ProcessDelBARsp*/ |
| 15438 | |
| 15439 | #ifdef FEATURE_WLAN_CCX |
| 15440 | /** |
| 15441 | @brief Process TSM Stats Rsp function (called when a response |
| 15442 | is being received over the bus from HAL) |
| 15443 | |
| 15444 | @param pWDICtx: pointer to the WLAN DAL context |
| 15445 | pEventData: pointer to the event information structure |
| 15446 | |
| 15447 | @see |
| 15448 | @return Result of the function call |
| 15449 | */ |
| 15450 | WDI_Status |
| 15451 | WDI_ProcessTsmStatsRsp |
| 15452 | ( |
| 15453 | WDI_ControlBlockType* pWDICtx, |
| 15454 | WDI_EventInfoType* pEventData |
| 15455 | ) |
| 15456 | { |
| 15457 | WDI_TsmRspCb wdiTsmStatsRspCb; |
| 15458 | tTsmStatsRspMsg halTsmStatsRspMsg; |
| 15459 | WDI_TSMStatsRspParamsType wdiTsmStatsRspParams; |
| 15460 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15461 | |
| 15462 | /*------------------------------------------------------------------------- |
| 15463 | Sanity check |
| 15464 | -------------------------------------------------------------------------*/ |
| 15465 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15466 | ( NULL == pEventData->pEventData)) |
| 15467 | { |
| 15468 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15469 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15470 | WDI_ASSERT(0); |
| 15471 | return WDI_STATUS_E_FAILURE; |
| 15472 | } |
| 15473 | |
| 15474 | wdiTsmStatsRspCb = (WDI_TsmRspCb)pWDICtx->pfncRspCB; |
| 15475 | |
| 15476 | /*------------------------------------------------------------------------- |
| 15477 | Unpack HAL Response Message - the header was already extracted by the |
| 15478 | main Response Handling procedure |
| 15479 | -------------------------------------------------------------------------*/ |
| 15480 | wpalMemoryCopy( &halTsmStatsRspMsg.tsmStatsRspParams, |
| 15481 | pEventData->pEventData, |
| 15482 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams)); |
| 15483 | |
| 15484 | wdiTsmStatsRspParams.UplinkPktQueueDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDly; |
| 15485 | wpalMemoryCopy( wdiTsmStatsRspParams.UplinkPktQueueDlyHist, |
| 15486 | halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist, |
| 15487 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist)/ |
| 15488 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist[0])); |
| 15489 | wdiTsmStatsRspParams.UplinkPktTxDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktTxDly; |
| 15490 | wdiTsmStatsRspParams.UplinkPktLoss = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktLoss; |
| 15491 | wdiTsmStatsRspParams.UplinkPktCount = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktCount; |
| 15492 | wdiTsmStatsRspParams.RoamingCount = halTsmStatsRspMsg.tsmStatsRspParams.RoamingCount; |
| 15493 | wdiTsmStatsRspParams.RoamingDly = halTsmStatsRspMsg.tsmStatsRspParams.RoamingDly; |
| 15494 | wdiTsmStatsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 15495 | halTsmStatsRspMsg.tsmStatsRspParams.status); |
| 15496 | |
| 15497 | /*Notify UMAC*/ |
| 15498 | wdiTsmStatsRspCb( &wdiTsmStatsRspParams, pWDICtx->pRspCBUserData); |
| 15499 | |
| 15500 | return WDI_STATUS_SUCCESS; |
| 15501 | }/*WDI_ProcessTsmStatsRsp*/ |
| 15502 | |
| 15503 | #endif |
| 15504 | |
| 15505 | |
| 15506 | |
| 15507 | /** |
| 15508 | @brief Process Flush AC Rsp function (called when a response |
| 15509 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15510 | |
| 15511 | @param pWDICtx: pointer to the WLAN DAL context |
| 15512 | pEventData: pointer to the event information structure |
| 15513 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15514 | @see |
| 15515 | @return Result of the function call |
| 15516 | */ |
| 15517 | WDI_Status |
| 15518 | WDI_ProcessFlushAcRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15519 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15520 | WDI_ControlBlockType* pWDICtx, |
| 15521 | WDI_EventInfoType* pEventData |
| 15522 | ) |
| 15523 | { |
| 15524 | WDI_Status wdiStatus; |
| 15525 | eHalStatus halStatus; |
| 15526 | WDI_FlushAcRspCb wdiFlushAcRspCb; |
| 15527 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15528 | |
| 15529 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15530 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15531 | -------------------------------------------------------------------------*/ |
| 15532 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15533 | ( NULL == pEventData->pEventData)) |
| 15534 | { |
| 15535 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15536 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15537 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15538 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15539 | } |
| 15540 | |
| 15541 | wdiFlushAcRspCb = (WDI_FlushAcRspCb)pWDICtx->pfncRspCB; |
| 15542 | |
| 15543 | /*------------------------------------------------------------------------- |
| 15544 | Extract response and send it to UMAC |
| 15545 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15546 | wpalMemoryCopy( &halStatus, |
| 15547 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15548 | sizeof(halStatus)); |
| 15549 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15550 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15551 | |
| 15552 | /*Notify UMAC*/ |
| 15553 | wdiFlushAcRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15554 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15555 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15556 | }/*WDI_ProcessFlushAcRsp*/ |
| 15557 | |
| 15558 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15559 | @brief Process BT AMP event Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15560 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15561 | |
| 15562 | @param pWDICtx: pointer to the WLAN DAL context |
| 15563 | pEventData: pointer to the event information structure |
| 15564 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15565 | @see |
| 15566 | @return Result of the function call |
| 15567 | */ |
| 15568 | WDI_Status |
| 15569 | WDI_ProcessBtAmpEventRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15570 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15571 | WDI_ControlBlockType* pWDICtx, |
| 15572 | WDI_EventInfoType* pEventData |
| 15573 | ) |
| 15574 | { |
| 15575 | WDI_Status wdiStatus; |
| 15576 | eHalStatus halStatus; |
| 15577 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb; |
| 15578 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15579 | |
| 15580 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15581 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15582 | -------------------------------------------------------------------------*/ |
| 15583 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15584 | ( NULL == pEventData->pEventData)) |
| 15585 | { |
| 15586 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15587 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15588 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15589 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15590 | } |
| 15591 | |
| 15592 | wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pWDICtx->pfncRspCB; |
| 15593 | |
| 15594 | /*------------------------------------------------------------------------- |
| 15595 | Extract response and send it to UMAC |
| 15596 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15597 | wpalMemoryCopy( &halStatus, |
| 15598 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15599 | sizeof(halStatus)); |
| 15600 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15601 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15602 | |
| 15603 | /*Notify UMAC*/ |
| 15604 | wdiBtAmpEventRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15605 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15606 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15607 | }/*WDI_ProcessBtAmpEventRsp*/ |
| 15608 | |
| 15609 | |
| 15610 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15611 | @brief Process ADD STA SELF Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15612 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15613 | |
| 15614 | @param pWDICtx: pointer to the WLAN DAL context |
| 15615 | pEventData: pointer to the event information structure |
| 15616 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15617 | @see |
| 15618 | @return Result of the function call |
| 15619 | */ |
| 15620 | WDI_Status |
| 15621 | WDI_ProcessAddSTASelfRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15622 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15623 | WDI_ControlBlockType* pWDICtx, |
| 15624 | WDI_EventInfoType* pEventData |
| 15625 | ) |
| 15626 | { |
| 15627 | WDI_AddSTASelfRspParamsType wdiAddSTASelfParams; |
| 15628 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb; |
| 15629 | tAddStaSelfRspMsg halAddStaSelfRsp; |
| 15630 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 15631 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15632 | |
| 15633 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15634 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15635 | -------------------------------------------------------------------------*/ |
| 15636 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15637 | ( NULL == pEventData->pEventData)) |
| 15638 | { |
| 15639 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15640 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15641 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15642 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15643 | } |
| 15644 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15645 | wdiAddSTASelfReqParamsRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15646 | (WDI_AddSTASelfParamsRspCb)pWDICtx->pfncRspCB; |
| 15647 | |
| 15648 | /*------------------------------------------------------------------------- |
| 15649 | Extract response and send it to UMAC |
| 15650 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15651 | wpalMemoryCopy( &halAddStaSelfRsp.addStaSelfRspParams, |
| 15652 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15653 | sizeof(halAddStaSelfRsp.addStaSelfRspParams)); |
| 15654 | |
| 15655 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15656 | wdiAddSTASelfParams.wdiStatus = |
| 15657 | WDI_HAL_2_WDI_STATUS(halAddStaSelfRsp.addStaSelfRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15658 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15659 | wdiAddSTASelfParams.ucSTASelfIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15660 | halAddStaSelfRsp.addStaSelfRspParams.selfStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15661 | wdiAddSTASelfParams.dpuIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15662 | halAddStaSelfRsp.addStaSelfRspParams.dpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15663 | wdiAddSTASelfParams.dpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15664 | halAddStaSelfRsp.addStaSelfRspParams.dpuSignature; |
| 15665 | |
| 15666 | wpalMemoryCopy(wdiAddSTASelfParams.macSelfSta, |
| 15667 | pWDICtx->wdiCacheAddSTASelfReq.wdiAddSTASelfInfo.selfMacAddr, |
| 15668 | WDI_MAC_ADDR_LEN); |
| 15669 | |
| 15670 | |
| 15671 | #ifdef HAL_SELF_STA_PER_BSS |
| 15672 | |
| 15673 | /* At this point add the self-STA */ |
| 15674 | |
| 15675 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 15676 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 15677 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 15678 | |
| 15679 | //all DPU indices are the same for self STA |
| 15680 | |
| 15681 | /*DPU Information*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15682 | wdiAddSTAParam.dpuIndex = wdiAddSTASelfParams.dpuIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15683 | wdiAddSTAParam.dpuSig = wdiAddSTASelfParams.dpuSignature; |
| 15684 | wdiAddSTAParam.bcastDpuSignature = wdiAddSTASelfParams.dpuSignature; |
| 15685 | wdiAddSTAParam.bcastMgmtDpuSignature = wdiAddSTASelfParams.dpuSignature; |
| 15686 | wdiAddSTAParam.bcastDpuIndex = wdiAddSTASelfParams.dpuIdx; |
| 15687 | wdiAddSTAParam.bcastMgmtDpuIndex = wdiAddSTASelfParams.dpuIdx; |
| 15688 | |
| 15689 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiAddSTASelfParams.macSelfSta, |
| 15690 | WDI_MAC_ADDR_LEN); |
| 15691 | |
| 15692 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */ |
| 15693 | wdiAddSTAParam.ucSTAIdx = wdiAddSTASelfParams.ucSTASelfIdx; |
| 15694 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15695 | if(halAddStaSelfRsp.addStaSelfRspParams.status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15696 | != eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO) |
| 15697 | { |
| 15698 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 15699 | } |
| 15700 | #endif |
| 15701 | |
| 15702 | /*Notify UMAC*/ |
| 15703 | wdiAddSTASelfReqParamsRspCb( &wdiAddSTASelfParams, pWDICtx->pRspCBUserData); |
| 15704 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15705 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15706 | }/*WDI_ProcessAddSTASelfRsp*/ |
| 15707 | |
| 15708 | |
| 15709 | |
| 15710 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15711 | @brief WDI_ProcessDelSTASelfRsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15712 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15713 | |
| 15714 | @param pWDICtx: pointer to the WLAN DAL context |
| 15715 | pEventData: pointer to the event information structure |
| 15716 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15717 | @see |
| 15718 | @return Result of the function call |
| 15719 | */ |
| 15720 | WDI_Status |
| 15721 | WDI_ProcessDelSTASelfRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15722 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15723 | WDI_ControlBlockType* pWDICtx, |
| 15724 | WDI_EventInfoType* pEventData |
| 15725 | ) |
| 15726 | { |
| 15727 | WDI_DelSTASelfRspParamsType wdiDelStaSelfRspParams; |
| 15728 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb; |
| 15729 | tDelStaSelfRspParams delStaSelfRspParams; |
| 15730 | wpt_uint8 ucStaIdx; |
| 15731 | |
| 15732 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15733 | |
| 15734 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15735 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15736 | -------------------------------------------------------------------------*/ |
| 15737 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15738 | ( NULL == pEventData->pEventData)) |
| 15739 | { |
| 15740 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15741 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15742 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15743 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15744 | } |
| 15745 | |
| 15746 | wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pWDICtx->pfncRspCB; |
| 15747 | |
| 15748 | /*------------------------------------------------------------------------- |
| 15749 | Extract response and send it to UMAC |
| 15750 | -------------------------------------------------------------------------*/ |
| 15751 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15752 | wpalMemoryCopy( &delStaSelfRspParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15753 | (wpt_uint8*)pEventData->pEventData, |
| 15754 | sizeof(tDelStaSelfRspParams)); |
| 15755 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15756 | wdiDelStaSelfRspParams.wdiStatus = |
| 15757 | WDI_HAL_2_WDI_STATUS(delStaSelfRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15758 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15759 | /* delStaSelfRspParams.status is not |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15760 | eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO*/ |
| 15761 | if( eHAL_STATUS_SUCCESS == delStaSelfRspParams.status ) |
| 15762 | { |
| 15763 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15764 | wdiStatus = WDI_STATableFindStaidByAddr(pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15765 | delStaSelfRspParams.selfMacAddr, |
| 15766 | &ucStaIdx); |
| 15767 | if(WDI_STATUS_E_FAILURE == wdiStatus) |
| 15768 | { |
| 15769 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15770 | "%s: Unable to extract the STA Idx ", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15771 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15772 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15773 | } |
| 15774 | WDI_STATableDelSta(pWDICtx, ucStaIdx); |
| 15775 | } |
| 15776 | |
| 15777 | /*Notify UMAC*/ |
| 15778 | wdiDelStaSelfRspCb(&wdiDelStaSelfRspParams, (void*) pWDICtx->pRspCBUserData); |
| 15779 | |
| 15780 | return WDI_STATUS_SUCCESS; |
| 15781 | } |
| 15782 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15783 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 15784 | /** |
| 15785 | @brief Start Oem Data Rsp function (called when a |
| 15786 | response is being received over the bus from HAL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15787 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15788 | @param pWDICtx: pointer to the WLAN DAL context |
| 15789 | pEventData: pointer to the event information structure |
| 15790 | |
| 15791 | @see |
| 15792 | @return Result of the function call |
| 15793 | */ |
| 15794 | #define OFFSET_OF(structType,fldName) (&((structType*)0)->fldName) |
| 15795 | |
| 15796 | WDI_Status |
| 15797 | WDI_ProcessStartOemDataRsp |
| 15798 | ( |
| 15799 | WDI_ControlBlockType* pWDICtx, |
| 15800 | WDI_EventInfoType* pEventData |
| 15801 | ) |
| 15802 | { |
| 15803 | WDI_oemDataRspCb wdiOemDataRspCb; |
| 15804 | WDI_oemDataRspParamsType* wdiOemDataRspParams; |
| 15805 | tStartOemDataRspParams* halStartOemDataRspParams; |
| 15806 | |
| 15807 | /*------------------------------------------------------------------------- |
| 15808 | Sanity check |
| 15809 | -------------------------------------------------------------------------*/ |
| 15810 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15811 | ( NULL == pEventData->pEventData)) |
| 15812 | { |
| 15813 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15814 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15815 | WDI_ASSERT(0); |
| 15816 | return WDI_STATUS_E_FAILURE; |
| 15817 | } |
| 15818 | |
| 15819 | wdiOemDataRspCb = (WDI_oemDataRspCb)pWDICtx->pfncRspCB; |
| 15820 | |
| 15821 | /*------------------------------------------------------------------------- |
| 15822 | Extract response and send it to UMAC |
| 15823 | -------------------------------------------------------------------------*/ |
| 15824 | halStartOemDataRspParams = (tStartOemDataRspParams *)pEventData->pEventData; |
| 15825 | |
| 15826 | |
| 15827 | //It is the responsibility of the application code to check for failure |
| 15828 | //conditions! |
| 15829 | |
| 15830 | //Allocate memory for WDI OEM DATA RSP structure |
| 15831 | wdiOemDataRspParams = wpalMemoryAllocate(sizeof(WDI_oemDataRspParamsType)) ; |
| 15832 | |
| 15833 | if(NULL == wdiOemDataRspParams) |
| 15834 | { |
| 15835 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15836 | "Failed to allocate memory in OEM DATA Response %x %x %x ", |
| 15837 | pWDICtx, pEventData, pEventData->pEventData); |
| 15838 | WDI_ASSERT(0); |
| 15839 | return WDI_STATUS_E_FAILURE; |
| 15840 | } |
| 15841 | |
| 15842 | /* Populate WDI structure members */ |
| 15843 | wpalMemoryCopy(wdiOemDataRspParams->oemDataRsp, halStartOemDataRspParams->oemDataRsp, OEM_DATA_RSP_SIZE); |
| 15844 | |
| 15845 | /*Notify UMAC*/ |
| 15846 | wdiOemDataRspCb(wdiOemDataRspParams, pWDICtx->pRspCBUserData); |
| 15847 | |
| 15848 | //Free memory allocated for WDI OEM_DATA MEAS RSP structure |
| 15849 | wpalMemoryFree(wdiOemDataRspParams); |
| 15850 | |
| 15851 | return WDI_STATUS_SUCCESS; |
| 15852 | }/*WDI_PrcoessStartOemDataRsp*/ |
| 15853 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15854 | |
| 15855 | /*=========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15856 | Miscellaneous Control Response Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15857 | ===========================================================================*/ |
| 15858 | |
| 15859 | /** |
| 15860 | @brief Process Channel Switch Rsp function (called when a response |
| 15861 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15862 | |
| 15863 | @param pWDICtx: pointer to the WLAN DAL context |
| 15864 | pEventData: pointer to the event information structure |
| 15865 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15866 | @see |
| 15867 | @return Result of the function call |
| 15868 | */ |
| 15869 | WDI_Status |
| 15870 | WDI_ProcessChannelSwitchRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15871 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15872 | WDI_ControlBlockType* pWDICtx, |
| 15873 | WDI_EventInfoType* pEventData |
| 15874 | ) |
| 15875 | { |
| 15876 | WDI_SwitchCHRspParamsType wdiSwitchChRsp; |
| 15877 | WDI_SwitchChRspCb wdiChSwitchRspCb; |
| 15878 | tSwitchChannelRspParams halSwitchChannelRsp; |
| 15879 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15880 | |
| 15881 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15882 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15883 | -------------------------------------------------------------------------*/ |
| 15884 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15885 | ( NULL == pEventData->pEventData)) |
| 15886 | { |
| 15887 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15888 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15889 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15890 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15891 | } |
| 15892 | |
| 15893 | wdiChSwitchRspCb = (WDI_SwitchChRspCb)pWDICtx->pfncRspCB; |
| 15894 | |
| 15895 | /*------------------------------------------------------------------------- |
| 15896 | Extract response and send it to UMAC |
| 15897 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15898 | wpalMemoryCopy( &halSwitchChannelRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15899 | (wpt_uint8*)pEventData->pEventData, |
| 15900 | sizeof(halSwitchChannelRsp)); |
| 15901 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15902 | wdiSwitchChRsp.wdiStatus = |
| 15903 | WDI_HAL_2_WDI_STATUS(halSwitchChannelRsp.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15904 | wdiSwitchChRsp.ucChannel = halSwitchChannelRsp.channelNumber; |
| 15905 | |
| 15906 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15907 | wdiSwitchChRsp.ucTxMgmtPower = halSwitchChannelRsp.txMgmtPower; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15908 | #endif |
| 15909 | |
| 15910 | /*Notify UMAC*/ |
| 15911 | wdiChSwitchRspCb( &wdiSwitchChRsp, pWDICtx->pRspCBUserData); |
| 15912 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15913 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15914 | }/*WDI_ProcessChannelSwitchRsp*/ |
| 15915 | |
| 15916 | |
| 15917 | /** |
| 15918 | @brief Process Config STA Rsp function (called when a response |
| 15919 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15920 | |
| 15921 | @param pWDICtx: pointer to the WLAN DAL context |
| 15922 | pEventData: pointer to the event information structure |
| 15923 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15924 | @see |
| 15925 | @return Result of the function call |
| 15926 | */ |
| 15927 | WDI_Status |
| 15928 | WDI_ProcessConfigStaRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15929 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15930 | WDI_ControlBlockType* pWDICtx, |
| 15931 | WDI_EventInfoType* pEventData |
| 15932 | ) |
| 15933 | { |
| 15934 | WDI_ConfigSTARspParamsType wdiCfgSTAParams; |
| 15935 | WDI_ConfigSTARspCb wdiConfigSTARspCb; |
| 15936 | WDI_AddStaParams wdiAddSTAParam; |
| 15937 | |
| 15938 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15939 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15940 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15941 | tConfigStaRspMsg halConfigStaRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15942 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15943 | |
| 15944 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15945 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15946 | -------------------------------------------------------------------------*/ |
| 15947 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15948 | ( NULL == pEventData->pEventData)) |
| 15949 | { |
| 15950 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15951 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15952 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15953 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15954 | } |
| 15955 | |
| 15956 | wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pWDICtx->pfncRspCB; |
| 15957 | |
| 15958 | /*------------------------------------------------------------------------- |
| 15959 | Extract response and send it to UMAC |
| 15960 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15961 | wpalMemoryCopy( &halConfigStaRsp.configStaRspParams, |
| 15962 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15963 | sizeof(halConfigStaRsp.configStaRspParams)); |
| 15964 | |
| 15965 | |
| 15966 | wdiCfgSTAParams.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx; |
| 15967 | wdiCfgSTAParams.ucBssIdx = halConfigStaRsp.configStaRspParams.bssIdx; |
| 15968 | wdiCfgSTAParams.ucUcastSig = halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 15969 | wdiCfgSTAParams.ucBcastSig = halConfigStaRsp.configStaRspParams.ucBcastSig; |
| 15970 | wdiCfgSTAParams.ucMgmtSig = halConfigStaRsp.configStaRspParams.ucMgmtSig; |
| 15971 | |
| 15972 | /* MAC Address of STA - take from cache as it does not come back in the |
| 15973 | response*/ |
| 15974 | wpalMemoryCopy( wdiCfgSTAParams.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15975 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15976 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15977 | |
| 15978 | wdiCfgSTAParams.wdiStatus = |
| 15979 | WDI_HAL_2_WDI_STATUS(halConfigStaRsp.configStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15980 | |
| 15981 | wdiCfgSTAParams.ucDpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex; |
| 15982 | wdiCfgSTAParams.ucBcastDpuIndex = halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
| 15983 | wdiCfgSTAParams.ucBcastMgmtDpuIdx = halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
| 15984 | |
| 15985 | if ( WDI_STATUS_SUCCESS == wdiCfgSTAParams.wdiStatus ) |
| 15986 | { |
| 15987 | if ( WDI_ADD_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction ) |
| 15988 | { |
| 15989 | /* ADD STA to table */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15990 | wdiAddSTAParam.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15991 | wdiAddSTAParam.dpuSig = halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 15992 | wdiAddSTAParam.dpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15993 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15994 | /*This info can be retrieved from the cached initial request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15995 | wdiAddSTAParam.ucWmmEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15996 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucWMMEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15997 | wdiAddSTAParam.ucHTCapable = |
| 15998 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucHTCapable; |
| 15999 | wdiAddSTAParam.ucStaType = |
| 16000 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiSTAType; |
| 16001 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16002 | /* MAC Address of STA */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16003 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, |
| 16004 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16005 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16006 | |
| 16007 | wpalMemoryCopy(wdiAddSTAParam.macBSSID, |
| 16008 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID , |
| 16009 | WDI_MAC_ADDR_LEN); |
| 16010 | |
| 16011 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 16012 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID, |
| 16013 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16014 | |
| 16015 | if ( NULL == pBSSSes ) |
| 16016 | { |
| 16017 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 16018 | "Association for this BSSID is not in place"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16019 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16020 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16021 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16022 | } |
| 16023 | |
| 16024 | /*Add BSS specific parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16025 | wdiAddSTAParam.bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16026 | halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16027 | wdiAddSTAParam.bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16028 | halConfigStaRsp.configStaRspParams.ucMgmtSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16029 | wdiAddSTAParam.bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16030 | halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16031 | wdiAddSTAParam.bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16032 | halConfigStaRsp.configStaRspParams.ucBcastSig; |
| 16033 | wdiAddSTAParam.ucRmfEnabled = pBSSSes->ucRmfEnabled; |
| 16034 | wdiAddSTAParam.ucBSSIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16035 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16036 | WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 16037 | } |
| 16038 | if( WDI_UPDATE_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction ) |
| 16039 | { |
| 16040 | WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable; |
| 16041 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16042 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16043 | halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16044 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16045 | halConfigStaRsp.configStaRspParams.ucBcastSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16046 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16047 | halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16048 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16049 | halConfigStaRsp.configStaRspParams.ucMgmtSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16050 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16051 | halConfigStaRsp.configStaRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16052 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16053 | halConfigStaRsp.configStaRspParams.dpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16054 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16055 | halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 16056 | } |
| 16057 | } |
| 16058 | |
| 16059 | /*Notify UMAC*/ |
| 16060 | wdiConfigSTARspCb( &wdiCfgSTAParams, pWDICtx->pRspCBUserData); |
| 16061 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16062 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16063 | }/*WDI_ProcessConfigStaRsp*/ |
| 16064 | |
| 16065 | |
| 16066 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16067 | @brief Process Set Link State Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16068 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16069 | |
| 16070 | @param pWDICtx: pointer to the WLAN DAL context |
| 16071 | pEventData: pointer to the event information structure |
| 16072 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16073 | @see |
| 16074 | @return Result of the function call |
| 16075 | */ |
| 16076 | WDI_Status |
| 16077 | WDI_ProcessSetLinkStateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16078 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16079 | WDI_ControlBlockType* pWDICtx, |
| 16080 | WDI_EventInfoType* pEventData |
| 16081 | ) |
| 16082 | { |
| 16083 | WDI_Status wdiStatus; |
| 16084 | eHalStatus halStatus; |
| 16085 | WDI_SetLinkStateRspCb wdiSetLinkStateRspCb; |
| 16086 | |
| 16087 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16088 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16089 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16090 | |
| 16091 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16092 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16093 | -------------------------------------------------------------------------*/ |
| 16094 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16095 | ( NULL == pEventData->pEventData)) |
| 16096 | { |
| 16097 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16098 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16099 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16100 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16101 | } |
| 16102 | |
| 16103 | wdiSetLinkStateRspCb = (WDI_SetLinkStateRspCb)pWDICtx->pfncRspCB; |
| 16104 | |
| 16105 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 16106 | |
| 16107 | /*If the link is being transitioned to idle - the BSS is to be deleted |
| 16108 | - this type of ending a session is possible when UMAC has failed an |
| 16109 | - association session during Join*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16110 | if ( WDI_LINK_IDLE_STATE == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16111 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState ) |
| 16112 | { |
| 16113 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16114 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16115 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16116 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 16117 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.macBSSID, |
| 16118 | &pBSSSes); |
| 16119 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16120 | /*----------------------------------------------------------------------- |
| 16121 | Del BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16122 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16123 | -----------------------------------------------------------------------*/ |
| 16124 | if ( NULL == pBSSSes ) |
| 16125 | { |
| 16126 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 16127 | "Set link response received outside association session"); |
| 16128 | } |
| 16129 | else |
| 16130 | { |
| 16131 | /* For BT AMP roles no need to delete the sessions if assoc fails. There |
| 16132 | will be del BSS coming after this to stop the beaconing & cleaning up the |
| 16133 | sessions*/ |
| 16134 | if(( WDI_BTAMP_STA_MODE != pBSSSes->wdiBssType )&& |
| 16135 | ( WDI_BTAMP_AP_MODE != pBSSSes->wdiBssType )) |
| 16136 | { |
| 16137 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16138 | The current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16139 | -----------------------------------------------------------------------*/ |
| 16140 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 16141 | |
| 16142 | /*----------------------------------------------------------------------- |
| 16143 | Check to see if this association is in progress - if so disable the |
| 16144 | flag as this has ended |
| 16145 | -----------------------------------------------------------------------*/ |
| 16146 | if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16147 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16148 | /*Association no longer in progress */ |
| 16149 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 16150 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 16151 | WDI_DequeueAssocRequest(pWDICtx); |
| 16152 | } |
| 16153 | } |
| 16154 | } |
| 16155 | } |
| 16156 | /* If the link state has been set to POST ASSOC, reset the "association in |
| 16157 | progress" flag */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16158 | if ( WDI_LINK_POSTASSOC_STATE == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16159 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState ) |
| 16160 | { |
| 16161 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 16162 | WDI_DequeueAssocRequest(pWDICtx); |
| 16163 | } |
| 16164 | |
| 16165 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 16166 | |
| 16167 | /*------------------------------------------------------------------------- |
| 16168 | Extract response and send it to UMAC |
| 16169 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16170 | wpalMemoryCopy( &halStatus, |
| 16171 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16172 | sizeof(halStatus)); |
| 16173 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16174 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16175 | |
| 16176 | /*Notify UMAC*/ |
| 16177 | wdiSetLinkStateRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16178 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16179 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16180 | }/*WDI_ProcessSetLinkStateRsp*/ |
| 16181 | |
| 16182 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16183 | @brief Process Get Stats Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16184 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16185 | |
| 16186 | @param pWDICtx: pointer to the WLAN DAL context |
| 16187 | pEventData: pointer to the event information structure |
| 16188 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16189 | @see |
| 16190 | @return Result of the function call |
| 16191 | */ |
| 16192 | WDI_Status |
| 16193 | WDI_ProcessGetStatsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16194 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16195 | WDI_ControlBlockType* pWDICtx, |
| 16196 | WDI_EventInfoType* pEventData |
| 16197 | ) |
| 16198 | { |
| 16199 | WDI_GetStatsRspParamsType *wdiGetStatsRsp; |
| 16200 | WDI_GetStatsRspCb wdiGetStatsRspCb; |
| 16201 | tHalStatsRspParams* pHalStatsRspParams; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16202 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16203 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16204 | |
| 16205 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16206 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16207 | -------------------------------------------------------------------------*/ |
| 16208 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16209 | ( NULL == pEventData->pEventData)) |
| 16210 | { |
| 16211 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16212 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16213 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16214 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16215 | } |
| 16216 | |
| 16217 | /*------------------------------------------------------------------------- |
| 16218 | Extract response and send it to UMAC |
| 16219 | -------------------------------------------------------------------------*/ |
| 16220 | pHalStatsRspParams = (tHalStatsRspParams *)pEventData->pEventData; |
| 16221 | |
| 16222 | /*allocate the stats response buffer */ |
| 16223 | wdiGetStatsRsp = (WDI_GetStatsRspParamsType *)wpalMemoryAllocate( |
| 16224 | pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams) |
| 16225 | + sizeof(WDI_GetStatsRspParamsType)); |
| 16226 | |
| 16227 | if(NULL == wdiGetStatsRsp) |
| 16228 | { |
| 16229 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 16230 | "Failed to allocate memory in Get Stats Response %x %x %x ", |
| 16231 | pWDICtx, pEventData, pEventData->pEventData); |
| 16232 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16233 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16234 | } |
| 16235 | |
| 16236 | wdiGetStatsRspCb = (WDI_GetStatsRspCb)pWDICtx->pfncRspCB; |
| 16237 | |
| 16238 | wpalMemoryZero(wdiGetStatsRsp, pHalStatsRspParams->msgLen); |
| 16239 | wdiGetStatsRsp->usMsgType = pHalStatsRspParams->msgType; |
| 16240 | wdiGetStatsRsp->usMsgLen = pHalStatsRspParams->msgLen; |
| 16241 | wdiGetStatsRsp->wdiStatus = WDI_HAL_2_WDI_STATUS(pHalStatsRspParams->status); |
| 16242 | wdiGetStatsRsp->ucSTAIdx = pHalStatsRspParams->staId; |
| 16243 | wdiGetStatsRsp->uStatsMask = pHalStatsRspParams->statsMask; |
| 16244 | |
| 16245 | /* copy the stats from buffer at the end of the tHalStatsRspParams message */ |
| 16246 | wpalMemoryCopy(wdiGetStatsRsp + 1, |
| 16247 | (wpt_uint8*)pEventData->pEventData + sizeof(tHalStatsRspParams), |
| 16248 | pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams)); |
| 16249 | |
| 16250 | /*Notify UMAC*/ |
| 16251 | wdiGetStatsRspCb( wdiGetStatsRsp, pWDICtx->pRspCBUserData); |
| 16252 | |
| 16253 | wpalMemoryFree(wdiGetStatsRsp); |
| 16254 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16255 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16256 | }/*WDI_ProcessGetStatsRsp*/ |
| 16257 | |
| 16258 | |
| 16259 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16260 | @brief Process Update Cfg Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16261 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16262 | |
| 16263 | @param pWDICtx: pointer to the WLAN DAL context |
| 16264 | pEventData: pointer to the event information structure |
| 16265 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16266 | @see |
| 16267 | @return Result of the function call |
| 16268 | */ |
| 16269 | WDI_Status |
| 16270 | WDI_ProcessUpdateCfgRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16271 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16272 | WDI_ControlBlockType* pWDICtx, |
| 16273 | WDI_EventInfoType* pEventData |
| 16274 | ) |
| 16275 | { |
| 16276 | WDI_Status wdiStatus; |
| 16277 | eHalStatus halStatus; |
| 16278 | WDI_UpdateCfgRspCb wdiUpdateCfgRspCb; |
| 16279 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16280 | |
| 16281 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16282 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16283 | -------------------------------------------------------------------------*/ |
| 16284 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16285 | ( NULL == pEventData->pEventData)) |
| 16286 | { |
| 16287 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16288 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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 | wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pWDICtx->pfncRspCB; |
| 16294 | |
| 16295 | /*------------------------------------------------------------------------- |
| 16296 | Extract response and send it to UMAC |
| 16297 | -------------------------------------------------------------------------*/ |
| 16298 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16299 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16300 | |
| 16301 | /*Notify UMAC*/ |
| 16302 | wdiUpdateCfgRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16303 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16304 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16305 | }/*WDI_ProcessUpdateCfgRsp*/ |
| 16306 | |
| 16307 | |
| 16308 | |
| 16309 | /** |
| 16310 | @brief Process Add BA Rsp function (called when a response |
| 16311 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16312 | |
| 16313 | @param pWDICtx: pointer to the WLAN DAL context |
| 16314 | pEventData: pointer to the event information structure |
| 16315 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16316 | @see |
| 16317 | @return Result of the function call |
| 16318 | */ |
| 16319 | WDI_Status |
| 16320 | WDI_ProcessAddBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16321 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16322 | WDI_ControlBlockType* pWDICtx, |
| 16323 | WDI_EventInfoType* pEventData |
| 16324 | ) |
| 16325 | { |
| 16326 | WDI_AddBARspCb wdiAddBARspCb; |
| 16327 | |
| 16328 | tAddBARspParams halAddBARsp; |
| 16329 | WDI_AddBARspinfoType wdiAddBARsp; |
| 16330 | |
| 16331 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16332 | |
| 16333 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16334 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16335 | -------------------------------------------------------------------------*/ |
| 16336 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16337 | ( NULL == pEventData->pEventData)) |
| 16338 | { |
| 16339 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16340 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16341 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16342 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16343 | } |
| 16344 | |
| 16345 | wdiAddBARspCb = (WDI_AddBARspCb)pWDICtx->pfncRspCB; |
| 16346 | |
| 16347 | /*------------------------------------------------------------------------- |
| 16348 | Extract response and send it to UMAC |
| 16349 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16350 | wpalMemoryCopy( &halAddBARsp, |
| 16351 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16352 | sizeof(halAddBARsp)); |
| 16353 | |
| 16354 | wdiAddBARsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halAddBARsp.status); |
| 16355 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 16356 | if ( WDI_STATUS_SUCCESS == wdiAddBARsp.wdiStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16357 | { |
| 16358 | wdiAddBARsp.ucBaDialogToken = halAddBARsp.baDialogToken; |
| 16359 | } |
| 16360 | |
| 16361 | /*Notify UMAC*/ |
| 16362 | wdiAddBARspCb( &wdiAddBARsp, pWDICtx->pRspCBUserData); |
| 16363 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16364 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16365 | }/*WDI_ProcessAddSessionBARsp*/ |
| 16366 | |
| 16367 | /** |
| 16368 | @brief Process Add BA Rsp function (called when a response |
| 16369 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16370 | |
| 16371 | @param pWDICtx: pointer to the WLAN DAL context |
| 16372 | pEventData: pointer to the event information structure |
| 16373 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16374 | @see |
| 16375 | @return Result of the function call |
| 16376 | */ |
| 16377 | WDI_Status |
| 16378 | WDI_ProcessTriggerBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16379 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16380 | WDI_ControlBlockType* pWDICtx, |
| 16381 | WDI_EventInfoType* pEventData |
| 16382 | ) |
| 16383 | { |
| 16384 | WDI_TriggerBARspCb wdiTriggerBARspCb; |
| 16385 | |
| 16386 | tTriggerBARspParams* halTriggerBARsp; |
| 16387 | tTriggerBaRspCandidate* halBaCandidate; |
| 16388 | WDI_TriggerBARspParamsType* wdiTriggerBARsp; |
| 16389 | WDI_TriggerBARspCandidateType* wdiTriggerBARspCandidate; |
| 16390 | wpt_uint16 index; |
| 16391 | wpt_uint16 TidIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16392 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16393 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16394 | |
| 16395 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16396 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16397 | -------------------------------------------------------------------------*/ |
| 16398 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16399 | ( NULL == pEventData->pEventData)) |
| 16400 | { |
| 16401 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16402 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16403 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16404 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16405 | } |
| 16406 | |
| 16407 | wdiTriggerBARspCb = (WDI_TriggerBARspCb)pWDICtx->pfncRspCB; |
| 16408 | |
| 16409 | /*------------------------------------------------------------------------- |
| 16410 | Extract response and send it to UMAC |
| 16411 | -------------------------------------------------------------------------*/ |
| 16412 | halTriggerBARsp = (tTriggerBARspParams *)pEventData->pEventData; |
| 16413 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16414 | wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType) + |
| 16415 | halTriggerBARsp->baCandidateCnt * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16416 | sizeof(WDI_TriggerBARspCandidateType)); |
| 16417 | if(NULL == wdiTriggerBARsp) |
| 16418 | { |
| 16419 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16420 | "Failed to allocate memory in Trigger BA Response %x %x %x ", |
| 16421 | pWDICtx, pEventData, pEventData->pEventData); |
| 16422 | wpalMemoryFree(halTriggerBARsp); |
| 16423 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16424 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16425 | } |
| 16426 | |
| 16427 | wdiTriggerBARsp->wdiStatus = WDI_HAL_2_WDI_STATUS(halTriggerBARsp->status); |
| 16428 | |
| 16429 | if ( WDI_STATUS_SUCCESS == wdiTriggerBARsp->wdiStatus) |
| 16430 | { |
| 16431 | wdiTriggerBARsp->usBaCandidateCnt = halTriggerBARsp->baCandidateCnt; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16432 | wpalMemoryCopy(wdiTriggerBARsp->macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16433 | halTriggerBARsp->bssId , WDI_MAC_ADDR_LEN); |
| 16434 | |
| 16435 | wdiTriggerBARspCandidate = (WDI_TriggerBARspCandidateType*)(wdiTriggerBARsp + 1); |
| 16436 | halBaCandidate = (tTriggerBaRspCandidate*)(halTriggerBARsp + 1); |
| 16437 | |
| 16438 | for(index = 0; index < wdiTriggerBARsp->usBaCandidateCnt; index++) |
| 16439 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16440 | wpalMemoryCopy(wdiTriggerBARspCandidate->macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16441 | halBaCandidate->staAddr, WDI_MAC_ADDR_LEN); |
| 16442 | for(TidIndex = 0; TidIndex < STA_MAX_TC; TidIndex++) |
| 16443 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16444 | wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].fBaEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16445 | halBaCandidate->baInfo[TidIndex].fBaEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16446 | wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].startingSeqNum = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16447 | halBaCandidate->baInfo[TidIndex].startingSeqNum; |
| 16448 | } |
| 16449 | wdiTriggerBARspCandidate++; |
| 16450 | halBaCandidate++; |
| 16451 | } |
| 16452 | } |
| 16453 | |
| 16454 | /*Notify UMAC*/ |
| 16455 | wdiTriggerBARspCb( wdiTriggerBARsp, pWDICtx->pRspCBUserData); |
| 16456 | |
| 16457 | wpalMemoryFree(wdiTriggerBARsp); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16458 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16459 | }/*WDI_ProcessAddSessionBARsp*/ |
| 16460 | |
| 16461 | /** |
| 16462 | @brief Process Update Beacon Params Rsp function (called when a response |
| 16463 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16464 | |
| 16465 | @param pWDICtx: pointer to the WLAN DAL context |
| 16466 | pEventData: pointer to the event information structure |
| 16467 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16468 | @see |
| 16469 | @return Result of the function call |
| 16470 | */ |
| 16471 | WDI_Status |
| 16472 | WDI_ProcessUpdateBeaconParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16473 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16474 | WDI_ControlBlockType* pWDICtx, |
| 16475 | WDI_EventInfoType* pEventData |
| 16476 | ) |
| 16477 | { |
| 16478 | WDI_Status wdiStatus; |
| 16479 | eHalStatus halStatus; |
| 16480 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb; |
| 16481 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16482 | |
| 16483 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16484 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16485 | -------------------------------------------------------------------------*/ |
| 16486 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16487 | ( NULL == pEventData->pEventData)) |
| 16488 | { |
| 16489 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16490 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16491 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16492 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16493 | } |
| 16494 | |
| 16495 | wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pWDICtx->pfncRspCB; |
| 16496 | |
| 16497 | /*------------------------------------------------------------------------- |
| 16498 | Extract response and send it to UMAC |
| 16499 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16500 | wpalMemoryCopy( &halStatus, |
| 16501 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16502 | sizeof(halStatus)); |
| 16503 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16504 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16505 | |
| 16506 | /*Notify UMAC*/ |
| 16507 | wdiUpdateBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16508 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16509 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16510 | }/*WDI_ProcessUpdateBeaconParamsRsp*/ |
| 16511 | |
| 16512 | /** |
| 16513 | @brief Process Send Beacon template Rsp function (called when a response |
| 16514 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16515 | |
| 16516 | @param pWDICtx: pointer to the WLAN DAL context |
| 16517 | pEventData: pointer to the event information structure |
| 16518 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16519 | @see |
| 16520 | @return Result of the function call |
| 16521 | */ |
| 16522 | WDI_Status |
| 16523 | WDI_ProcessSendBeaconParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16524 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16525 | WDI_ControlBlockType* pWDICtx, |
| 16526 | WDI_EventInfoType* pEventData |
| 16527 | ) |
| 16528 | { |
| 16529 | WDI_Status wdiStatus; |
| 16530 | eHalStatus halStatus; |
| 16531 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb; |
| 16532 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16533 | |
| 16534 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16535 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16536 | -------------------------------------------------------------------------*/ |
| 16537 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16538 | ( NULL == pEventData->pEventData)) |
| 16539 | { |
| 16540 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16541 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16542 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16543 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16544 | } |
| 16545 | |
| 16546 | wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pWDICtx->pfncRspCB; |
| 16547 | |
| 16548 | /*------------------------------------------------------------------------- |
| 16549 | Extract response and send it to UMAC |
| 16550 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16551 | wpalMemoryCopy( &halStatus, |
| 16552 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16553 | sizeof(halStatus)); |
| 16554 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16555 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16556 | |
| 16557 | /*Notify UMAC*/ |
| 16558 | wdiSendBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16559 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16560 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16561 | }/*WDI_ProcessSendBeaconParamsRsp*/ |
| 16562 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16563 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16564 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16565 | @brief Process Update Probe Resp Template Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16566 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16567 | |
| 16568 | @param pWDICtx: pointer to the WLAN DAL context |
| 16569 | pEventData: pointer to the event information structure |
| 16570 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16571 | @see |
| 16572 | @return Result of the function call |
| 16573 | */ |
| 16574 | WDI_Status |
| 16575 | WDI_ProcessUpdateProbeRspTemplateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16576 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16577 | WDI_ControlBlockType* pWDICtx, |
| 16578 | WDI_EventInfoType* pEventData |
| 16579 | ) |
| 16580 | { |
| 16581 | WDI_Status wdiStatus; |
| 16582 | eHalStatus halStatus; |
| 16583 | WDI_UpdateProbeRspTemplateRspCb wdiUpdProbeRspTemplRspCb; |
| 16584 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16585 | |
| 16586 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16587 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16588 | -------------------------------------------------------------------------*/ |
| 16589 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16590 | ( NULL == pEventData->pEventData)) |
| 16591 | { |
| 16592 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16593 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16594 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16595 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16596 | } |
| 16597 | |
| 16598 | wdiUpdProbeRspTemplRspCb = (WDI_UpdateProbeRspTemplateRspCb)pWDICtx->pfncRspCB; |
| 16599 | |
| 16600 | /*------------------------------------------------------------------------- |
| 16601 | Extract response and send it to UMAC |
| 16602 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16603 | wpalMemoryCopy( &halStatus, |
| 16604 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16605 | sizeof(halStatus)); |
| 16606 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16607 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16608 | |
| 16609 | /*Notify UMAC*/ |
| 16610 | wdiUpdProbeRspTemplRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16611 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16612 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16613 | }/*WDI_ProcessUpdateProbeRspTemplateRsp*/ |
| 16614 | |
| 16615 | /** |
| 16616 | @brief Process Set Max Tx Power Rsp function (called when a response |
| 16617 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16618 | |
| 16619 | @param pWDICtx: pointer to the WLAN DAL context |
| 16620 | pEventData: pointer to the event information structure |
| 16621 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16622 | @see |
| 16623 | @return Result of the function call |
| 16624 | */ |
| 16625 | WDI_Status |
| 16626 | WDI_ProcessSetMaxTxPowerRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16627 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16628 | WDI_ControlBlockType* pWDICtx, |
| 16629 | WDI_EventInfoType* pEventData |
| 16630 | ) |
| 16631 | { |
| 16632 | tSetMaxTxPwrRspMsg halTxpowerrsp; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16633 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16634 | WDI_SetMaxTxPowerRspMsg wdiSetMaxTxPowerRspMsg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16635 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16636 | WDA_SetMaxTxPowerRspCb wdiReqStatusCb; |
| 16637 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16638 | |
| 16639 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16640 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16641 | -------------------------------------------------------------------------*/ |
| 16642 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16643 | ( NULL == pEventData->pEventData)) |
| 16644 | { |
| 16645 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16646 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16647 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16648 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16649 | } |
| 16650 | |
| 16651 | wdiReqStatusCb = (WDA_SetMaxTxPowerRspCb)pWDICtx->pfncRspCB; |
| 16652 | |
| 16653 | /*------------------------------------------------------------------------- |
| 16654 | Extract response and send it to UMAC |
| 16655 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16656 | wpalMemoryCopy( &halTxpowerrsp.setMaxTxPwrRspParams, |
| 16657 | pEventData->pEventData, |
| 16658 | sizeof(halTxpowerrsp.setMaxTxPwrRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16659 | |
| 16660 | if ( eHAL_STATUS_SUCCESS != halTxpowerrsp.setMaxTxPwrRspParams.status ) |
| 16661 | { |
| 16662 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 16663 | "Error status returned in Set Max Tx Power Response "); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16664 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 16665 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16666 | } |
| 16667 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16668 | wdiSetMaxTxPowerRspMsg.wdiStatus = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16669 | WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setMaxTxPwrRspParams.status); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16670 | wdiSetMaxTxPowerRspMsg.ucPower = halTxpowerrsp.setMaxTxPwrRspParams.power; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16671 | |
| 16672 | /*Notify UMAC*/ |
| 16673 | wdiReqStatusCb( &wdiSetMaxTxPowerRspMsg, pWDICtx->pRspCBUserData); |
| 16674 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16675 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16676 | } |
| 16677 | |
| 16678 | #ifdef WLAN_FEATURE_P2P |
| 16679 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16680 | @brief Process P2P Group Owner Notice Of Absense Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16681 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16682 | |
| 16683 | @param pWDICtx: pointer to the WLAN DAL context |
| 16684 | pEventData: pointer to the event information structure |
| 16685 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16686 | @see |
| 16687 | @return Result of the function call |
| 16688 | */ |
| 16689 | WDI_Status |
| 16690 | WDI_ProcessP2PGONOARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16691 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16692 | WDI_ControlBlockType* pWDICtx, |
| 16693 | WDI_EventInfoType* pEventData |
| 16694 | ) |
| 16695 | { |
| 16696 | WDI_Status wdiStatus; |
| 16697 | eHalStatus halStatus; |
| 16698 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb; |
| 16699 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16700 | |
| 16701 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16702 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16703 | -------------------------------------------------------------------------*/ |
| 16704 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16705 | ( NULL == pEventData->pEventData)) |
| 16706 | { |
| 16707 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16708 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16709 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16710 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16711 | } |
| 16712 | |
| 16713 | wdiP2PGONOAReqParamsRspCb = (WDI_SetP2PGONOAReqParamsRspCb)pWDICtx->pfncRspCB; |
| 16714 | |
| 16715 | /*------------------------------------------------------------------------- |
| 16716 | Extract response and send it to UMAC |
| 16717 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16718 | wpalMemoryCopy( &halStatus, |
| 16719 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16720 | sizeof(halStatus)); |
| 16721 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16722 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16723 | |
| 16724 | /*Notify UMAC*/ |
| 16725 | wdiP2PGONOAReqParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16726 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16727 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16728 | }/*WDI_ProcessP2PGONOARsp*/ |
| 16729 | #endif |
| 16730 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16731 | @brief Process Enter IMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16732 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16733 | |
| 16734 | @param pWDICtx: pointer to the WLAN DAL context |
| 16735 | pEventData: pointer to the event information structure |
| 16736 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16737 | @see |
| 16738 | @return Result of the function call |
| 16739 | */ |
| 16740 | WDI_Status |
| 16741 | WDI_ProcessEnterImpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16742 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16743 | WDI_ControlBlockType* pWDICtx, |
| 16744 | WDI_EventInfoType* pEventData |
| 16745 | ) |
| 16746 | { |
| 16747 | WDI_Status wdiStatus; |
| 16748 | eHalStatus halStatus; |
| 16749 | WDI_EnterImpsRspCb wdiEnterImpsRspCb; |
| 16750 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16751 | |
| 16752 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16753 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16754 | -------------------------------------------------------------------------*/ |
| 16755 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16756 | ( NULL == pEventData->pEventData)) |
| 16757 | { |
| 16758 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16759 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16760 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16761 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16762 | } |
| 16763 | |
| 16764 | wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pWDICtx->pfncRspCB; |
| 16765 | |
| 16766 | /*------------------------------------------------------------------------- |
| 16767 | Extract response and send it to UMAC |
| 16768 | -------------------------------------------------------------------------*/ |
| 16769 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 16770 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16771 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16772 | |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 16773 | /* If IMPS req failed, riva is not power collapsed Put the DXE in FULL state. |
| 16774 | * Other module states are taken care by PMC. |
| 16775 | * TODO: How do we take care of the case where IMPS is success, but riva power collapse fails?? |
| 16776 | */ |
| 16777 | if (wdiStatus != WDI_STATUS_SUCCESS) { |
| 16778 | |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 16779 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 16780 | "WDI Process Enter IMPS RSP failed With HAL Status Code: %d", |
| 16781 | halStatus); |
| 16782 | /* Call Back is not required as we are putting the DXE in FULL |
| 16783 | * and riva is already in full (IMPS RSP Failed)*/ |
| 16784 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 16785 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16786 | /*Notify UMAC*/ |
| 16787 | wdiEnterImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16788 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16789 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16790 | }/*WDI_ProcessEnterImpsRsp*/ |
| 16791 | |
| 16792 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16793 | @brief Process Exit IMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16794 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16795 | |
| 16796 | @param pWDICtx: pointer to the WLAN DAL context |
| 16797 | pEventData: pointer to the event information structure |
| 16798 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16799 | @see |
| 16800 | @return Result of the function call |
| 16801 | */ |
| 16802 | WDI_Status |
| 16803 | WDI_ProcessExitImpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16804 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16805 | WDI_ControlBlockType* pWDICtx, |
| 16806 | WDI_EventInfoType* pEventData |
| 16807 | ) |
| 16808 | { |
| 16809 | WDI_Status wdiStatus; |
| 16810 | eHalStatus halStatus; |
| 16811 | WDI_ExitImpsRspCb wdiExitImpsRspCb; |
| 16812 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16813 | |
| 16814 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16815 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16816 | -------------------------------------------------------------------------*/ |
| 16817 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16818 | ( NULL == pEventData->pEventData)) |
| 16819 | { |
| 16820 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16821 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16822 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16823 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16824 | } |
| 16825 | |
| 16826 | wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pWDICtx->pfncRspCB; |
| 16827 | |
| 16828 | /*------------------------------------------------------------------------- |
| 16829 | Extract response and send it to UMAC |
| 16830 | -------------------------------------------------------------------------*/ |
| 16831 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16832 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16833 | |
| 16834 | // notify DTS that we are entering Full power |
| 16835 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 16836 | |
| 16837 | /*Notify UMAC*/ |
| 16838 | wdiExitImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16839 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16840 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16841 | }/*WDI_ProcessExitImpsRsp*/ |
| 16842 | |
| 16843 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16844 | @brief Process Enter BMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16845 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16846 | |
| 16847 | @param pWDICtx: pointer to the WLAN DAL context |
| 16848 | pEventData: pointer to the event information structure |
| 16849 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16850 | @see |
| 16851 | @return Result of the function call |
| 16852 | */ |
| 16853 | WDI_Status |
| 16854 | WDI_ProcessEnterBmpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16855 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16856 | WDI_ControlBlockType* pWDICtx, |
| 16857 | WDI_EventInfoType* pEventData |
| 16858 | ) |
| 16859 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16860 | eHalStatus halStatus = eHAL_STATUS_FAILURE; |
| 16861 | tHalEnterBmpsRspParams halEnterBmpsRsp; |
| 16862 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb; |
| 16863 | WDI_EnterBmpsRspParamsType wdiEnterBmpsRspparams; |
| 16864 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16865 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16866 | |
| 16867 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16868 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16869 | -------------------------------------------------------------------------*/ |
| 16870 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16871 | ( NULL == pEventData->pEventData)) |
| 16872 | { |
| 16873 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16874 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16875 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16876 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16877 | } |
| 16878 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16879 | /*------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16880 | Extract response and send it to UMAC |
| 16881 | -------------------------------------------------------------------------*/ |
| 16882 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 16883 | { |
| 16884 | wpalMemoryCopy( &halEnterBmpsRsp, |
| 16885 | pEventData->pEventData, |
| 16886 | sizeof(halEnterBmpsRsp)); |
| 16887 | |
| 16888 | //Used to print debug message |
| 16889 | halStatus = halEnterBmpsRsp.status; |
| 16890 | wdiEnterBmpsRspparams.wdiStatus = WDI_HAL_2_WDI_STATUS(halEnterBmpsRsp.status); |
| 16891 | wdiEnterBmpsRspparams.bssIdx = halEnterBmpsRsp.bssIdx; |
| 16892 | } |
| 16893 | else |
| 16894 | { |
| 16895 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 16896 | wdiEnterBmpsRspparams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 16897 | } |
| 16898 | |
| 16899 | wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16900 | |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 16901 | /* If BMPS req failed, riva is not power collapsed put the DXE in FULL state. |
| 16902 | * Other module states are taken care by PMC. |
| 16903 | * TODO: How do we take care of the case where BMPS is success, but riva power collapse fails?? |
| 16904 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16905 | if (wdiEnterBmpsRspparams.wdiStatus != WDI_STATUS_SUCCESS) |
| 16906 | { |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 16907 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16908 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 16909 | "WDI Process Enter BMPS RSP failed With HAL Status Code: %d", |
| 16910 | halStatus); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16911 | /* Call Back is not required as we are putting the DXE in FULL |
| 16912 | * and riva is already in FULL (BMPS RSP Failed)*/ |
| 16913 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 16914 | pWDICtx->bInBmps = eWLAN_PAL_FALSE; |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 16915 | } |
| 16916 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16917 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16918 | wdiEnterBmpsRspCb( &wdiEnterBmpsRspparams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16919 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16920 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16921 | }/*WDI_ProcessEnterBmpsRsp*/ |
| 16922 | |
| 16923 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16924 | @brief Process Exit BMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16925 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16926 | |
| 16927 | @param pWDICtx: pointer to the WLAN DAL context |
| 16928 | pEventData: pointer to the event information structure |
| 16929 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16930 | @see |
| 16931 | @return Result of the function call |
| 16932 | */ |
| 16933 | WDI_Status |
| 16934 | WDI_ProcessExitBmpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16935 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16936 | WDI_ControlBlockType* pWDICtx, |
| 16937 | WDI_EventInfoType* pEventData |
| 16938 | ) |
| 16939 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16940 | eHalStatus halStatus; |
| 16941 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16942 | tHalExitBmpsRspParams halExitBmpsRsp; |
| 16943 | WDI_ExitBmpsRspParamsType wdiExitBmpsRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16944 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16945 | |
| 16946 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16947 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16948 | -------------------------------------------------------------------------*/ |
| 16949 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16950 | ( NULL == pEventData->pEventData)) |
| 16951 | { |
| 16952 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16953 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16954 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16955 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16956 | } |
| 16957 | |
| 16958 | wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pWDICtx->pfncRspCB; |
| 16959 | |
| 16960 | /*------------------------------------------------------------------------- |
| 16961 | Extract response and send it to UMAC |
| 16962 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16963 | |
| 16964 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 16965 | { |
| 16966 | wpalMemoryCopy( &halExitBmpsRsp, |
| 16967 | pEventData->pEventData, |
| 16968 | sizeof(halExitBmpsRsp)); |
| 16969 | |
| 16970 | wdiExitBmpsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halExitBmpsRsp.status); |
| 16971 | wdiExitBmpsRspParams.bssIdx = halExitBmpsRsp.bssIdx; |
| 16972 | } |
| 16973 | else |
| 16974 | { |
| 16975 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 16976 | wdiExitBmpsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 16977 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16978 | |
| 16979 | // notify DTS that we are entering Full power |
| 16980 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 16981 | |
| 16982 | pWDICtx->bInBmps = eWLAN_PAL_FALSE; |
| 16983 | |
| 16984 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16985 | wdiExitBmpsRspCb( &wdiExitBmpsRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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_ProcessExitBmpsRsp*/ |
| 16989 | |
| 16990 | /** |
| 16991 | @brief Process Enter UAPSD Rsp function (called when a response |
| 16992 | 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_ProcessEnterUapsdRsp |
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 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17007 | eHalStatus halStatus; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17008 | tUapsdRspParams halEnterUapsdRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17009 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17010 | WDI_EnterUapsdRspParamsType wdiEnterUapsdRspParams; |
| 17011 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17012 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17013 | |
| 17014 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17015 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17016 | -------------------------------------------------------------------------*/ |
| 17017 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17018 | ( NULL == pEventData->pEventData)) |
| 17019 | { |
| 17020 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17021 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17022 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17023 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17024 | } |
| 17025 | |
| 17026 | wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pWDICtx->pfncRspCB; |
| 17027 | |
| 17028 | /*------------------------------------------------------------------------- |
| 17029 | Extract response and send it to UMAC |
| 17030 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17031 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17032 | { |
| 17033 | wpalMemoryCopy( &halEnterUapsdRsp, |
| 17034 | pEventData->pEventData, |
| 17035 | sizeof(halEnterUapsdRsp)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17036 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17037 | wdiEnterUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halEnterUapsdRsp.status); |
| 17038 | wdiEnterUapsdRspParams.bssIdx = halEnterUapsdRsp.bssIdx; |
| 17039 | } |
| 17040 | else |
| 17041 | { |
| 17042 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17043 | wdiEnterUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17044 | } |
| 17045 | |
| 17046 | if(WDI_STATUS_SUCCESS == wdiEnterUapsdRspParams.wdiStatus) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17047 | { |
| 17048 | // Set the DPU routing flag to the FW WQ, all the TX frames would be now pushed |
| 17049 | // from DPU to the FW-WQ (5) in UAPSD. FW would be in data path, monitoring |
| 17050 | // the traffic to decide when to suspend the trigger frames when there is no traffic |
| 17051 | // activity on the trigger enabled ACs |
| 17052 | pWDICtx->ucDpuRF = BMUWQ_FW_DPU_TX; |
| 17053 | |
| 17054 | #ifdef WLAN_PERF |
| 17055 | // Increment the BD signature to refresh the fast path BD utilization |
| 17056 | pWDICtx->uBdSigSerialNum++; |
| 17057 | #endif |
| 17058 | } |
| 17059 | |
| 17060 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17061 | wdiEnterUapsdRspCb( &wdiEnterUapsdRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17062 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17063 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17064 | }/*WDI_ProcessEnterUapsdRsp*/ |
| 17065 | |
| 17066 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17067 | @brief Process Exit UAPSD Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17068 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17069 | |
| 17070 | @param pWDICtx: pointer to the WLAN DAL context |
| 17071 | pEventData: pointer to the event information structure |
| 17072 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17073 | @see |
| 17074 | @return Result of the function call |
| 17075 | */ |
| 17076 | WDI_Status |
| 17077 | WDI_ProcessExitUapsdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17078 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17079 | WDI_ControlBlockType* pWDICtx, |
| 17080 | WDI_EventInfoType* pEventData |
| 17081 | ) |
| 17082 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17083 | eHalStatus halStatus; |
| 17084 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17085 | tHalExitUapsdRspParams halExitUapsdRsp; |
| 17086 | WDI_ExitUapsdRspParamsType wdiExitUapsdRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17087 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17088 | |
| 17089 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17090 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17091 | -------------------------------------------------------------------------*/ |
| 17092 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17093 | ( NULL == pEventData->pEventData)) |
| 17094 | { |
| 17095 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17096 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17097 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17098 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17099 | } |
| 17100 | |
| 17101 | wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pWDICtx->pfncRspCB; |
| 17102 | |
| 17103 | /*------------------------------------------------------------------------- |
| 17104 | Extract response and send it to UMAC |
| 17105 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17106 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17107 | { |
| 17108 | wpalMemoryCopy( &halExitUapsdRsp, |
| 17109 | pEventData->pEventData, |
| 17110 | sizeof(halExitUapsdRsp)); |
| 17111 | |
| 17112 | wdiExitUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halExitUapsdRsp.status); |
| 17113 | wdiExitUapsdRspParams.bssIdx = halExitUapsdRsp.bssIdx; |
| 17114 | } |
| 17115 | else |
| 17116 | { |
| 17117 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17118 | wdiExitUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17119 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17120 | // Restore back the DPU routing flag in the TxBD, for DPU to push the TxBDs to BTQM |
| 17121 | // directly instead of the FW WQ. |
| 17122 | pWDICtx->ucDpuRF = BMUWQ_BTQM_TX_MGMT; |
| 17123 | |
| 17124 | #ifdef WLAN_PERF |
| 17125 | // Increment the BD signature to refresh the fast path BD utilization |
| 17126 | pWDICtx->uBdSigSerialNum++; |
| 17127 | #endif |
| 17128 | |
| 17129 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17130 | wdiExitUapsdRspCb( &wdiExitUapsdRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17131 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17132 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17133 | }/*WDI_ProcessExitUapsdRsp*/ |
| 17134 | |
| 17135 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17136 | @brief Process set UAPSD params Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17137 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17138 | |
| 17139 | @param pWDICtx: pointer to the WLAN DAL context |
| 17140 | pEventData: pointer to the event information structure |
| 17141 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17142 | @see |
| 17143 | @return Result of the function call |
| 17144 | */ |
| 17145 | WDI_Status |
| 17146 | WDI_ProcessSetUapsdAcParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17147 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17148 | WDI_ControlBlockType* pWDICtx, |
| 17149 | WDI_EventInfoType* pEventData |
| 17150 | ) |
| 17151 | { |
| 17152 | WDI_Status wdiStatus; |
| 17153 | eHalStatus halStatus; |
| 17154 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb; |
| 17155 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17156 | |
| 17157 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17158 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17159 | -------------------------------------------------------------------------*/ |
| 17160 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17161 | ( NULL == pEventData->pEventData)) |
| 17162 | { |
| 17163 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17164 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17165 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17166 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17167 | } |
| 17168 | |
| 17169 | wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pWDICtx->pfncRspCB; |
| 17170 | |
| 17171 | /*------------------------------------------------------------------------- |
| 17172 | Extract response and send it to UMAC |
| 17173 | -------------------------------------------------------------------------*/ |
| 17174 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17175 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17176 | |
| 17177 | /*Notify UMAC*/ |
| 17178 | wdiSetUapsdAcParamsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17179 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17180 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17181 | }/*WDI_ProcessSetUapsdAcParamsRsp*/ |
| 17182 | |
| 17183 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17184 | @brief Process update UAPSD params Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17185 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17186 | |
| 17187 | @param pWDICtx: pointer to the WLAN DAL context |
| 17188 | pEventData: pointer to the event information structure |
| 17189 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17190 | @see |
| 17191 | @return Result of the function call |
| 17192 | */ |
| 17193 | WDI_Status |
| 17194 | WDI_ProcessUpdateUapsdParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17195 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17196 | WDI_ControlBlockType* pWDICtx, |
| 17197 | WDI_EventInfoType* pEventData |
| 17198 | ) |
| 17199 | { |
| 17200 | WDI_Status wdiStatus; |
| 17201 | eHalStatus halStatus; |
| 17202 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb; |
| 17203 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17204 | |
| 17205 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17206 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17207 | -------------------------------------------------------------------------*/ |
| 17208 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17209 | ( NULL == pEventData->pEventData)) |
| 17210 | { |
| 17211 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17212 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17213 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17214 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17215 | } |
| 17216 | |
| 17217 | wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pWDICtx->pfncRspCB; |
| 17218 | |
| 17219 | /*------------------------------------------------------------------------- |
| 17220 | Extract response and send it to UMAC |
| 17221 | -------------------------------------------------------------------------*/ |
| 17222 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17223 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17224 | |
| 17225 | /*Notify UMAC*/ |
| 17226 | wdiUpdateUapsdParamsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17227 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17228 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17229 | }/*WDI_ProcessUpdateUapsdParamsRsp*/ |
| 17230 | |
| 17231 | /** |
| 17232 | @brief Process Configure RXP filter Rsp function (called when a |
| 17233 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17234 | |
| 17235 | @param pWDICtx: pointer to the WLAN DAL context |
| 17236 | pEventData: pointer to the event information structure |
| 17237 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17238 | @see |
| 17239 | @return Result of the function call |
| 17240 | */ |
| 17241 | WDI_Status |
| 17242 | WDI_ProcessConfigureRxpFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17243 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17244 | WDI_ControlBlockType* pWDICtx, |
| 17245 | WDI_EventInfoType* pEventData |
| 17246 | ) |
| 17247 | { |
| 17248 | WDI_Status wdiStatus; |
| 17249 | eHalStatus halStatus; |
| 17250 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb; |
| 17251 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17252 | |
| 17253 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17254 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17255 | -------------------------------------------------------------------------*/ |
| 17256 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17257 | ( NULL == pEventData->pEventData)) |
| 17258 | { |
| 17259 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17260 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17261 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17262 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17263 | } |
| 17264 | |
| 17265 | wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pWDICtx->pfncRspCB; |
| 17266 | |
| 17267 | /*------------------------------------------------------------------------- |
| 17268 | Extract response and send it to UMAC |
| 17269 | -------------------------------------------------------------------------*/ |
| 17270 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17271 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17272 | |
| 17273 | /*Notify UMAC*/ |
| 17274 | wdiConfigureRxpFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17275 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17276 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17277 | }/*WDI_ProcessConfigureRxpFilterRsp*/ |
| 17278 | |
| 17279 | /** |
| 17280 | @brief Process Set beacon filter Rsp function (called when a |
| 17281 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17282 | |
| 17283 | @param pWDICtx: pointer to the WLAN DAL context |
| 17284 | pEventData: pointer to the event information structure |
| 17285 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17286 | @see |
| 17287 | @return Result of the function call |
| 17288 | */ |
| 17289 | WDI_Status |
| 17290 | WDI_ProcessSetBeaconFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17291 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17292 | WDI_ControlBlockType* pWDICtx, |
| 17293 | WDI_EventInfoType* pEventData |
| 17294 | ) |
| 17295 | { |
| 17296 | WDI_Status wdiStatus; |
| 17297 | eHalStatus halStatus; |
| 17298 | WDI_SetBeaconFilterCb wdiBeaconFilterCb; |
| 17299 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17300 | |
| 17301 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17302 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17303 | -------------------------------------------------------------------------*/ |
| 17304 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17305 | ( NULL == pEventData->pEventData)) |
| 17306 | { |
| 17307 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17308 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17309 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17310 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17311 | } |
| 17312 | |
| 17313 | wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pWDICtx->pfncRspCB; |
| 17314 | |
| 17315 | /*------------------------------------------------------------------------- |
| 17316 | Extract response and send it to UMAC |
| 17317 | -------------------------------------------------------------------------*/ |
| 17318 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17319 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17320 | |
| 17321 | /*Notify UMAC*/ |
| 17322 | wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17323 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17324 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17325 | }/*WDI_ProcessSetBeaconFilterRsp*/ |
| 17326 | |
| 17327 | /** |
| 17328 | @brief Process remove beacon filter Rsp function (called when a |
| 17329 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17330 | |
| 17331 | @param pWDICtx: pointer to the WLAN DAL context |
| 17332 | pEventData: pointer to the event information structure |
| 17333 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17334 | @see |
| 17335 | @return Result of the function call |
| 17336 | */ |
| 17337 | WDI_Status |
| 17338 | WDI_ProcessRemBeaconFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17339 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17340 | WDI_ControlBlockType* pWDICtx, |
| 17341 | WDI_EventInfoType* pEventData |
| 17342 | ) |
| 17343 | { |
| 17344 | WDI_Status wdiStatus; |
| 17345 | eHalStatus halStatus; |
| 17346 | WDI_RemBeaconFilterCb wdiBeaconFilterCb; |
| 17347 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17348 | |
| 17349 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17350 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17351 | -------------------------------------------------------------------------*/ |
| 17352 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17353 | ( NULL == pEventData->pEventData)) |
| 17354 | { |
| 17355 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17356 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17357 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17358 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17359 | } |
| 17360 | |
| 17361 | wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pWDICtx->pfncRspCB; |
| 17362 | |
| 17363 | /*------------------------------------------------------------------------- |
| 17364 | Extract response and send it to UMAC |
| 17365 | -------------------------------------------------------------------------*/ |
| 17366 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17367 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17368 | |
| 17369 | /*Notify UMAC*/ |
| 17370 | wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17371 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17372 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17373 | }/*WDI_ProcessRemBeaconFilterRsp*/ |
| 17374 | |
| 17375 | /** |
| 17376 | @brief Process set RSSI thresholds Rsp function (called when a |
| 17377 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17378 | |
| 17379 | @param pWDICtx: pointer to the WLAN DAL context |
| 17380 | pEventData: pointer to the event information structure |
| 17381 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17382 | @see |
| 17383 | @return Result of the function call |
| 17384 | */ |
| 17385 | WDI_Status |
| 17386 | WDI_ProcessSetRSSIThresoldsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17387 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17388 | WDI_ControlBlockType* pWDICtx, |
| 17389 | WDI_EventInfoType* pEventData |
| 17390 | ) |
| 17391 | { |
| 17392 | WDI_Status wdiStatus; |
| 17393 | eHalStatus halStatus; |
| 17394 | WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb; |
| 17395 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17396 | |
| 17397 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17398 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17399 | -------------------------------------------------------------------------*/ |
| 17400 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17401 | ( NULL == pEventData->pEventData)) |
| 17402 | { |
| 17403 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17404 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17405 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17406 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17407 | } |
| 17408 | |
| 17409 | wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pWDICtx->pfncRspCB; |
| 17410 | |
| 17411 | /*------------------------------------------------------------------------- |
| 17412 | Extract response and send it to UMAC |
| 17413 | -------------------------------------------------------------------------*/ |
| 17414 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17415 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17416 | |
| 17417 | /*Notify UMAC*/ |
| 17418 | wdiRSSIThresholdsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17419 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17420 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17421 | }/*WDI_ProcessSetRSSIThresoldsRsp*/ |
| 17422 | |
| 17423 | /** |
| 17424 | @brief Process host offload Rsp function (called when a |
| 17425 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17426 | |
| 17427 | @param pWDICtx: pointer to the WLAN DAL context |
| 17428 | pEventData: pointer to the event information structure |
| 17429 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17430 | @see |
| 17431 | @return Result of the function call |
| 17432 | */ |
| 17433 | WDI_Status |
| 17434 | WDI_ProcessHostOffloadRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17435 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17436 | WDI_ControlBlockType* pWDICtx, |
| 17437 | WDI_EventInfoType* pEventData |
| 17438 | ) |
| 17439 | { |
| 17440 | WDI_Status wdiStatus; |
| 17441 | eHalStatus halStatus; |
| 17442 | WDI_HostOffloadCb wdiHostOffloadCb; |
| 17443 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17444 | |
| 17445 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17446 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17447 | -------------------------------------------------------------------------*/ |
| 17448 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17449 | ( NULL == pEventData->pEventData)) |
| 17450 | { |
| 17451 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17452 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17453 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17454 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17455 | } |
| 17456 | |
| 17457 | wdiHostOffloadCb = (WDI_HostOffloadCb)pWDICtx->pfncRspCB; |
| 17458 | |
| 17459 | /*------------------------------------------------------------------------- |
| 17460 | Extract response and send it to UMAC |
| 17461 | -------------------------------------------------------------------------*/ |
| 17462 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17463 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17464 | |
| 17465 | /*Notify UMAC*/ |
| 17466 | wdiHostOffloadCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17467 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17468 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17469 | }/*WDI_ProcessHostOffloadRsp*/ |
| 17470 | |
| 17471 | /** |
| 17472 | @brief Process keep alive Rsp function (called when a |
| 17473 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17474 | |
| 17475 | @param pWDICtx: pointer to the WLAN DAL context |
| 17476 | pEventData: pointer to the event information structure |
| 17477 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17478 | @see |
| 17479 | @return Result of the function call |
| 17480 | */ |
| 17481 | WDI_Status |
| 17482 | WDI_ProcessKeepAliveRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17483 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17484 | WDI_ControlBlockType* pWDICtx, |
| 17485 | WDI_EventInfoType* pEventData |
| 17486 | ) |
| 17487 | { |
| 17488 | WDI_Status wdiStatus; |
| 17489 | eHalStatus halStatus; |
| 17490 | WDI_KeepAliveCb wdiKeepAliveCb; |
| 17491 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17492 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 17493 | "Received WDI_ProcessKeepAliveRsp Callback from HAL"); |
| 17494 | |
| 17495 | |
| 17496 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17497 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17498 | -------------------------------------------------------------------------*/ |
| 17499 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17500 | ( NULL == pEventData->pEventData)) |
| 17501 | { |
| 17502 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17503 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17504 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17505 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17506 | } |
| 17507 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17508 | wdiKeepAliveCb = (WDI_KeepAliveCb)pWDICtx->pfncRspCB; |
| 17509 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17510 | /*------------------------------------------------------------------------- |
| 17511 | Extract response and send it to UMAC |
| 17512 | -------------------------------------------------------------------------*/ |
| 17513 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17514 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17515 | |
| 17516 | /*Notify UMAC*/ |
| 17517 | wdiKeepAliveCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17518 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17519 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17520 | }/*WDI_ProcessKeepAliveRsp*/ |
| 17521 | |
| 17522 | /** |
| 17523 | @brief Process wowl add ptrn Rsp function (called when a |
| 17524 | response is being received over the bus 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_ProcessWowlAddBcPtrnRsp |
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 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17539 | eHalStatus halStatus; |
| 17540 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17541 | tHalAddWowlBcastPtrnRspParams halAddWowlBcastPtrRsp; |
| 17542 | WDI_WowlAddBcPtrnRspParamsType wdiWowlAddBcPtrRsp; |
| 17543 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17544 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17545 | |
| 17546 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17547 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17548 | -------------------------------------------------------------------------*/ |
| 17549 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17550 | ( NULL == pEventData->pEventData)) |
| 17551 | { |
| 17552 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17553 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17554 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17555 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17556 | } |
| 17557 | |
| 17558 | wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pWDICtx->pfncRspCB; |
| 17559 | |
| 17560 | /*------------------------------------------------------------------------- |
| 17561 | Extract response and send it to UMAC |
| 17562 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17563 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17564 | { |
| 17565 | wpalMemoryCopy( &halAddWowlBcastPtrRsp, |
| 17566 | pEventData->pEventData, |
| 17567 | sizeof(halAddWowlBcastPtrRsp)); |
| 17568 | |
| 17569 | wdiWowlAddBcPtrRsp.wdiStatus = |
| 17570 | WDI_HAL_2_WDI_STATUS(halAddWowlBcastPtrRsp.status); |
| 17571 | } |
| 17572 | else |
| 17573 | { |
| 17574 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17575 | wdiWowlAddBcPtrRsp.wdiStatus = |
| 17576 | WDI_HAL_2_WDI_STATUS(halStatus); |
| 17577 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17578 | |
| 17579 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17580 | wdiWowlAddBcPtrnCb( &wdiWowlAddBcPtrRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17581 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17582 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17583 | }/*WDI_ProcessWowlAddBcPtrnRsp*/ |
| 17584 | |
| 17585 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17586 | @brief Process wowl delete ptrn Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17587 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17588 | |
| 17589 | @param pWDICtx: pointer to the WLAN DAL context |
| 17590 | pEventData: pointer to the event information structure |
| 17591 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17592 | @see |
| 17593 | @return Result of the function call |
| 17594 | */ |
| 17595 | WDI_Status |
| 17596 | WDI_ProcessWowlDelBcPtrnRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17597 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17598 | WDI_ControlBlockType* pWDICtx, |
| 17599 | WDI_EventInfoType* pEventData |
| 17600 | ) |
| 17601 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17602 | eHalStatus halStatus; |
| 17603 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17604 | tHalDelWowlBcastPtrnRspParams halDelWowlBcastPtrRsp; |
| 17605 | WDI_WowlDelBcPtrnRspParamsType wdiWowlDelBcstPtrRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17606 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17607 | |
| 17608 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17609 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17610 | -------------------------------------------------------------------------*/ |
| 17611 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17612 | ( NULL == pEventData->pEventData)) |
| 17613 | { |
| 17614 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17615 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17616 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17617 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17618 | } |
| 17619 | |
| 17620 | wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pWDICtx->pfncRspCB; |
| 17621 | |
| 17622 | /*------------------------------------------------------------------------- |
| 17623 | Extract response and send it to UMAC |
| 17624 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17625 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17626 | { |
| 17627 | wpalMemoryCopy( &halDelWowlBcastPtrRsp, |
| 17628 | pEventData->pEventData, |
| 17629 | sizeof(halDelWowlBcastPtrRsp)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17630 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17631 | wdiWowlDelBcstPtrRsp.wdiStatus = |
| 17632 | WDI_HAL_2_WDI_STATUS(halDelWowlBcastPtrRsp.status); |
| 17633 | } |
| 17634 | else |
| 17635 | { |
| 17636 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17637 | wdiWowlDelBcstPtrRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17638 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17639 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17640 | wdiWowlDelBcPtrnCb( &wdiWowlDelBcstPtrRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17641 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17642 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17643 | }/*WDI_ProcessWowlDelBcPtrnRsp*/ |
| 17644 | |
| 17645 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17646 | @brief Process wowl enter Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17647 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17648 | |
| 17649 | @param pWDICtx: pointer to the WLAN DAL context |
| 17650 | pEventData: pointer to the event information structure |
| 17651 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17652 | @see |
| 17653 | @return Result of the function call |
| 17654 | */ |
| 17655 | WDI_Status |
| 17656 | WDI_ProcessWowlEnterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17657 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17658 | WDI_ControlBlockType* pWDICtx, |
| 17659 | WDI_EventInfoType* pEventData |
| 17660 | ) |
| 17661 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17662 | eHalStatus halStatus; |
| 17663 | WDI_WowlEnterReqCb wdiWowlEnterCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17664 | WDI_WowlEnterRspParamsType wdiwowlEnterRsp; |
| 17665 | tHalEnterWowlRspParams halEnterWowlRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17666 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17667 | |
| 17668 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17669 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17670 | -------------------------------------------------------------------------*/ |
| 17671 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17672 | ( NULL == pEventData->pEventData)) |
| 17673 | { |
| 17674 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17675 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17676 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17677 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17678 | } |
| 17679 | |
| 17680 | wdiWowlEnterCb = (WDI_WowlEnterReqCb)pWDICtx->pfncRspCB; |
| 17681 | |
| 17682 | /*------------------------------------------------------------------------- |
| 17683 | Extract response and send it to UMAC |
| 17684 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17685 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17686 | { |
| 17687 | wpalMemoryCopy( &halEnterWowlRspParams, |
| 17688 | (wpt_uint8*)pEventData->pEventData, |
| 17689 | sizeof(halEnterWowlRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17690 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17691 | wdiwowlEnterRsp.bssIdx = halEnterWowlRspParams.bssIdx; |
| 17692 | wdiwowlEnterRsp.status = |
| 17693 | WDI_HAL_2_WDI_STATUS(halEnterWowlRspParams.status); |
| 17694 | } |
| 17695 | else |
| 17696 | { |
| 17697 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17698 | wdiwowlEnterRsp.status = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17699 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17700 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17701 | wdiWowlEnterCb( &wdiwowlEnterRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17702 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17703 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17704 | }/*WDI_ProcessWowlEnterRsp*/ |
| 17705 | |
| 17706 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17707 | @brief Process wowl exit Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17708 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17709 | |
| 17710 | @param pWDICtx: pointer to the WLAN DAL context |
| 17711 | pEventData: pointer to the event information structure |
| 17712 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17713 | @see |
| 17714 | @return Result of the function call |
| 17715 | */ |
| 17716 | WDI_Status |
| 17717 | WDI_ProcessWowlExitRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17718 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17719 | WDI_ControlBlockType* pWDICtx, |
| 17720 | WDI_EventInfoType* pEventData |
| 17721 | ) |
| 17722 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17723 | eHalStatus halStatus; |
| 17724 | WDI_WowlExitReqCb wdiWowlExitCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17725 | tHalExitWowlRspParams halExitWowlRspParams; |
| 17726 | WDI_WowlExitRspParamsType wdiWowlExitRsp; |
| 17727 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17728 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17729 | |
| 17730 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17731 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17732 | -------------------------------------------------------------------------*/ |
| 17733 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17734 | ( NULL == pEventData->pEventData)) |
| 17735 | { |
| 17736 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17737 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17738 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17739 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17740 | } |
| 17741 | |
| 17742 | wdiWowlExitCb = (WDI_WowlExitReqCb)pWDICtx->pfncRspCB; |
| 17743 | |
| 17744 | /*------------------------------------------------------------------------- |
| 17745 | Extract response and send it to UMAC |
| 17746 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17747 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17748 | { |
| 17749 | wpalMemoryCopy( &halExitWowlRspParams, |
| 17750 | pEventData->pEventData, |
| 17751 | sizeof(halExitWowlRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17752 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17753 | wdiWowlExitRsp.status = WDI_HAL_2_WDI_STATUS(halExitWowlRspParams.status); |
| 17754 | wdiWowlExitRsp.bssIdx = halExitWowlRspParams.bssIdx; |
| 17755 | |
| 17756 | } |
| 17757 | else |
| 17758 | { |
| 17759 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17760 | wdiWowlExitRsp.status = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17761 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17762 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17763 | wdiWowlExitCb( &wdiWowlExitRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17764 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17765 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17766 | }/*WDI_ProcessWowlExitRsp*/ |
| 17767 | |
| 17768 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17769 | @brief Process Configure Apps CPU wakeup State Rsp function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17770 | (called when a response is being received over the bus |
| 17771 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17772 | |
| 17773 | @param pWDICtx: pointer to the WLAN DAL context |
| 17774 | pEventData: pointer to the event information structure |
| 17775 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17776 | @see |
| 17777 | @return Result of the function call |
| 17778 | */ |
| 17779 | WDI_Status |
| 17780 | WDI_ProcessConfigureAppsCpuWakeupStateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17781 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17782 | WDI_ControlBlockType* pWDICtx, |
| 17783 | WDI_EventInfoType* pEventData |
| 17784 | ) |
| 17785 | { |
| 17786 | WDI_Status wdiStatus; |
| 17787 | eHalStatus halStatus; |
| 17788 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb; |
| 17789 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17790 | |
| 17791 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17792 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17793 | -------------------------------------------------------------------------*/ |
| 17794 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17795 | ( NULL == pEventData->pEventData)) |
| 17796 | { |
| 17797 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17798 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17799 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17800 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17801 | } |
| 17802 | |
| 17803 | wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pWDICtx->pfncRspCB; |
| 17804 | |
| 17805 | /*------------------------------------------------------------------------- |
| 17806 | Extract response and send it to UMAC |
| 17807 | -------------------------------------------------------------------------*/ |
| 17808 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17809 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17810 | |
| 17811 | /*Notify UMAC*/ |
| 17812 | wdiConfigureAppsCpuWakeupStateCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17813 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17814 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17815 | }/*WDI_ProcessConfigureAppsCpuWakeupStateRsp*/ |
| 17816 | |
| 17817 | |
| 17818 | /** |
| 17819 | @brief Process Nv download(called when a response |
| 17820 | 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] | 17821 | |
| 17822 | @param pWDICtx: pointer to the WLAN DAL context |
| 17823 | pEventData: pointer to the event information structure |
| 17824 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17825 | @see |
| 17826 | @return Result of the function call |
| 17827 | */ |
| 17828 | WDI_Status |
| 17829 | WDI_ProcessNvDownloadRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17830 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17831 | WDI_ControlBlockType* pWDICtx, |
| 17832 | WDI_EventInfoType* pEventData |
| 17833 | ) |
| 17834 | { |
| 17835 | |
| 17836 | WDI_NvDownloadRspCb wdiNvDownloadRspCb; |
| 17837 | tHalNvImgDownloadRspParams halNvDownloadRsp; |
| 17838 | WDI_NvDownloadRspInfoType wdiNvDownloadRsp; |
| 17839 | |
| 17840 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17841 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17842 | -------------------------------------------------------------------------*/ |
| 17843 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17844 | ( NULL == pEventData->pEventData)) |
| 17845 | { |
| 17846 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17847 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17848 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17849 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17850 | } |
| 17851 | |
| 17852 | /*------------------------------------------------------------------------- |
| 17853 | Extract response and send it to UMAC |
| 17854 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17855 | wpalMemoryCopy( &halNvDownloadRsp, |
| 17856 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17857 | sizeof(halNvDownloadRsp)); |
| 17858 | |
| 17859 | wdiNvDownloadRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halNvDownloadRsp.status); |
| 17860 | |
| 17861 | if((wdiNvDownloadRsp.wdiStatus == WDI_STATUS_SUCCESS) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17862 | (pWDICtx->wdiNvBlobInfo.usCurrentFragment != |
| 17863 | pWDICtx->wdiNvBlobInfo.usTotalFragment )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17864 | { |
| 17865 | WDI_NvDownloadReq(&pWDICtx->wdiCachedNvDownloadReq, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17866 | (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17867 | } |
| 17868 | else |
| 17869 | { |
| 17870 | /*Reset the Nv related global information in WDI context information */ |
| 17871 | pWDICtx->wdiNvBlobInfo.usTotalFragment = 0; |
| 17872 | pWDICtx->wdiNvBlobInfo.usFragmentSize = 0; |
| 17873 | pWDICtx->wdiNvBlobInfo.usCurrentFragment = 0; |
| 17874 | /*call WDA callback function for last fragment */ |
| 17875 | wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB; |
| 17876 | wdiNvDownloadRspCb( &wdiNvDownloadRsp, pWDICtx->pRspCBUserData); |
| 17877 | } |
| 17878 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17879 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17880 | } |
| 17881 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 17882 | /** |
| 17883 | @brief Process Add TSpec Rsp function (called when a response |
| 17884 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17885 | |
| 17886 | @param pWDICtx: pointer to the WLAN DAL context |
| 17887 | pEventData: pointer to the event information structure |
| 17888 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17889 | @see |
| 17890 | @return Result of the function call |
| 17891 | */ |
| 17892 | WDI_Status |
| 17893 | WDI_ProcessAggrAddTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17894 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17895 | WDI_ControlBlockType* pWDICtx, |
| 17896 | WDI_EventInfoType* pEventData |
| 17897 | ) |
| 17898 | { |
| 17899 | WDI_Status wdiStatus; |
| 17900 | tAggrAddTsRspParams aggrAddTsRsp; |
| 17901 | WDI_AggrAddTsRspCb wdiAggrAddTsRspCb; |
| 17902 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17903 | |
| 17904 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17905 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17906 | -------------------------------------------------------------------------*/ |
| 17907 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17908 | ( NULL == pEventData->pEventData)) |
| 17909 | { |
| 17910 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17911 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17912 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17913 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17914 | } |
| 17915 | |
| 17916 | wdiAggrAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB; |
| 17917 | |
| 17918 | /*------------------------------------------------------------------------- |
| 17919 | Extract response and send it to UMAC |
| 17920 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17921 | wpalMemoryCopy( &aggrAddTsRsp, |
| 17922 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17923 | sizeof(aggrAddTsRsp)); |
| 17924 | |
| 17925 | /* What is the difference between status0 and status1? */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17926 | wdiStatus = WDI_HAL_2_WDI_STATUS(aggrAddTsRsp.status0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17927 | |
| 17928 | /*Notify UMAC*/ |
| 17929 | wdiAggrAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17930 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17931 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17932 | }/*WDI_ProcessAddTSpecRsp*/ |
| 17933 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 17934 | |
| 17935 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17936 | @brief WDI_ProcessHostResumeRsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17937 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17938 | |
| 17939 | @param pWDICtx: pointer to the WLAN DAL context |
| 17940 | pEventData: pointer to the event information structure |
| 17941 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17942 | @see |
| 17943 | @return Result of the function call |
| 17944 | */ |
| 17945 | WDI_Status |
| 17946 | WDI_ProcessHostResumeRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17947 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17948 | WDI_ControlBlockType* pWDICtx, |
| 17949 | WDI_EventInfoType* pEventData |
| 17950 | ) |
| 17951 | { |
| 17952 | WDI_SuspendResumeRspParamsType wdiResumeRspParams; |
| 17953 | WDI_HostResumeEventRspCb wdiHostResumeRspCb; |
| 17954 | tHalHostResumeRspParams hostResumeRspMsg; |
| 17955 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17956 | |
| 17957 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17958 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17959 | -------------------------------------------------------------------------*/ |
| 17960 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17961 | ( NULL == pEventData->pEventData)) |
| 17962 | { |
| 17963 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17964 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17965 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17966 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17967 | } |
| 17968 | |
| 17969 | wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pWDICtx->pfncRspCB; |
| 17970 | |
| 17971 | /*------------------------------------------------------------------------- |
| 17972 | Extract response and send it to UMAC |
| 17973 | -------------------------------------------------------------------------*/ |
| 17974 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17975 | wpalMemoryCopy( &hostResumeRspMsg, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17976 | (wpt_uint8*)pEventData->pEventData, |
| 17977 | sizeof(hostResumeRspMsg)); |
| 17978 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17979 | wdiResumeRspParams.wdiStatus = |
| 17980 | WDI_HAL_2_WDI_STATUS(hostResumeRspMsg.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17981 | |
| 17982 | /*Notify UMAC*/ |
| 17983 | wdiHostResumeRspCb(&wdiResumeRspParams, (void*) pWDICtx->pRspCBUserData); |
| 17984 | |
| 17985 | return WDI_STATUS_SUCCESS; |
| 17986 | } |
| 17987 | |
| 17988 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17989 | @brief Process Set Tx PER Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17990 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17991 | |
| 17992 | @param pWDICtx: pointer to the WLAN DAL context |
| 17993 | pEventData: pointer to the event information structure |
| 17994 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17995 | @see |
| 17996 | @return Result of the function call |
| 17997 | */ |
| 17998 | WDI_Status |
| 17999 | WDI_ProcessSetTxPerTrackingRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18000 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18001 | WDI_ControlBlockType* pWDICtx, |
| 18002 | WDI_EventInfoType* pEventData |
| 18003 | ) |
| 18004 | { |
| 18005 | WDI_Status wdiStatus; |
| 18006 | eHalStatus halStatus; |
| 18007 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb; |
| 18008 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18009 | |
| 18010 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18011 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18012 | -------------------------------------------------------------------------*/ |
| 18013 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18014 | ( NULL == pEventData->pEventData)) |
| 18015 | { |
| 18016 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18017 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18018 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18019 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18020 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18021 | |
| 18022 | pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18023 | |
| 18024 | /*------------------------------------------------------------------------- |
| 18025 | Extract response and send it to UMAC |
| 18026 | -------------------------------------------------------------------------*/ |
| 18027 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18028 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18029 | |
| 18030 | /*Notify UMAC*/ |
| 18031 | pwdiSetTxPerTrackingRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18032 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18033 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18034 | }/*WDI_ProcessSetTxPerTrackingRsp*/ |
| 18035 | |
| 18036 | /*========================================================================== |
| 18037 | Indications from HAL |
| 18038 | ==========================================================================*/ |
| 18039 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18040 | @brief Process Low RSSI Indication function (called when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18041 | indication of this kind is being received over the bus |
| 18042 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18043 | |
| 18044 | @param pWDICtx: pointer to the WLAN DAL context |
| 18045 | pEventData: pointer to the event information structure |
| 18046 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18047 | @see |
| 18048 | @return Result of the function call |
| 18049 | */ |
| 18050 | WDI_Status |
| 18051 | WDI_ProcessLowRSSIInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18052 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18053 | WDI_ControlBlockType* pWDICtx, |
| 18054 | WDI_EventInfoType* pEventData |
| 18055 | ) |
| 18056 | { |
| 18057 | WDI_LowLevelIndType wdiInd; |
| 18058 | tHalRSSINotificationIndMsg halRSSINotificationIndMsg; |
| 18059 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18060 | |
| 18061 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18062 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18063 | -------------------------------------------------------------------------*/ |
| 18064 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18065 | ( NULL == pEventData->pEventData)) |
| 18066 | { |
| 18067 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18068 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18069 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18070 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18071 | } |
| 18072 | |
| 18073 | /*------------------------------------------------------------------------- |
| 18074 | Extract indication and send it to UMAC |
| 18075 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18076 | wpalMemoryCopy( (void *)&halRSSINotificationIndMsg.rssiNotificationParams, |
| 18077 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18078 | sizeof(tHalRSSINotification)); |
| 18079 | |
| 18080 | /*Fill in the indication parameters*/ |
| 18081 | wdiInd.wdiIndicationType = WDI_RSSI_NOTIFICATION_IND; |
| 18082 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1PosCross = |
| 18083 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1PosCross; |
| 18084 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1NegCross = |
| 18085 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1NegCross; |
| 18086 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2PosCross = |
| 18087 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2PosCross; |
| 18088 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2NegCross = |
| 18089 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2NegCross; |
| 18090 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3PosCross = |
| 18091 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3PosCross; |
| 18092 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3NegCross = |
| 18093 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3NegCross; |
| 18094 | |
| 18095 | /*Notify UMAC*/ |
| 18096 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18097 | |
| 18098 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18099 | }/*WDI_ProcessLowRSSIInd*/ |
| 18100 | |
| 18101 | |
| 18102 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18103 | @brief Process Missed Beacon Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18104 | an indication of this kind is being received over the |
| 18105 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18106 | |
| 18107 | @param pWDICtx: pointer to the WLAN DAL context |
| 18108 | pEventData: pointer to the event information structure |
| 18109 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18110 | @see |
| 18111 | @return Result of the function call |
| 18112 | */ |
| 18113 | WDI_Status |
| 18114 | WDI_ProcessMissedBeaconInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18115 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18116 | WDI_ControlBlockType* pWDICtx, |
| 18117 | WDI_EventInfoType* pEventData |
| 18118 | ) |
| 18119 | { |
| 18120 | WDI_Status wdiStatus; |
| 18121 | eHalStatus halStatus; |
| 18122 | WDI_LowLevelIndType wdiInd; |
| 18123 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18124 | |
| 18125 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18126 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18127 | -------------------------------------------------------------------------*/ |
| 18128 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18129 | ( NULL == pEventData->pEventData)) |
| 18130 | { |
| 18131 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18132 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18133 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18134 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18135 | } |
| 18136 | |
| 18137 | /*------------------------------------------------------------------------- |
| 18138 | Extract indication and send it to UMAC |
| 18139 | -------------------------------------------------------------------------*/ |
| 18140 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 18141 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18142 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18143 | |
| 18144 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18145 | wdiInd.wdiIndicationType = WDI_MISSED_BEACON_IND; |
| 18146 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18147 | /*Notify UMAC*/ |
| 18148 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18149 | |
| 18150 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18151 | }/*WDI_ProcessMissedBeaconInd*/ |
| 18152 | |
| 18153 | |
| 18154 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18155 | @brief Process Unk Addr Frame Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18156 | an indication of this kind is being received over the |
| 18157 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18158 | |
| 18159 | @param pWDICtx: pointer to the WLAN DAL context |
| 18160 | pEventData: pointer to the event information structure |
| 18161 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18162 | @see |
| 18163 | @return Result of the function call |
| 18164 | */ |
| 18165 | WDI_Status |
| 18166 | WDI_ProcessUnkAddrFrameInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18167 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18168 | WDI_ControlBlockType* pWDICtx, |
| 18169 | WDI_EventInfoType* pEventData |
| 18170 | ) |
| 18171 | { |
| 18172 | WDI_Status wdiStatus; |
| 18173 | eHalStatus halStatus; |
| 18174 | WDI_LowLevelIndType wdiInd; |
| 18175 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18176 | |
| 18177 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18178 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18179 | -------------------------------------------------------------------------*/ |
| 18180 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18181 | ( NULL == pEventData->pEventData)) |
| 18182 | { |
| 18183 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18184 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18185 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18186 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18187 | } |
| 18188 | |
| 18189 | /*------------------------------------------------------------------------- |
| 18190 | Extract indication and send it to UMAC |
| 18191 | -------------------------------------------------------------------------*/ |
| 18192 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 18193 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18194 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18195 | |
| 18196 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18197 | wdiInd.wdiIndicationType = WDI_UNKNOWN_ADDR2_FRAME_RX_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18198 | /* ! TO DO - fill in from HAL struct: |
| 18199 | wdiInd.wdiIndicationData.wdiUnkAddr2FrmInfo*/ |
| 18200 | |
| 18201 | /*Notify UMAC*/ |
| 18202 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18203 | |
| 18204 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18205 | }/*WDI_ProcessUnkAddrFrameInd*/ |
| 18206 | |
| 18207 | |
| 18208 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18209 | @brief Process MIC Failure Indication function (called when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18210 | indication of this kind is being received over the bus |
| 18211 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18212 | |
| 18213 | @param pWDICtx: pointer to the WLAN DAL context |
| 18214 | pEventData: pointer to the event information structure |
| 18215 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18216 | @see |
| 18217 | @return Result of the function call |
| 18218 | */ |
| 18219 | WDI_Status |
| 18220 | WDI_ProcessMicFailureInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18221 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18222 | WDI_ControlBlockType* pWDICtx, |
| 18223 | WDI_EventInfoType* pEventData |
| 18224 | ) |
| 18225 | { |
| 18226 | WDI_LowLevelIndType wdiInd; |
| 18227 | tpSirMicFailureInd pHalMicFailureInd; |
| 18228 | |
| 18229 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18230 | |
| 18231 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18232 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18233 | -------------------------------------------------------------------------*/ |
| 18234 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18235 | ( NULL == pEventData->pEventData)) |
| 18236 | { |
| 18237 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18238 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18239 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18240 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18241 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18242 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18243 | pHalMicFailureInd = (tpSirMicFailureInd)pEventData->pEventData; |
| 18244 | /*------------------------------------------------------------------------- |
| 18245 | Extract indication and send it to UMAC |
| 18246 | -------------------------------------------------------------------------*/ |
| 18247 | |
| 18248 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18249 | wdiInd.wdiIndicationType = WDI_MIC_FAILURE_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18250 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.bssId, |
| 18251 | pHalMicFailureInd->bssId, WDI_MAC_ADDR_LEN); |
| 18252 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macSrcAddr, |
| 18253 | pHalMicFailureInd->info.srcMacAddr, WDI_MAC_ADDR_LEN); |
| 18254 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macTaAddr, |
| 18255 | pHalMicFailureInd->info.taMacAddr, WDI_MAC_ADDR_LEN); |
| 18256 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macDstAddr, |
| 18257 | pHalMicFailureInd->info.dstMacAddr, WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18258 | wdiInd.wdiIndicationData.wdiMICFailureInfo.ucMulticast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18259 | pHalMicFailureInd->info.multicast; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18260 | wdiInd.wdiIndicationData.wdiMICFailureInfo.ucIV1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18261 | pHalMicFailureInd->info.IV1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18262 | wdiInd.wdiIndicationData.wdiMICFailureInfo.keyId= |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18263 | pHalMicFailureInd->info.keyId; |
| 18264 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.TSC, |
| 18265 | pHalMicFailureInd->info.TSC,WDI_CIPHER_SEQ_CTR_SIZE); |
| 18266 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macRxAddr, |
| 18267 | pHalMicFailureInd->info.rxMacAddr, WDI_MAC_ADDR_LEN); |
| 18268 | /*Notify UMAC*/ |
| 18269 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18270 | |
| 18271 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18272 | }/*WDI_ProcessMicFailureInd*/ |
| 18273 | |
| 18274 | |
| 18275 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18276 | @brief Process Fatal Failure Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18277 | an indication of this kind is being received over the |
| 18278 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18279 | |
| 18280 | @param pWDICtx: pointer to the WLAN DAL context |
| 18281 | pEventData: pointer to the event information structure |
| 18282 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18283 | @see |
| 18284 | @return Result of the function call |
| 18285 | */ |
| 18286 | WDI_Status |
| 18287 | WDI_ProcessFatalErrorInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18288 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18289 | WDI_ControlBlockType* pWDICtx, |
| 18290 | WDI_EventInfoType* pEventData |
| 18291 | ) |
| 18292 | { |
| 18293 | WDI_Status wdiStatus; |
| 18294 | eHalStatus halStatus; |
| 18295 | WDI_LowLevelIndType wdiInd; |
| 18296 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18297 | |
| 18298 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18299 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18300 | -------------------------------------------------------------------------*/ |
| 18301 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18302 | ( NULL == pEventData->pEventData)) |
| 18303 | { |
| 18304 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18305 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18306 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18307 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18308 | } |
| 18309 | |
| 18310 | /*------------------------------------------------------------------------- |
| 18311 | Extract indication and send it to UMAC |
| 18312 | -------------------------------------------------------------------------*/ |
| 18313 | |
| 18314 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 18315 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18316 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18317 | |
| 18318 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 18319 | "Fatal failure received from device %d ", halStatus ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18320 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18321 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18322 | wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND; |
| 18323 | wdiInd.wdiIndicationData.usErrorCode = WDI_ERR_DEV_INTERNAL_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18324 | |
| 18325 | /*Notify UMAC*/ |
| 18326 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18327 | |
| 18328 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18329 | }/*WDI_ProcessFatalErrorInd*/ |
| 18330 | |
| 18331 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18332 | @brief Process Delete STA Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18333 | an indication of this kind is being received over the |
| 18334 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18335 | |
| 18336 | @param pWDICtx: pointer to the WLAN DAL context |
| 18337 | pEventData: pointer to the event information structure |
| 18338 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18339 | @see |
| 18340 | @return Result of the function call |
| 18341 | */ |
| 18342 | WDI_Status |
| 18343 | WDI_ProcessDelSTAInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18344 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18345 | WDI_ControlBlockType* pWDICtx, |
| 18346 | WDI_EventInfoType* pEventData |
| 18347 | ) |
| 18348 | { |
| 18349 | tDeleteStaContextParams halDelSTACtx; |
| 18350 | WDI_LowLevelIndType wdiInd; |
| 18351 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18352 | |
| 18353 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18354 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18355 | -------------------------------------------------------------------------*/ |
| 18356 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18357 | ( NULL == pEventData->pEventData)) |
| 18358 | { |
| 18359 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18360 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18361 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18362 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18363 | } |
| 18364 | |
| 18365 | /*------------------------------------------------------------------------- |
| 18366 | Extract indication and send it to UMAC |
| 18367 | -------------------------------------------------------------------------*/ |
| 18368 | |
| 18369 | /* Parameters need to be unpacked according to HAL struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18370 | wpalMemoryCopy( &halDelSTACtx, |
| 18371 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18372 | sizeof(halDelSTACtx)); |
| 18373 | |
| 18374 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18375 | wdiInd.wdiIndicationType = WDI_DEL_STA_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18376 | |
| 18377 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macADDR2, |
| 18378 | halDelSTACtx.addr2, WDI_MAC_ADDR_LEN); |
| 18379 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macBSSID, |
| 18380 | halDelSTACtx.bssId, WDI_MAC_ADDR_LEN); |
| 18381 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18382 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.usAssocId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18383 | halDelSTACtx.assocId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18384 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18385 | halDelSTACtx.staId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18386 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.wptReasonCode = |
| 18387 | halDelSTACtx.reasonCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18388 | |
| 18389 | /*Notify UMAC*/ |
| 18390 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18391 | |
| 18392 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18393 | }/*WDI_ProcessDelSTAInd*/ |
| 18394 | |
| 18395 | /** |
| 18396 | *@brief Process Coex Indication function (called when |
| 18397 | an indication of this kind is being received over the |
| 18398 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18399 | |
| 18400 | @param pWDICtx: pointer to the WLAN DAL context |
| 18401 | pEventData: pointer to the event information structure |
| 18402 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18403 | @see |
| 18404 | @return Result of the function call |
| 18405 | */ |
| 18406 | WDI_Status |
| 18407 | WDI_ProcessCoexInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18408 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18409 | WDI_ControlBlockType* pWDICtx, |
| 18410 | WDI_EventInfoType* pEventData |
| 18411 | ) |
| 18412 | { |
| 18413 | WDI_LowLevelIndType wdiInd; |
| 18414 | tCoexIndMsg halCoexIndMsg; |
| 18415 | wpt_uint32 index; |
| 18416 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18417 | |
| 18418 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18419 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18420 | -------------------------------------------------------------------------*/ |
| 18421 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18422 | ( NULL == pEventData->pEventData )) |
| 18423 | { |
| 18424 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18425 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18426 | WDI_ASSERT( 0 ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18427 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18428 | } |
| 18429 | |
| 18430 | /*------------------------------------------------------------------------- |
| 18431 | Extract indication and send it to UMAC |
| 18432 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18433 | wpalMemoryCopy( &halCoexIndMsg.coexIndParams, |
| 18434 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18435 | sizeof(halCoexIndMsg.coexIndParams) ); |
| 18436 | |
| 18437 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18438 | wdiInd.wdiIndicationType = WDI_COEX_IND; |
| 18439 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType = halCoexIndMsg.coexIndParams.coexIndType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18440 | for (index = 0; index < WDI_COEX_IND_DATA_SIZE; index++) |
| 18441 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18442 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[index] = halCoexIndMsg.coexIndParams.coexIndData[index]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18443 | } |
| 18444 | |
| 18445 | // DEBUG |
| 18446 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 18447 | "[COEX WDI] Coex Ind Type (%x) data (%x %x %x %x)", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18448 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType, |
| 18449 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[0], |
| 18450 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[1], |
| 18451 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[2], |
| 18452 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[3] ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18453 | |
| 18454 | /*Notify UMAC*/ |
| 18455 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18456 | |
| 18457 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18458 | }/*WDI_ProcessCoexInd*/ |
| 18459 | |
| 18460 | /** |
| 18461 | *@brief Process Tx Complete Indication function (called when |
| 18462 | an indication of this kind is being received over the |
| 18463 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18464 | |
| 18465 | @param pWDICtx: pointer to the WLAN DAL context |
| 18466 | pEventData: pointer to the event information structure |
| 18467 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18468 | @see |
| 18469 | @return Result of the function call |
| 18470 | */ |
| 18471 | WDI_Status |
| 18472 | WDI_ProcessTxCompleteInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18473 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18474 | WDI_ControlBlockType* pWDICtx, |
| 18475 | WDI_EventInfoType* pEventData |
| 18476 | ) |
| 18477 | { |
| 18478 | WDI_LowLevelIndType wdiInd; |
| 18479 | tTxComplIndMsg halTxComplIndMsg; |
| 18480 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18481 | |
| 18482 | /*------------------------------------------------------------------------- |
| 18483 | Sanity check |
| 18484 | -------------------------------------------------------------------------*/ |
| 18485 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18486 | ( NULL == pEventData->pEventData )) |
| 18487 | { |
| 18488 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18489 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18490 | WDI_ASSERT( 0 ); |
| 18491 | return WDI_STATUS_E_FAILURE; |
| 18492 | } |
| 18493 | |
| 18494 | /*------------------------------------------------------------------------- |
| 18495 | Extract indication and send it to UMAC |
| 18496 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18497 | wpalMemoryCopy( &halTxComplIndMsg.txComplParams, |
| 18498 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18499 | sizeof(halTxComplIndMsg.txComplParams) ); |
| 18500 | |
| 18501 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18502 | wdiInd.wdiIndicationType = WDI_TX_COMPLETE_IND; |
| 18503 | wdiInd.wdiIndicationData.tx_complete_status |
| 18504 | = halTxComplIndMsg.txComplParams.status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18505 | |
| 18506 | /*Notify UMAC*/ |
| 18507 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18508 | |
| 18509 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18510 | }/*WDI_ProcessTxCompleteInd*/ |
| 18511 | |
| 18512 | #ifdef WLAN_FEATURE_P2P |
| 18513 | /** |
| 18514 | *@brief Process Noa Attr Indication function (called when |
| 18515 | an indication of this kind is being received over the |
| 18516 | bus from HAL) |
| 18517 | |
| 18518 | @param pWDICtx: pointer to the WLAN DAL context |
| 18519 | pEventData: pointer to the event information structure |
| 18520 | |
| 18521 | @see |
| 18522 | @return Result of the function call |
| 18523 | */ |
| 18524 | WDI_Status |
| 18525 | WDI_ProcessP2pNoaAttrInd |
| 18526 | ( |
| 18527 | WDI_ControlBlockType* pWDICtx, |
| 18528 | WDI_EventInfoType* pEventData |
| 18529 | ) |
| 18530 | { |
| 18531 | WDI_LowLevelIndType wdiInd; |
| 18532 | tNoaAttrIndMsg halNoaAttrIndMsg; |
| 18533 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18534 | |
| 18535 | /*------------------------------------------------------------------------- |
| 18536 | Sanity check |
| 18537 | -------------------------------------------------------------------------*/ |
| 18538 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18539 | ( NULL == pEventData->pEventData )) |
| 18540 | { |
| 18541 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18542 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18543 | WDI_ASSERT( 0 ); |
| 18544 | return WDI_STATUS_E_FAILURE; |
| 18545 | } |
| 18546 | |
| 18547 | /*------------------------------------------------------------------------- |
| 18548 | Extract indication and send it to UMAC |
| 18549 | -------------------------------------------------------------------------*/ |
| 18550 | wpalMemoryCopy( &halNoaAttrIndMsg.noaAttrIndParams, |
| 18551 | pEventData->pEventData, |
| 18552 | sizeof(halNoaAttrIndMsg.noaAttrIndParams) ); |
| 18553 | |
| 18554 | /*Fill in the indication parameters*/ |
| 18555 | wdiInd.wdiIndicationType = WDI_P2P_NOA_ATTR_IND; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18556 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18557 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.status |
| 18558 | = halNoaAttrIndMsg.noaAttrIndParams.status; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18559 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18560 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucIndex |
| 18561 | = halNoaAttrIndMsg.noaAttrIndParams.index; |
| 18562 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucOppPsFlag |
| 18563 | = halNoaAttrIndMsg.noaAttrIndParams.oppPsFlag; |
| 18564 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usCtWin |
| 18565 | = halNoaAttrIndMsg.noaAttrIndParams.ctWin; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18566 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18567 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa1IntervalCnt |
| 18568 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1IntervalCnt; |
| 18569 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Duration |
| 18570 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Duration; |
| 18571 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Interval |
| 18572 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Interval; |
| 18573 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1StartTime |
| 18574 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1StartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18575 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18576 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa2IntervalCnt |
| 18577 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2IntervalCnt; |
| 18578 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Duration |
| 18579 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Duration; |
| 18580 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Interval |
| 18581 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Interval; |
| 18582 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2StartTime |
| 18583 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2StartTime; |
| 18584 | |
| 18585 | /*Notify UMAC*/ |
| 18586 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 18587 | |
| 18588 | return WDI_STATUS_SUCCESS; |
| 18589 | }/*WDI_ProcessNoaAttrInd*/ |
| 18590 | #endif |
| 18591 | |
| 18592 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18593 | @brief Process Tx PER Hit Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18594 | an indication of this kind is being received over the |
| 18595 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18596 | |
| 18597 | @param pWDICtx: pointer to the WLAN DAL context |
| 18598 | pEventData: pointer to the event information structure |
| 18599 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18600 | @see |
| 18601 | @return Result of the function call |
| 18602 | */ |
| 18603 | WDI_Status |
| 18604 | WDI_ProcessTxPerHitInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18605 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18606 | WDI_ControlBlockType* pWDICtx, |
| 18607 | WDI_EventInfoType* pEventData |
| 18608 | ) |
| 18609 | { |
| 18610 | WDI_LowLevelIndType wdiInd; |
| 18611 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18612 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18613 | /*------------------------------------------------------------------------- |
| 18614 | Extract indication and send it to UMAC |
| 18615 | -------------------------------------------------------------------------*/ |
| 18616 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18617 | wdiInd.wdiIndicationType = WDI_TX_PER_HIT_IND; |
| 18618 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18619 | /*Notify UMAC*/ |
| 18620 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 18621 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18622 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18623 | }/*WDI_ProcessTxPerHitInd*/ |
| 18624 | |
| 18625 | #ifdef ANI_MANF_DIAG |
| 18626 | /** |
| 18627 | @brief WDI_ProcessFTMCommandReq |
| 18628 | Process FTM Command, simply route to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18629 | |
| 18630 | @param pWDICtx: pointer to the WLAN DAL context |
| 18631 | pEventData: pointer to the event information structure |
| 18632 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18633 | @see |
| 18634 | @return Result of the function call |
| 18635 | */ |
| 18636 | WDI_Status |
| 18637 | WDI_ProcessFTMCommandReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18638 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18639 | WDI_ControlBlockType* pWDICtx, |
| 18640 | WDI_EventInfoType* pEventData |
| 18641 | ) |
| 18642 | { |
| 18643 | WDI_FTMCommandReqType *ftmCommandReq = NULL; |
| 18644 | wpt_uint8 *ftmCommandBuffer = NULL; |
| 18645 | wpt_uint16 dataOffset; |
| 18646 | wpt_uint16 bufferSize; |
| 18647 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18648 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18649 | -------------------------------------------------------------------------*/ |
| 18650 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18651 | ( NULL == pEventData->pEventData)) |
| 18652 | |
| 18653 | { |
| 18654 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18655 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18656 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18657 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18658 | } |
| 18659 | |
| 18660 | ftmCommandReq = (WDI_FTMCommandReqType *)pEventData->pEventData; |
| 18661 | |
| 18662 | /* Get MSG Buffer */ |
| 18663 | WDI_GetMessageBuffer(pWDICtx, |
| 18664 | WDI_FTM_CMD_REQ, |
| 18665 | ftmCommandReq->bodyLength, |
| 18666 | &ftmCommandBuffer, |
| 18667 | &dataOffset, |
| 18668 | &bufferSize); |
| 18669 | |
| 18670 | wpalMemoryCopy(ftmCommandBuffer + dataOffset, |
| 18671 | ftmCommandReq->FTMCommandBody, |
| 18672 | ftmCommandReq->bodyLength); |
| 18673 | |
| 18674 | /* Send MSG */ |
| 18675 | return WDI_SendMsg(pWDICtx, |
| 18676 | ftmCommandBuffer, |
| 18677 | bufferSize, |
| 18678 | pEventData->pCBfnc, |
| 18679 | pEventData->pUserData, |
| 18680 | WDI_FTM_CMD_RESP); |
| 18681 | } |
| 18682 | |
| 18683 | /** |
| 18684 | @brief WDI_ProcessFTMCommandRsp |
| 18685 | Process FTM Command Response from HAL, simply route to HDD FTM |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18686 | |
| 18687 | @param pWDICtx: pointer to the WLAN DAL context |
| 18688 | pEventData: pointer to the event information structure |
| 18689 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18690 | @see |
| 18691 | @return Result of the function call |
| 18692 | */ |
| 18693 | WDI_Status |
| 18694 | WDI_ProcessFTMCommandRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18695 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18696 | WDI_ControlBlockType* pWDICtx, |
| 18697 | WDI_EventInfoType* pEventData |
| 18698 | ) |
| 18699 | { |
| 18700 | WDI_FTMCommandRspCb ftmCMDRspCb; |
| 18701 | tProcessPttRspParams *ftmCMDRspData = NULL; |
| 18702 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18703 | |
| 18704 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18705 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18706 | -------------------------------------------------------------------------*/ |
| 18707 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18708 | ( NULL == pEventData->pEventData)) |
| 18709 | { |
| 18710 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18711 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18712 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18713 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18714 | } |
| 18715 | |
| 18716 | ftmCMDRspCb = (WDI_FTMCommandRspCb)pWDICtx->pfncRspCB; |
| 18717 | |
| 18718 | ftmCMDRspData = (tProcessPttRspParams *)pEventData->pEventData; |
| 18719 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18720 | wpalMemoryCopy((void *)pWDICtx->ucFTMCommandRspBuffer, |
| 18721 | (void *)&ftmCMDRspData->pttMsgBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18722 | ftmCMDRspData->pttMsgBuffer.msgBodyLength); |
| 18723 | |
| 18724 | /*Notify UMAC*/ |
| 18725 | ftmCMDRspCb((void *)pWDICtx->ucFTMCommandRspBuffer, pWDICtx->pRspCBUserData); |
| 18726 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18727 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18728 | } |
| 18729 | #endif /* ANI_MANF_DIAG */ |
| 18730 | /** |
| 18731 | @brief WDI_ProcessHalDumpCmdReq |
| 18732 | Process hal dump Command, simply route to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18733 | |
| 18734 | @param pWDICtx: pointer to the WLAN DAL context |
| 18735 | pEventData: pointer to the event information structure |
| 18736 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18737 | @see |
| 18738 | @return Result of the function call |
| 18739 | */ |
| 18740 | WDI_Status |
| 18741 | WDI_ProcessHALDumpCmdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18742 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18743 | WDI_ControlBlockType* pWDICtx, |
| 18744 | WDI_EventInfoType* pEventData |
| 18745 | ) |
| 18746 | { |
| 18747 | WDI_HALDumpCmdReqParamsType* pwdiHALDumpCmdParams = NULL; |
| 18748 | WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb = NULL; |
| 18749 | wpt_uint16 usDataOffset = 0; |
| 18750 | wpt_uint16 usSendSize = 0; |
| 18751 | tHalDumpCmdReqMsg halDumpCmdReqMsg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18752 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18753 | |
| 18754 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18755 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18756 | -------------------------------------------------------------------------*/ |
| 18757 | if (( NULL == pEventData ) || |
| 18758 | ( NULL == pEventData->pEventData) || |
| 18759 | ( NULL == pEventData->pCBfnc )) |
| 18760 | { |
| 18761 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18762 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18763 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18764 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18765 | } |
| 18766 | |
| 18767 | pwdiHALDumpCmdParams = (WDI_HALDumpCmdReqParamsType*)pEventData->pEventData; |
| 18768 | wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pEventData->pCBfnc; |
| 18769 | |
| 18770 | /* Copying the HAL DUMP Command Information HAL Structure*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18771 | halDumpCmdReqMsg.dumpCmdReqParams.argument1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18772 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.command; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18773 | halDumpCmdReqMsg.dumpCmdReqParams.argument2 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18774 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18775 | halDumpCmdReqMsg.dumpCmdReqParams.argument3 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18776 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument2; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18777 | halDumpCmdReqMsg.dumpCmdReqParams.argument4 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18778 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument3; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18779 | halDumpCmdReqMsg.dumpCmdReqParams.argument5 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18780 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument4; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18781 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18782 | /*----------------------------------------------------------------------- |
| 18783 | Get message buffer |
| 18784 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18785 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HAL_DUMP_CMD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18786 | sizeof(halDumpCmdReqMsg.dumpCmdReqParams), |
| 18787 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18788 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18789 | (usDataOffset + sizeof(halDumpCmdReqMsg.dumpCmdReqParams) ))) |
| 18790 | { |
| 18791 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18792 | "Unable to get send buffer in HAL Dump Command req %x %x %x", |
| 18793 | pEventData, pwdiHALDumpCmdParams, wdiHALDumpCmdRspCb); |
| 18794 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18795 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18796 | } |
| 18797 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18798 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 18799 | &halDumpCmdReqMsg.dumpCmdReqParams, |
| 18800 | sizeof(halDumpCmdReqMsg.dumpCmdReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18801 | |
| 18802 | pWDICtx->wdiReqStatusCB = pwdiHALDumpCmdParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18803 | pWDICtx->pReqStatusUserData = pwdiHALDumpCmdParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18804 | |
| 18805 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18806 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18807 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18808 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 18809 | wdiHALDumpCmdRspCb, pEventData->pUserData, |
| 18810 | WDI_HAL_DUMP_CMD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18811 | } |
| 18812 | |
| 18813 | /** |
| 18814 | @brief WDI_ProcessHalDumpCmdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18815 | Process hal Dump Command Response from HAL, simply route to HDD |
| 18816 | |
| 18817 | @param pWDICtx: pointer to the WLAN DAL context |
| 18818 | pEventData: pointer to the event information structure |
| 18819 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18820 | @see |
| 18821 | @return Result of the function call |
| 18822 | */ |
| 18823 | WDI_Status |
| 18824 | WDI_ProcessHALDumpCmdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18825 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18826 | WDI_ControlBlockType* pWDICtx, |
| 18827 | WDI_EventInfoType* pEventData |
| 18828 | ) |
| 18829 | { |
| 18830 | WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb; |
| 18831 | tpHalDumpCmdRspParams halDumpCmdRspParams; |
| 18832 | WDI_HALDumpCmdRspParamsType wdiHALDumpCmdRsp; |
| 18833 | |
| 18834 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18835 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18836 | -------------------------------------------------------------------------*/ |
| 18837 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18838 | ( NULL == pEventData->pEventData)) |
| 18839 | { |
| 18840 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18841 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18842 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18843 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18844 | } |
| 18845 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18846 | wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18847 | |
| 18848 | /*Initialize the WDI Response structure */ |
| 18849 | wdiHALDumpCmdRsp.usBufferLen = 0; |
| 18850 | wdiHALDumpCmdRsp.pBuffer = NULL; |
| 18851 | |
| 18852 | halDumpCmdRspParams = (tHalDumpCmdRspParams *)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18853 | |
| 18854 | wdiHALDumpCmdRsp.wdiStatus = |
| 18855 | WDI_HAL_2_WDI_STATUS(halDumpCmdRspParams->status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18856 | |
| 18857 | if (( wdiHALDumpCmdRsp.wdiStatus == WDI_STATUS_SUCCESS) && |
| 18858 | (halDumpCmdRspParams->rspLength != 0)) |
| 18859 | { |
| 18860 | /* Copy the response data */ |
| 18861 | wdiHALDumpCmdRsp.usBufferLen = halDumpCmdRspParams->rspLength; |
| 18862 | wdiHALDumpCmdRsp.pBuffer = wpalMemoryAllocate(halDumpCmdRspParams->rspLength); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18863 | wpalMemoryCopy( &halDumpCmdRspParams->rspBuffer, |
| 18864 | wdiHALDumpCmdRsp.pBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18865 | sizeof(wdiHALDumpCmdRsp.usBufferLen)); |
| 18866 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18867 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18868 | /*Notify UMAC*/ |
| 18869 | wdiHALDumpCmdRspCb(&wdiHALDumpCmdRsp, pWDICtx->pRspCBUserData); |
| 18870 | |
| 18871 | if(wdiHALDumpCmdRsp.pBuffer != NULL) |
| 18872 | { |
| 18873 | /* Free the allocated buffer */ |
| 18874 | wpalMemoryFree(wdiHALDumpCmdRsp.pBuffer); |
| 18875 | } |
| 18876 | return WDI_STATUS_SUCCESS; |
| 18877 | } |
| 18878 | |
| 18879 | /*========================================================================== |
| 18880 | CONTRL TRANSPORT INTERACTION |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18881 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18882 | Callback function registered with the control transport - for receiving |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18883 | notifications and packets |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18884 | ==========================================================================*/ |
| 18885 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18886 | @brief This callback is invoked by the control transport |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18887 | when it wishes to send up a notification like the ones |
| 18888 | mentioned above. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18889 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18890 | @param |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18891 | |
| 18892 | wctsHandle: handle to the control transport service |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18893 | wctsEvent: the event being notified |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18894 | wctsNotifyCBData: the callback data of the user |
| 18895 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18896 | @see WCTS_OpenTransport |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18897 | |
| 18898 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18899 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18900 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18901 | WDI_NotifyMsgCTSCB |
| 18902 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18903 | WCTS_HandleType wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18904 | WCTS_NotifyEventType wctsEvent, |
| 18905 | void* wctsNotifyCBData |
| 18906 | ) |
| 18907 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18908 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsNotifyCBData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18909 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18910 | |
| 18911 | if (NULL == pWDICtx ) |
| 18912 | { |
| 18913 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18914 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18915 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18916 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18917 | } |
| 18918 | |
| 18919 | if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic) |
| 18920 | { |
| 18921 | /* callback presumably occurred after close */ |
| 18922 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18923 | "%s: Invalid control block", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18924 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18925 | } |
| 18926 | |
| 18927 | if ( WCTS_EVENT_OPEN == wctsEvent ) |
| 18928 | { |
| 18929 | /*Flag must be set atomically as it is checked from incoming request |
| 18930 | functions*/ |
| 18931 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18932 | pWDICtx->bCTOpened = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18933 | |
| 18934 | /*Nothing to do - so try to dequeue any pending request that may have |
| 18935 | occurred while we were trying to establish this*/ |
| 18936 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18937 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18938 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18939 | else if ( WCTS_EVENT_CLOSE == wctsEvent ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18940 | { |
| 18941 | /*Flag must be set atomically as it is checked from incoming request |
| 18942 | functions*/ |
| 18943 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18944 | pWDICtx->bCTOpened = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18945 | |
| 18946 | /*No other request will be processed from now on - fail all*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18947 | WDI_ClearPendingRequests(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18948 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 18949 | |
| 18950 | /*Notify that the Control Channel is closed */ |
| 18951 | wpalEventSet(&pWDICtx->wctsActionEvent); |
| 18952 | } |
| 18953 | |
| 18954 | }/*WDI_NotifyMsgCTSCB*/ |
| 18955 | |
| 18956 | |
| 18957 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18958 | @brief This callback is invoked by the control transport |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18959 | when it wishes to send up a packet received over the |
| 18960 | bus. |
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 | @param |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18963 | |
| 18964 | wctsHandle: handle to the control transport service |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18965 | pMsg: the packet |
| 18966 | uLen: the packet length |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18967 | wctsRxMsgCBData: the callback data of the user |
| 18968 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18969 | @see WCTS_OpenTransport |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18970 | |
| 18971 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18972 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18973 | void |
| 18974 | WDI_RXMsgCTSCB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18975 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18976 | WCTS_HandleType wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18977 | void* pMsg, |
| 18978 | wpt_uint32 uLen, |
| 18979 | void* wctsRxMsgCBData |
| 18980 | ) |
| 18981 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18982 | tHalMsgHeader *pHalMsgHeader; |
| 18983 | WDI_EventInfoType wdiEventData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18984 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsRxMsgCBData; |
| 18985 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 18986 | |
| 18987 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18988 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18989 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18990 | if ((NULL == pWDICtx ) || ( NULL == pMsg ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18991 | ( uLen < sizeof(tHalMsgHeader))) |
| 18992 | { |
| 18993 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18994 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18995 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18996 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18997 | } |
| 18998 | |
| 18999 | if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic) |
| 19000 | { |
| 19001 | /* callback presumably occurred after close */ |
| 19002 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19003 | "%s: Invalid control block", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19004 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19005 | } |
| 19006 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19007 | /*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] | 19008 | context - so no serialization is necessary here |
| 19009 | ! - revisit this assumption */ |
| 19010 | |
| 19011 | pHalMsgHeader = (tHalMsgHeader *)pMsg; |
| 19012 | |
| 19013 | if ( uLen != pHalMsgHeader->msgLen ) |
| 19014 | { |
| 19015 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19016 | "Invalid packet received from HAL - catastrophic failure"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19017 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); |
| 19018 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19019 | } |
| 19020 | |
| 19021 | wdiEventData.wdiResponse = HAL_2_WDI_RSP_TYPE( pHalMsgHeader->msgType ); |
| 19022 | |
| 19023 | /*The message itself starts after the header*/ |
| 19024 | wdiEventData.pEventData = (wpt_uint8*)pMsg + sizeof(tHalMsgHeader); |
| 19025 | wdiEventData.uEventDataSize = pHalMsgHeader->msgLen - sizeof(tHalMsgHeader); |
| 19026 | wdiEventData.pCBfnc = gWDICb.pfncRspCB; |
| 19027 | wdiEventData.pUserData = gWDICb.pRspCBUserData; |
| 19028 | |
| 19029 | |
| 19030 | if ( wdiEventData.wdiResponse == pWDICtx->wdiExpectedResponse ) |
| 19031 | { |
| 19032 | /*Stop the timer as the response was received */ |
| 19033 | /*!UT - check for potential race conditions between stop and response */ |
| 19034 | wpalTimerStop(&pWDICtx->wptResponseTimer); |
| 19035 | } |
| 19036 | /* Check if we receive a response message which is not expected */ |
| 19037 | else if ( wdiEventData.wdiResponse < WDI_HAL_IND_MIN ) |
| 19038 | { |
| 19039 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 19040 | "Received response %s (%d) when expecting %s (%d) - catastrophic failure", |
| 19041 | WDI_getRespMsgString(wdiEventData.wdiResponse), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19042 | wdiEventData.wdiResponse, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19043 | WDI_getRespMsgString(pWDICtx->wdiExpectedResponse), |
| 19044 | pWDICtx->wdiExpectedResponse); |
| 19045 | /* WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); */ |
| 19046 | return; |
| 19047 | } |
| 19048 | |
| 19049 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19050 | "Rx smth from HAL: %d", wdiEventData.wdiResponse); |
| 19051 | |
| 19052 | /*Post response event to the state machine*/ |
| 19053 | WDI_PostMainEvent(pWDICtx, WDI_RESPONSE_EVENT, &wdiEventData); |
| 19054 | |
| 19055 | }/*WDI_RXMsgCTSCB*/ |
| 19056 | |
| 19057 | |
| 19058 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19059 | Internal Helper Routines |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19060 | ========================================================================*/ |
| 19061 | |
| 19062 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19063 | @brief WDI_CleanCB - internal helper routine used to clean the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19064 | WDI Main Control Block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19065 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19066 | @param pWDICtx - pointer to the control block |
| 19067 | |
| 19068 | @return Result of the function call |
| 19069 | */ |
| 19070 | WPT_INLINE WDI_Status |
| 19071 | WDI_CleanCB |
| 19072 | ( |
| 19073 | WDI_ControlBlockType* pWDICtx |
| 19074 | ) |
| 19075 | { |
| 19076 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19077 | |
| 19078 | /*Clean the WDI Control Block*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19079 | wpalMemoryZero( pWDICtx, sizeof(*pWDICtx)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19080 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19081 | pWDICtx->uGlobalState = WDI_MAX_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19082 | pWDICtx->ucMaxBssids = WDI_MAX_SUPPORTED_BSS; |
| 19083 | pWDICtx->ucMaxStations = WDI_MAX_SUPPORTED_STAS; |
| 19084 | |
| 19085 | WDI_ResetAssocSessions( pWDICtx ); |
| 19086 | |
| 19087 | return WDI_STATUS_SUCCESS; |
| 19088 | }/*WDI_CleanCB*/ |
| 19089 | |
| 19090 | |
| 19091 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19092 | @brief Process request helper function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19093 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19094 | |
| 19095 | @param pWDICtx: pointer to the WLAN DAL context |
| 19096 | pEventData: pointer to the event information structure |
| 19097 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19098 | @see |
| 19099 | @return Result of the function call |
| 19100 | */ |
| 19101 | WPT_INLINE WDI_Status |
| 19102 | WDI_ProcessRequest |
| 19103 | ( |
| 19104 | WDI_ControlBlockType* pWDICtx, |
| 19105 | WDI_EventInfoType* pEventData |
| 19106 | ) |
| 19107 | { |
| 19108 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19109 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19110 | /*!! Skip sanity check as this is called from the FSM functionss which |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19111 | already checked these pointers*/ |
| 19112 | |
| 19113 | if (( pEventData->wdiRequest < WDI_MAX_UMAC_IND ) && |
| 19114 | ( NULL != pfnReqProcTbl[pEventData->wdiRequest] )) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19115 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19116 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19117 | "Calling request processing function for req %s (%d) %x", |
| 19118 | WDI_getReqMsgString(pEventData->wdiRequest), |
| 19119 | pEventData->wdiRequest, pfnReqProcTbl[pEventData->wdiRequest]); |
| 19120 | return pfnReqProcTbl[pEventData->wdiRequest](pWDICtx, pEventData); |
| 19121 | } |
| 19122 | else |
| 19123 | { |
| 19124 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19125 | "Operation %d is not yet implemented ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19126 | pEventData->wdiRequest); |
| 19127 | return WDI_STATUS_E_NOT_IMPLEMENT; |
| 19128 | } |
| 19129 | }/*WDI_ProcessRequest*/ |
| 19130 | |
| 19131 | |
| 19132 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19133 | @brief Get message helper function - it allocates memory for a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19134 | message that is to be sent to HAL accross the bus and |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19135 | prefixes it with a send message header |
| 19136 | |
| 19137 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19138 | wdiReqType: type of the request being sent |
| 19139 | uBufferLen: message buffer len |
| 19140 | pMsgBuffer: resulting allocated buffer |
| 19141 | pusDataOffset: offset in the buffer where the caller |
| 19142 | can start copying its message data |
| 19143 | puBufferSize: the resulting buffer size (offset+buff |
| 19144 | len) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19145 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19146 | @see |
| 19147 | @return Result of the function call |
| 19148 | */ |
| 19149 | WDI_Status |
| 19150 | WDI_GetMessageBuffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19151 | ( |
| 19152 | WDI_ControlBlockType* pWDICtx, |
| 19153 | WDI_RequestEnumType wdiReqType, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19154 | wpt_uint16 usBufferLen, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19155 | wpt_uint8** pMsgBuffer, |
| 19156 | wpt_uint16* pusDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19157 | wpt_uint16* pusBufferSize |
| 19158 | ) |
| 19159 | { |
| 19160 | tHalMsgHeader halMsgHeader; |
| 19161 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19162 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19163 | /*!! No sanity check here as we trust the called - ! check this assumption |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19164 | again*/ |
| 19165 | |
| 19166 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19167 | Try to allocate message buffer from PAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19168 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19169 | *pusBufferSize = sizeof(halMsgHeader) + usBufferLen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19170 | *pMsgBuffer = (wpt_uint8*)wpalMemoryAllocate(*pusBufferSize); |
| 19171 | if ( NULL == *pMsgBuffer ) |
| 19172 | { |
| 19173 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19174 | "Unable to allocate message buffer for req %s (%d)", |
| 19175 | WDI_getReqMsgString(wdiReqType), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19176 | wdiReqType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19177 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19178 | return WDI_STATUS_MEM_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19179 | } |
| 19180 | |
| 19181 | /*------------------------------------------------------------------------- |
| 19182 | Fill in the message header |
| 19183 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19184 | halMsgHeader.msgType = WDI_2_HAL_REQ_TYPE(wdiReqType); |
| 19185 | /* Fill msgVersion */ |
| 19186 | #ifdef WLAN_FEATURE_11AC |
| 19187 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 19188 | halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19189 | else |
| 19190 | #endif |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 19191 | halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19192 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19193 | halMsgHeader.msgLen = sizeof(halMsgHeader) + usBufferLen; |
| 19194 | *pusDataOffset = sizeof(halMsgHeader); |
| 19195 | wpalMemoryCopy(*pMsgBuffer, &halMsgHeader, sizeof(halMsgHeader)); |
| 19196 | |
| 19197 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19198 | }/*WDI_GetMessageBuffer*/ |
| 19199 | |
| 19200 | |
| 19201 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19202 | @brief Send message helper function - sends a message over the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19203 | bus using the control tranport and saves some info in |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19204 | the CB |
| 19205 | |
| 19206 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19207 | pSendBuffer: buffer to be sent |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19208 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19209 | usSendSize size of the buffer to be sent |
| 19210 | pRspCb: response callback - save in the WDI |
| 19211 | CB |
| 19212 | pUserData: user data associated with the |
| 19213 | callback |
| 19214 | wdiExpectedResponse: the code of the response that is |
| 19215 | expected to be rx-ed for this request |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19216 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19217 | @see |
| 19218 | @return Result of the function call |
| 19219 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19220 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19221 | WDI_SendMsg |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19222 | ( |
| 19223 | WDI_ControlBlockType* pWDICtx, |
| 19224 | wpt_uint8* pSendBuffer, |
| 19225 | wpt_uint32 usSendSize, |
| 19226 | void* pRspCb, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19227 | void* pUserData, |
| 19228 | WDI_ResponseEnumType wdiExpectedResponse |
| 19229 | ) |
| 19230 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19231 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19232 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19233 | |
| 19234 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19235 | Save needed info in the CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19236 | ------------------------------------------------------------------------*/ |
| 19237 | pWDICtx->pRspCBUserData = pUserData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19238 | pWDICtx->pfncRspCB = pRspCb; |
| 19239 | pWDICtx->wdiExpectedResponse = wdiExpectedResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19240 | |
| 19241 | /*----------------------------------------------------------------------- |
| 19242 | Call the CTS to send this message over - free message afterwards |
| 19243 | - notify transport failure |
| 19244 | Note: CTS is reponsible for freeing the message buffer. |
| 19245 | -----------------------------------------------------------------------*/ |
| 19246 | if ( 0 != WCTS_SendMessage( pWDICtx->wctsHandle, (void*)pSendBuffer, usSendSize )) |
| 19247 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19248 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19249 | "Failed to send message over the bus - catastrophic failure"); |
| 19250 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19251 | wdiStatus = WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19252 | } |
| 19253 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19254 | /*Check if originator provided a request status callback*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19255 | if ( NULL != pWDICtx->wdiReqStatusCB ) |
| 19256 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19257 | /*Inform originator whether request went through or not*/ |
| 19258 | WDI_ReqStatusCb callback = pWDICtx->wdiReqStatusCB; |
| 19259 | void *callbackContext = pWDICtx->pReqStatusUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19260 | pWDICtx->wdiReqStatusCB = NULL; |
| 19261 | pWDICtx->pReqStatusUserData = NULL; |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19262 | callback(wdiStatus, callbackContext); |
| 19263 | |
| 19264 | /*For WDI requests which have registered a request callback, |
| 19265 | inform the WDA caller of the same via setting the return value |
| 19266 | (wdiStatus) to WDI_STATUS_PENDING. This makes sure that WDA doesnt |
| 19267 | end up repeating the functonality in the req callback for the |
| 19268 | WDI_STATUS_E_FAILURE case*/ |
| 19269 | if (wdiStatus == WDI_STATUS_E_FAILURE) |
| 19270 | wdiStatus = WDI_STATUS_PENDING; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19271 | } |
| 19272 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19273 | if ( wdiStatus == WDI_STATUS_SUCCESS ) |
| 19274 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19275 | /*Start timer for the expected response */ |
| 19276 | wpalTimerStart(&pWDICtx->wptResponseTimer, WDI_RESPONSE_TIMEOUT); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19277 | } |
| 19278 | else |
| 19279 | { |
| 19280 | /*Inform upper stack layers that a transport fatal error occured*/ |
| 19281 | WDI_DetectedDeviceError(pWDICtx, WDI_ERR_TRANSPORT_FAILURE); |
| 19282 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19283 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19284 | return wdiStatus; |
| 19285 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19286 | }/*WDI_SendMsg*/ |
| 19287 | |
| 19288 | |
| 19289 | |
| 19290 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19291 | @brief Send indication helper function - sends a message over |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19292 | the bus using the control transport and saves some info |
| 19293 | in the CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19294 | |
| 19295 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19296 | pSendBuffer: buffer to be sent |
| 19297 | usSendSize: size of the buffer to be sent |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19298 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19299 | @see |
| 19300 | @return Result of the function call |
| 19301 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19302 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19303 | WDI_SendIndication |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19304 | ( |
| 19305 | WDI_ControlBlockType* pWDICtx, |
| 19306 | wpt_uint8* pSendBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19307 | wpt_uint32 usSendSize |
| 19308 | ) |
| 19309 | { |
| 19310 | wpt_uint32 uStatus ; |
| 19311 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19312 | |
| 19313 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19314 | Call the CTS to send this message over |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19315 | Note: CTS is reponsible for freeing the message buffer. |
| 19316 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19317 | uStatus = WCTS_SendMessage( pWDICtx->wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19318 | (void*)pSendBuffer, usSendSize ); |
| 19319 | |
| 19320 | /*Inform Upper MAC about the outcome of the request*/ |
| 19321 | if ( NULL != pWDICtx->wdiReqStatusCB ) |
| 19322 | { |
| 19323 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19324 | "Send indication status : %d", uStatus); |
| 19325 | |
| 19326 | pWDICtx->wdiReqStatusCB( (uStatus != 0 ) ? WDI_STATUS_E_FAILURE: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19327 | WDI_STATUS_SUCCESS, |
| 19328 | pWDICtx->pReqStatusUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19329 | } |
| 19330 | |
| 19331 | /*If sending of the message failed - it is considered catastrophic and |
| 19332 | indicates an error with the device*/ |
| 19333 | if ( 0 != uStatus) |
| 19334 | { |
| 19335 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19336 | "Failed to send indication over the bus - catastrophic failure"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19337 | |
| 19338 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_TRANSPORT_FAILURE); |
| 19339 | return WDI_STATUS_E_FAILURE; |
| 19340 | } |
| 19341 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19342 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19343 | }/*WDI_SendIndication*/ |
| 19344 | |
| 19345 | |
| 19346 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19347 | @brief WDI_DetectedDeviceError - called internally by DAL when |
| 19348 | it has detected a failure in the device |
| 19349 | |
| 19350 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19351 | usErrorCode: error code detected by WDI or received |
| 19352 | from HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19353 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19354 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19355 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19356 | */ |
| 19357 | void |
| 19358 | WDI_DetectedDeviceError |
| 19359 | ( |
| 19360 | WDI_ControlBlockType* pWDICtx, |
| 19361 | wpt_uint16 usErrorCode |
| 19362 | ) |
| 19363 | { |
| 19364 | WDI_LowLevelIndType wdiInd; |
| 19365 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19366 | |
| 19367 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19368 | "Device Error detected code: %d - transitioning to stopped state", |
| 19369 | usErrorCode); |
| 19370 | |
| 19371 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 19372 | |
| 19373 | WDI_STATableStop(pWDICtx); |
| 19374 | |
| 19375 | WDI_ResetAssocSessions(pWDICtx); |
| 19376 | |
| 19377 | /*Set the expected state transition to stopped - because the device |
| 19378 | experienced a failure*/ |
| 19379 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 19380 | |
| 19381 | /*Transition to stopped to fail all incomming requests from this point on*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19382 | WDI_STATE_TRANSITION( pWDICtx, WDI_STOPPED_ST); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19383 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19384 | WDI_ClearPendingRequests(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19385 | |
| 19386 | /*TO DO: - there should be an attempt to reset the device here*/ |
| 19387 | |
| 19388 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 19389 | |
| 19390 | /*------------------------------------------------------------------------ |
| 19391 | Notify UMAC if a handler is registered |
| 19392 | ------------------------------------------------------------------------*/ |
| 19393 | if (pWDICtx->wdiLowLevelIndCB) |
| 19394 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19395 | wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND; |
| 19396 | wdiInd.wdiIndicationData.usErrorCode = usErrorCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19397 | |
| 19398 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData); |
| 19399 | } |
| 19400 | }/*WDI_DetectedDeviceError*/ |
| 19401 | |
| 19402 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19403 | @brief This callback is invoked by the wpt when a timer that |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19404 | we started on send message has expire - this should |
| 19405 | never happen - it means device is stuck and cannot |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19406 | reply - trigger catastrophic failure |
| 19407 | @param |
| 19408 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19409 | pUserData: the callback data of the user (ptr to WDI CB) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19410 | |
| 19411 | @see |
| 19412 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19413 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19414 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19415 | WDI_ResponseTimerCB |
| 19416 | ( |
| 19417 | void *pUserData |
| 19418 | ) |
| 19419 | { |
| 19420 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData; |
| 19421 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19422 | |
| 19423 | if (NULL == pWDICtx ) |
| 19424 | { |
| 19425 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19426 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19427 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19428 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19429 | } |
| 19430 | |
| 19431 | if ( WDI_MAX_RESP != pWDICtx->wdiExpectedResponse ) |
| 19432 | { |
| 19433 | |
| 19434 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19435 | "Timeout occurred while waiting for %s (%d) message from device " |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19436 | " - catastrophic failure", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19437 | WDI_getRespMsgString(pWDICtx->wdiExpectedResponse), |
| 19438 | pWDICtx->wdiExpectedResponse); |
| 19439 | /* WDI timeout means Riva is not responding or SMD communication to Riva |
| 19440 | * is not happening. The only possible way to recover from this error |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 19441 | * is to initiate SSR from APPS |
| 19442 | * There is also an option to re-enable wifi, which will eventually |
| 19443 | * trigger SSR |
| 19444 | */ |
| 19445 | #ifndef WDI_RE_ENABLE_WIFI_ON_WDI_TIMEOUT |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 19446 | wpalWcnssResetIntr(); |
| 19447 | /* if this timer fires, it means Riva did not receive the FIQ */ |
| 19448 | wpalTimerStart(&pWDICtx->ssrTimer, WDI_SSR_TIMEOUT); |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 19449 | #else |
| 19450 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 19451 | wpalWlanReload(); |
| 19452 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19453 | } |
| 19454 | else |
| 19455 | { |
| 19456 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19457 | "Timeout occurred but not waiting for any response %d", |
| 19458 | pWDICtx->wdiExpectedResponse); |
| 19459 | } |
| 19460 | |
| 19461 | return; |
| 19462 | |
| 19463 | }/*WDI_ResponseTimerCB*/ |
| 19464 | |
| 19465 | |
| 19466 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19467 | @brief Process response helper function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19468 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19469 | |
| 19470 | @param pWDICtx: pointer to the WLAN DAL context |
| 19471 | pEventData: pointer to the event information structure |
| 19472 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19473 | @see |
| 19474 | @return Result of the function call |
| 19475 | */ |
| 19476 | WPT_INLINE WDI_Status |
| 19477 | WDI_ProcessResponse |
| 19478 | ( |
| 19479 | WDI_ControlBlockType* pWDICtx, |
| 19480 | WDI_EventInfoType* pEventData |
| 19481 | ) |
| 19482 | { |
| 19483 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19484 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19485 | /* Skip sanity check as this is called from the FSM functions which |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19486 | already checked these pointers |
| 19487 | ! - revisit this assumption */ |
| 19488 | if (( pEventData->wdiResponse < WDI_MAX_RESP ) && |
| 19489 | ( NULL != pfnRspProcTbl[pEventData->wdiResponse] )) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19490 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19491 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19492 | "Calling response processing function for resp %s (%d) %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19493 | WDI_getRespMsgString(pEventData->wdiResponse), |
| 19494 | pEventData->wdiResponse, pfnRspProcTbl[pEventData->wdiResponse]); |
| 19495 | return pfnRspProcTbl[pEventData->wdiResponse](pWDICtx, pEventData); |
| 19496 | } |
| 19497 | else |
| 19498 | { |
| 19499 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19500 | "Operation %d is not yet implemented ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19501 | pEventData->wdiResponse); |
| 19502 | return WDI_STATUS_E_NOT_IMPLEMENT; |
| 19503 | } |
| 19504 | }/*WDI_ProcessResponse*/ |
| 19505 | |
| 19506 | |
| 19507 | /*========================================================================= |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19508 | QUEUE SUPPORT UTILITY FUNCTIONS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19509 | =========================================================================*/ |
| 19510 | |
| 19511 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19512 | @brief Utility function used by the DAL Core to help queue a |
| 19513 | request that cannot be processed right away. |
| 19514 | @param |
| 19515 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19516 | pWDICtx: - pointer to the WDI control block |
| 19517 | pEventData: - pointer to the evnt info that needs to be |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19518 | queued |
| 19519 | |
| 19520 | @see |
| 19521 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19522 | */ |
| 19523 | WDI_Status |
| 19524 | WDI_QueuePendingReq |
| 19525 | ( |
| 19526 | WDI_ControlBlockType* pWDICtx, |
| 19527 | WDI_EventInfoType* pEventData |
| 19528 | ) |
| 19529 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19530 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19531 | WDI_EventInfoType* pEventDataQueue = wpalMemoryAllocate(sizeof(*pEventData)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19532 | void* pEventInfo = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19533 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19534 | |
| 19535 | if ( NULL == pEventDataQueue ) |
| 19536 | { |
| 19537 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19538 | "Cannot allocate memory for queueing"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19539 | WDI_ASSERT(0); |
| 19540 | return WDI_STATUS_MEM_FAILURE; |
| 19541 | } |
| 19542 | |
| 19543 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 19544 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 19545 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 19546 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19547 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19548 | |
| 19549 | if( pEventData->uEventDataSize != 0 && pEventData->pEventData != NULL ) |
| 19550 | { |
| 19551 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19552 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19553 | if ( NULL == pEventInfo ) |
| 19554 | { |
| 19555 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19556 | "Cannot allocate memory for queueing event data info"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19557 | WDI_ASSERT(0); |
| 19558 | wpalMemoryFree(pEventDataQueue); |
| 19559 | return WDI_STATUS_MEM_FAILURE; |
| 19560 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19561 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19562 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 19563 | |
| 19564 | } |
| 19565 | pEventDataQueue->pEventData = pEventInfo; |
| 19566 | |
| 19567 | /*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] | 19568 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19569 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19570 | wpal_list_insert_back(&(pWDICtx->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19571 | |
| 19572 | return WDI_STATUS_SUCCESS; |
| 19573 | }/*WDI_QueuePendingReq*/ |
| 19574 | |
| 19575 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19576 | @brief Callback function for serializing queued message |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19577 | processing in the control context |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19578 | @param |
| 19579 | |
| 19580 | pMsg - pointer to the message |
| 19581 | |
| 19582 | @see |
| 19583 | @return Result of the operation |
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 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19586 | WDI_PALCtrlMsgCB |
| 19587 | ( |
| 19588 | wpt_msg *pMsg |
| 19589 | ) |
| 19590 | { |
| 19591 | WDI_EventInfoType* pEventData = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19592 | WDI_ControlBlockType* pWDICtx = NULL; |
| 19593 | WDI_Status wdiStatus; |
| 19594 | WDI_ReqStatusCb pfnReqStatusCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19595 | void* pUserData; |
| 19596 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19597 | |
| 19598 | if (( NULL == pMsg )|| |
| 19599 | ( NULL == (pEventData = (WDI_EventInfoType*)pMsg->ptr)) || |
| 19600 | ( NULL == (pWDICtx = (WDI_ControlBlockType*)pMsg->pContext ))) |
| 19601 | { |
| 19602 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19603 | "Invalid message received on serialize ctrl context API"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19604 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19605 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19606 | } |
| 19607 | |
| 19608 | /*Transition back to the state that we had before serialization |
| 19609 | - serialization transitions us to BUSY to stop any incomming requests |
| 19610 | ! TO DO L: possible race condition here if a request comes in between the |
| 19611 | state transition and the post function*/ |
| 19612 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19613 | WDI_STATE_TRANSITION( pWDICtx, pMsg->val); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19614 | |
| 19615 | /*----------------------------------------------------------------------- |
| 19616 | Check to see what type of event we are serializing |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19617 | - responses are never expected to come through here |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19618 | -----------------------------------------------------------------------*/ |
| 19619 | switch ( pEventData->wdiRequest ) |
| 19620 | { |
| 19621 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19622 | case WDI_STOP_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19623 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, pEventData); |
| 19624 | break; |
| 19625 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19626 | case WDI_NV_DOWNLOAD_REQ: |
| 19627 | // When WDI State is WDI_STARTED_ST, send WDI request message with event type WDI_REQUEST_EVENT. |
| 19628 | // In this case, because this request is called from response process, we could call WDI_ProcessRequest() directly. |
| 19629 | if (pWDICtx->uGlobalState == WDI_STARTED_ST) |
| 19630 | { |
| 19631 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19632 | "%s: WDI_NV_DOWNLOAD_REQ called in WDI_STARTED_ST - send with WDI_REQUEST_EVENT", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19633 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData); |
| 19634 | } |
| 19635 | else |
| 19636 | { |
| 19637 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, pEventData); |
| 19638 | } |
| 19639 | |
| 19640 | break; |
| 19641 | |
| 19642 | default: |
| 19643 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData); |
| 19644 | break; |
| 19645 | }/*switch ( pEventData->wdiRequest )*/ |
| 19646 | |
| 19647 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 19648 | { |
| 19649 | WDI_ExtractRequestCBFromEvent(pEventData, &pfnReqStatusCB, &pUserData); |
| 19650 | |
| 19651 | if ( NULL != pfnReqStatusCB ) |
| 19652 | { |
| 19653 | /*Fail the request*/ |
| 19654 | pfnReqStatusCB( wdiStatus, pUserData); |
| 19655 | } |
| 19656 | } |
| 19657 | |
| 19658 | /* Free data - that was allocated when queueing*/ |
| 19659 | if( pEventData != NULL ) |
| 19660 | { |
| 19661 | if( pEventData->pEventData != NULL ) |
| 19662 | { |
| 19663 | wpalMemoryFree(pEventData->pEventData); |
| 19664 | } |
| 19665 | wpalMemoryFree(pEventData); |
| 19666 | } |
| 19667 | |
| 19668 | if( pMsg != NULL ) |
| 19669 | { |
| 19670 | wpalMemoryFree(pMsg); |
| 19671 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19672 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19673 | }/*WDI_PALCtrlMsgCB*/ |
| 19674 | |
| 19675 | /** |
| 19676 | @brief Utility function used by the DAL Core to help dequeue |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19677 | and schedule for execution a pending request |
| 19678 | @param |
| 19679 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19680 | pWDICtx: - pointer to the WDI control block |
| 19681 | pEventData: - pointer to the evnt info that needs to be |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19682 | queued |
| 19683 | |
| 19684 | @see |
| 19685 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19686 | */ |
| 19687 | WDI_Status |
| 19688 | WDI_DequeuePendingReq |
| 19689 | ( |
| 19690 | WDI_ControlBlockType* pWDICtx |
| 19691 | ) |
| 19692 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19693 | wpt_list_node* pNode = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19694 | WDI_EventInfoType* pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19695 | wpt_msg* palMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19696 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19697 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19698 | wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19699 | |
| 19700 | if ( NULL == pNode ) |
| 19701 | { |
| 19702 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19703 | "List is empty - return"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19704 | return WDI_STATUS_SUCCESS; |
| 19705 | } |
| 19706 | |
| 19707 | /*The node actually points to the 1st element inside the Event Data struct - |
| 19708 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19709 | pEventData = (WDI_EventInfoType*)pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19710 | |
| 19711 | /*Serialize processing in the control thread |
| 19712 | !TO DO: - check to see if these are all the messages params that need |
| 19713 | to be filled in*/ |
| 19714 | palMsg = wpalMemoryAllocate(sizeof(wpt_msg)); |
| 19715 | |
| 19716 | if ( NULL == palMsg ) |
| 19717 | { |
| 19718 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19719 | "WDI_DequeuePendingReq: Cannot allocate memory for palMsg."); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19720 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19721 | return WDI_STATUS_MEM_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19722 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19723 | palMsg->pContext = pWDICtx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19724 | palMsg->callback = WDI_PALCtrlMsgCB; |
| 19725 | palMsg->ptr = pEventData; |
| 19726 | |
| 19727 | /*Save the global state as we need it on the other side*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19728 | palMsg->val = pWDICtx->uGlobalState; |
| 19729 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19730 | /*Transition back to BUSY as we need to handle a queued request*/ |
| 19731 | WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19732 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19733 | wpalPostCtrlMsg(pWDICtx->pPALContext, palMsg); |
| 19734 | |
| 19735 | return WDI_STATUS_PENDING; |
| 19736 | }/*WDI_DequeuePendingReq*/ |
| 19737 | |
| 19738 | |
| 19739 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19740 | @brief Utility function used by the DAL Core to help queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19741 | an association request that cannot be processed right |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19742 | away.- The assoc requests will be queued by BSSID |
| 19743 | @param |
| 19744 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19745 | pWDICtx: - pointer to the WDI control block |
| 19746 | pEventData: pointer to the evnt info that needs to be queued |
| 19747 | macBSSID: bssid |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19748 | |
| 19749 | @see |
| 19750 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19751 | */ |
| 19752 | WDI_Status |
| 19753 | WDI_QueueNewAssocRequest |
| 19754 | ( |
| 19755 | WDI_ControlBlockType* pWDICtx, |
| 19756 | WDI_EventInfoType* pEventData, |
| 19757 | wpt_macAddr macBSSID |
| 19758 | ) |
| 19759 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19760 | wpt_uint8 i; |
| 19761 | WDI_BSSSessionType* pSession = NULL; |
| 19762 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19763 | WDI_EventInfoType* pEventDataQueue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19764 | void* pEventInfo; |
| 19765 | WDI_NextSessionIdType* pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19766 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
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 | |
| 19769 | /*------------------------------------------------------------------------ |
| 19770 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19771 | ------------------------------------------------------------------------*/ |
| 19772 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 19773 | { |
| 19774 | if ( eWLAN_PAL_FALSE == pWDICtx->aBSSSessions[i].bInUse ) |
| 19775 | { |
| 19776 | /*Found an empty session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19777 | pSession = &pWDICtx->aBSSSessions[i]; |
| 19778 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19779 | } |
| 19780 | } |
| 19781 | |
| 19782 | if ( i >= WDI_MAX_BSS_SESSIONS ) |
| 19783 | { |
| 19784 | /*Cannot find any empty sessions*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19785 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19786 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19787 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19788 | /*------------------------------------------------------------------------ |
| 19789 | Fill in the BSSID for this session and set the usage flag |
| 19790 | ------------------------------------------------------------------------*/ |
| 19791 | wpalMemoryCopy(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19792 | pWDICtx->aBSSSessions[i].bInUse = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19793 | |
| 19794 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19795 | Allocate memory for this and place it in the queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19796 | ------------------------------------------------------------------------*/ |
| 19797 | pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType)); |
| 19798 | if ( NULL == pEventDataQueue ) |
| 19799 | { |
| 19800 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19801 | "%s: Cannot allocate memory for queue node", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19802 | WDI_ASSERT(0); |
| 19803 | return WDI_STATUS_MEM_FAILURE; |
| 19804 | } |
| 19805 | |
| 19806 | pSessionIdElement = (WDI_NextSessionIdType*)wpalMemoryAllocate(sizeof(WDI_NextSessionIdType)); |
| 19807 | if ( NULL == pSessionIdElement ) |
| 19808 | { |
| 19809 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19810 | "%s: Cannot allocate memory for session ID", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19811 | WDI_ASSERT(0); |
| 19812 | wpalMemoryFree(pEventDataQueue); |
| 19813 | return WDI_STATUS_MEM_FAILURE; |
| 19814 | } |
| 19815 | |
| 19816 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
| 19817 | if ( NULL == pEventInfo ) |
| 19818 | { |
| 19819 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19820 | "%s: Cannot allocate memory for event data info", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19821 | WDI_ASSERT(0); |
| 19822 | wpalMemoryFree(pSessionIdElement); |
| 19823 | wpalMemoryFree(pEventDataQueue); |
| 19824 | return WDI_STATUS_MEM_FAILURE; |
| 19825 | } |
| 19826 | |
| 19827 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 19828 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 19829 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 19830 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19831 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19832 | |
| 19833 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 19834 | pEventDataQueue->pEventData = pEventInfo; |
| 19835 | |
| 19836 | /*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] | 19837 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19838 | |
| 19839 | /*This association is currently being queued*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19840 | pSession->bAssocReqQueued = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19841 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19842 | wpal_list_insert_back(&(pSession->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19843 | |
| 19844 | /*We need to maintain a separate list that keeps track of the order in which |
| 19845 | the new assoc requests are being queued such that we can start processing |
| 19846 | them in the order that they had arrived*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19847 | pSessionIdElement->ucIndex = i; |
| 19848 | pNode = (wpt_list_node*)pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19849 | |
| 19850 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19851 | "Queueing up new assoc session : %d ", pSessionIdElement->ucIndex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19852 | wpal_list_insert_back(&pWDICtx->wptPendingAssocSessionIdQueue, pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19853 | |
| 19854 | /*Return pending as this is what the status of the request is since it has |
| 19855 | been queued*/ |
| 19856 | return WDI_STATUS_PENDING; |
| 19857 | }/*WDI_QueueNewAssocRequest*/ |
| 19858 | |
| 19859 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19860 | @brief Utility function used by the DAL Core to help queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19861 | an association request that cannot be processed right |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19862 | away.- The assoc requests will be queued by BSSID |
| 19863 | @param |
| 19864 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19865 | pWDICtx: - pointer to the WDI control block |
| 19866 | pSession: - session in which to queue |
| 19867 | pEventData: pointer to the event info that needs to be |
| 19868 | queued |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19869 | |
| 19870 | @see |
| 19871 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19872 | */ |
| 19873 | WDI_Status |
| 19874 | WDI_QueueAssocRequest |
| 19875 | ( |
| 19876 | WDI_ControlBlockType* pWDICtx, |
| 19877 | WDI_BSSSessionType* pSession, |
| 19878 | WDI_EventInfoType* pEventData |
| 19879 | ) |
| 19880 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19881 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19882 | WDI_EventInfoType* pEventDataQueue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19883 | void* pEventInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19884 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19885 | |
| 19886 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19887 | Sanity check |
| 19888 | ------------------------------------------------------------------------*/ |
| 19889 | if (( NULL == pSession ) || ( NULL == pWDICtx )) |
| 19890 | { |
| 19891 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19892 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19893 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19894 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19895 | } |
| 19896 | |
| 19897 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19898 | Allocate memory for this and place it in the queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19899 | ------------------------------------------------------------------------*/ |
| 19900 | pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType)); |
| 19901 | if ( NULL == pEventDataQueue ) |
| 19902 | { |
| 19903 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19904 | "%s: Cannot allocate memory for queueing", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19905 | WDI_ASSERT(0); |
| 19906 | return WDI_STATUS_MEM_FAILURE; |
| 19907 | } |
| 19908 | |
| 19909 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
| 19910 | if ( NULL == pEventInfo ) |
| 19911 | { |
| 19912 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19913 | "%s: Cannot allocate memory for queueing event data info", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19914 | __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19915 | WDI_ASSERT(0); |
| 19916 | wpalMemoryFree(pEventDataQueue); |
| 19917 | return WDI_STATUS_MEM_FAILURE; |
| 19918 | } |
| 19919 | |
| 19920 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 19921 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 19922 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 19923 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19924 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19925 | pEventDataQueue->pEventData = pEventInfo; |
| 19926 | |
| 19927 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 19928 | |
| 19929 | /*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] | 19930 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19931 | |
| 19932 | /*This association is currently being queued*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19933 | pSession->bAssocReqQueued = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19934 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19935 | wpal_list_insert_back(&(pSession->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19936 | |
| 19937 | /*The result of this operation is pending because the request has been |
| 19938 | queued and it will be processed at a later moment in time */ |
| 19939 | return WDI_STATUS_PENDING; |
| 19940 | }/*WDI_QueueAssocRequest*/ |
| 19941 | |
| 19942 | /** |
| 19943 | @brief Utility function used by the DAL Core to help dequeue |
| 19944 | an association request that was pending |
| 19945 | The request will be queued up in front of the main |
| 19946 | pending queue for imediate processing |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19947 | @param |
| 19948 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19949 | pWDICtx: - pointer to the WDI control block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19950 | |
| 19951 | |
| 19952 | @see |
| 19953 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19954 | */ |
| 19955 | WDI_Status |
| 19956 | WDI_DequeueAssocRequest |
| 19957 | ( |
| 19958 | WDI_ControlBlockType* pWDICtx |
| 19959 | ) |
| 19960 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19961 | wpt_list_node* pNode = NULL; |
| 19962 | WDI_NextSessionIdType* pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19963 | WDI_BSSSessionType* pSession; |
| 19964 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19965 | |
| 19966 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19967 | Sanity check |
| 19968 | ------------------------------------------------------------------------*/ |
| 19969 | if ( NULL == pWDICtx ) |
| 19970 | { |
| 19971 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19972 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19973 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19974 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19975 | } |
| 19976 | |
| 19977 | /*------------------------------------------------------------------------ |
| 19978 | An association has been completed => a new association can occur |
| 19979 | Check to see if there are any pending associations -> |
| 19980 | If so , transfer all the pending requests into the busy queue for |
| 19981 | processing |
| 19982 | These requests have arrived prior to the requests in the busy queue |
| 19983 | (bc they needed to be processed in order to be placed in this queue) |
| 19984 | => they will be placed at the front of the busy queue |
| 19985 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19986 | wpal_list_remove_front(&(pWDICtx->wptPendingAssocSessionIdQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19987 | |
| 19988 | if ( NULL == pNode ) |
| 19989 | { |
| 19990 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19991 | "List is empty - return"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19992 | return WDI_STATUS_SUCCESS; |
| 19993 | } |
| 19994 | |
| 19995 | /*The node actually points to the 1st element inside the Session Id struct - |
| 19996 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19997 | pSessionIdElement = (WDI_NextSessionIdType*)pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19998 | |
| 19999 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 20000 | "Dequeueing new assoc session : %d ", pSessionIdElement->ucIndex); |
| 20001 | |
| 20002 | if ( pSessionIdElement->ucIndex < WDI_MAX_BSS_SESSIONS ) |
| 20003 | { |
| 20004 | pSession = &pWDICtx->aBSSSessions[pSessionIdElement->ucIndex]; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20005 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20006 | /*Transfer all the pending requests in this assoc queue to |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20007 | the front of the main waiting queue for subsequent execution*/ |
| 20008 | wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20009 | while ( NULL != pNode ) |
| 20010 | { |
| 20011 | /*Place it in front of the main pending list*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20012 | wpal_list_insert_front( &(pWDICtx->wptPendingQueue), &pNode); |
| 20013 | wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20014 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20015 | pSession->bAssocReqQueued = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20016 | } |
| 20017 | else |
| 20018 | { |
| 20019 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20020 | "Invalid session id queued up for assoc"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20021 | WPAL_ASSERT(0); |
| 20022 | wpalMemoryFree(pSessionIdElement); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20023 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20024 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20025 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20026 | /*Clean this up as it is no longer needed in order to prevent memory leak*/ |
| 20027 | wpalMemoryFree(pSessionIdElement); |
| 20028 | return WDI_STATUS_SUCCESS; |
| 20029 | }/*WDI_DequeueAssocRequest*/ |
| 20030 | |
| 20031 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20032 | @brief Utility function used by the DAL Core to clear any |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20033 | pending requests - all req cb will be called with |
| 20034 | failure and the queue will be emptied. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20035 | @param |
| 20036 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20037 | pWDICtx: - pointer to the WDI control block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20038 | |
| 20039 | @see |
| 20040 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20041 | */ |
| 20042 | WDI_Status |
| 20043 | WDI_ClearPendingRequests |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20044 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20045 | WDI_ControlBlockType* pWDICtx |
| 20046 | ) |
| 20047 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20048 | wpt_list_node* pNode = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20049 | WDI_EventInfoType* pEventDataQueue = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20050 | WDI_ReqStatusCb pfnReqStatusCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20051 | void* pUserData; |
| 20052 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20053 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20054 | wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20055 | |
| 20056 | /*------------------------------------------------------------------------ |
| 20057 | Go through all the requests and fail them - this will only be called |
| 20058 | 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] | 20059 | pending requests can no longer be sent down to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20060 | ------------------------------------------------------------------------*/ |
| 20061 | while( pNode ) |
| 20062 | { |
| 20063 | /*The node actually points to the 1st element inside the Event Data struct - |
| 20064 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20065 | pEventDataQueue = (WDI_EventInfoType*)pNode; |
| 20066 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20067 | WDI_ExtractRequestCBFromEvent(pEventDataQueue, &pfnReqStatusCB, &pUserData); |
| 20068 | if ( NULL != pfnReqStatusCB ) |
| 20069 | { |
| 20070 | /*Fail the request*/ |
| 20071 | pfnReqStatusCB( WDI_STATUS_E_FAILURE, pUserData); |
| 20072 | } |
| 20073 | /* Free data - that was allocated when queueing */ |
| 20074 | if ( pEventDataQueue->pEventData != NULL ) |
| 20075 | { |
| 20076 | wpalMemoryFree(pEventDataQueue->pEventData); |
| 20077 | } |
| 20078 | wpalMemoryFree(pEventDataQueue); |
| 20079 | |
| 20080 | if (wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode) != eWLAN_PAL_STATUS_SUCCESS) |
| 20081 | { |
| 20082 | break; |
| 20083 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20084 | } |
| 20085 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20086 | return WDI_STATUS_SUCCESS; |
| 20087 | }/*WDI_ClearPendingRequests*/ |
| 20088 | |
| 20089 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20090 | @brief Helper routine used to init the BSS Sessions in the WDI control block |
| 20091 | |
| 20092 | |
| 20093 | @param pWDICtx: pointer to the WLAN DAL context |
| 20094 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20095 | @see |
| 20096 | */ |
| 20097 | void |
| 20098 | WDI_ResetAssocSessions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20099 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20100 | WDI_ControlBlockType* pWDICtx |
| 20101 | ) |
| 20102 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20103 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20104 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20105 | |
| 20106 | /*------------------------------------------------------------------------- |
| 20107 | No Sanity check |
| 20108 | -------------------------------------------------------------------------*/ |
| 20109 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 20110 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20111 | wpalMemoryZero( &pWDICtx->aBSSSessions[i], sizeof(WDI_BSSSessionType) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20112 | pWDICtx->aBSSSessions[i].wdiAssocState = WDI_ASSOC_INIT_ST; |
| 20113 | pWDICtx->aBSSSessions[i].bcastStaIdx = WDI_STA_INVALID_IDX; |
| 20114 | pWDICtx->aBSSSessions[i].ucBSSIdx = WDI_BSS_INVALID_IDX; |
| 20115 | } |
| 20116 | }/*WDI_ResetAssocSessions*/ |
| 20117 | |
| 20118 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20119 | @brief Helper routine used to find a session based on the BSSID |
| 20120 | |
| 20121 | |
| 20122 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20123 | macBSSID: BSSID of the session |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20124 | pSession: pointer to the session (if found) |
| 20125 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20126 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20127 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20128 | */ |
| 20129 | wpt_uint8 |
| 20130 | WDI_FindAssocSession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20131 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20132 | WDI_ControlBlockType* pWDICtx, |
| 20133 | wpt_macAddr macBSSID, |
| 20134 | WDI_BSSSessionType** ppSession |
| 20135 | ) |
| 20136 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20137 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20138 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20139 | |
| 20140 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20141 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20142 | -------------------------------------------------------------------------*/ |
| 20143 | if ( NULL == ppSession ) |
| 20144 | { |
| 20145 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20146 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20147 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20148 | } |
| 20149 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20150 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20151 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20152 | /*------------------------------------------------------------------------ |
| 20153 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20154 | ------------------------------------------------------------------------*/ |
| 20155 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 20156 | { |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 20157 | if ( (pWDICtx->aBSSSessions[i].bInUse == eWLAN_PAL_TRUE) && |
| 20158 | (eWLAN_PAL_TRUE == |
| 20159 | wpalMemoryCompare(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, |
| 20160 | WDI_MAC_ADDR_LEN)) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20161 | { |
| 20162 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20163 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20164 | return i; |
| 20165 | } |
| 20166 | } |
| 20167 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20168 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20169 | }/*WDI_FindAssocSession*/ |
| 20170 | |
| 20171 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20172 | @brief Helper routine used to find a session based on the BSSID |
| 20173 | |
| 20174 | |
| 20175 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20176 | ucBSSIdx: BSS Index of the session |
| 20177 | ppSession: out pointer to the session (if found) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20178 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20179 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20180 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20181 | */ |
| 20182 | wpt_uint8 |
| 20183 | WDI_FindAssocSessionByBSSIdx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20184 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20185 | WDI_ControlBlockType* pWDICtx, |
| 20186 | wpt_uint16 ucBSSIdx, |
| 20187 | WDI_BSSSessionType** ppSession |
| 20188 | ) |
| 20189 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20190 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20191 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20192 | |
| 20193 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20194 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20195 | -------------------------------------------------------------------------*/ |
| 20196 | if ( NULL == ppSession ) |
| 20197 | { |
| 20198 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20199 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20200 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20201 | } |
| 20202 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20203 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20204 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20205 | /*------------------------------------------------------------------------ |
| 20206 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20207 | ------------------------------------------------------------------------*/ |
| 20208 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 20209 | { |
| 20210 | if ( ucBSSIdx == pWDICtx->aBSSSessions[i].ucBSSIdx ) |
| 20211 | { |
| 20212 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20213 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20214 | return i; |
| 20215 | } |
| 20216 | } |
| 20217 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20218 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20219 | }/*WDI_FindAssocSessionByBSSIdx*/ |
| 20220 | |
| 20221 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20222 | @brief Helper routine used to find a session based on the BSSID |
| 20223 | |
| 20224 | |
| 20225 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20226 | ucBSSIdx: BSS Index of the session |
| 20227 | ppSession: out pointer to the session (if found) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20228 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20229 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20230 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20231 | */ |
| 20232 | wpt_uint8 |
| 20233 | WDI_FindAssocSessionByIdx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20234 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20235 | WDI_ControlBlockType* pWDICtx, |
| 20236 | wpt_uint16 usIdx, |
| 20237 | WDI_BSSSessionType** ppSession |
| 20238 | ) |
| 20239 | { |
| 20240 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20241 | |
| 20242 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20243 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20244 | -------------------------------------------------------------------------*/ |
| 20245 | if ( NULL == ppSession || usIdx >= WDI_MAX_BSS_SESSIONS ) |
| 20246 | { |
| 20247 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20248 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20249 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20250 | } |
| 20251 | |
| 20252 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20253 | *ppSession = &pWDICtx->aBSSSessions[usIdx]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20254 | |
| 20255 | return usIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20256 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20257 | }/*WDI_FindAssocSessionByBSSIdx*/ |
| 20258 | |
| 20259 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20260 | @brief Helper routine used to find an empty session in the WDI |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20261 | CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20262 | |
| 20263 | |
| 20264 | @param pWDICtx: pointer to the WLAN DAL context |
| 20265 | pSession: pointer to the session (if found) |
| 20266 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20267 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20268 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20269 | */ |
| 20270 | wpt_uint8 |
| 20271 | WDI_FindEmptySession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20272 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20273 | WDI_ControlBlockType* pWDICtx, |
| 20274 | WDI_BSSSessionType** ppSession |
| 20275 | ) |
| 20276 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20277 | wpt_uint8 i; |
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 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20281 | -------------------------------------------------------------------------*/ |
| 20282 | if ( NULL == ppSession ) |
| 20283 | { |
| 20284 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20285 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20286 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20287 | } |
| 20288 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20289 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20290 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20291 | /*------------------------------------------------------------------------ |
| 20292 | Search for a session that it is not in use |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20293 | ------------------------------------------------------------------------*/ |
| 20294 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 20295 | { |
| 20296 | if ( ! pWDICtx->aBSSSessions[i].bInUse ) |
| 20297 | { |
| 20298 | /*Found a session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20299 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20300 | return i; |
| 20301 | } |
| 20302 | } |
| 20303 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20304 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20305 | }/*WDI_FindEmptySession*/ |
| 20306 | |
| 20307 | |
| 20308 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20309 | @brief Helper routine used to get the total count of active |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20310 | sessions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20311 | |
| 20312 | |
| 20313 | @param pWDICtx: pointer to the WLAN DAL context |
| 20314 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20315 | @see |
| 20316 | @return Number of sessions in use |
| 20317 | */ |
| 20318 | wpt_uint8 |
| 20319 | WDI_GetActiveSessionsCount |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20320 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20321 | WDI_ControlBlockType* pWDICtx |
| 20322 | ) |
| 20323 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20324 | wpt_uint8 i, ucCount = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20325 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20326 | |
| 20327 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20328 | Count all sessions in use |
| 20329 | ------------------------------------------------------------------------*/ |
| 20330 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 20331 | { |
| 20332 | if ( pWDICtx->aBSSSessions[i].bInUse ) |
| 20333 | { |
| 20334 | ucCount++; |
| 20335 | } |
| 20336 | } |
| 20337 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20338 | return ucCount; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20339 | }/*WDI_GetActiveSessionsCount*/ |
| 20340 | |
| 20341 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20342 | @brief Helper routine used to delete session in the WDI |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20343 | CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20344 | |
| 20345 | |
| 20346 | @param pWDICtx: pointer to the WLAN DAL context |
| 20347 | pSession: pointer to the session (if found) |
| 20348 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20349 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20350 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20351 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20352 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20353 | WDI_DeleteSession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20354 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20355 | WDI_ControlBlockType* pWDICtx, |
| 20356 | WDI_BSSSessionType* ppSession |
| 20357 | ) |
| 20358 | { |
| 20359 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20360 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20361 | -------------------------------------------------------------------------*/ |
| 20362 | if ( NULL == ppSession ) |
| 20363 | { |
| 20364 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20365 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20366 | return ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20367 | } |
| 20368 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20369 | /*------------------------------------------------------------------------ |
| 20370 | Reset the entries int session |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20371 | ------------------------------------------------------------------------*/ |
| 20372 | wpal_list_destroy(&ppSession->wptPendingQueue); |
| 20373 | wpalMemoryZero(ppSession, sizeof(*ppSession)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20374 | ppSession->wdiAssocState = WDI_ASSOC_INIT_ST; |
| 20375 | ppSession->bInUse = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20376 | ppSession->wdiBssType = WDI_INFRASTRUCTURE_MODE; |
| 20377 | wpal_list_init(&ppSession->wptPendingQueue); |
| 20378 | |
| 20379 | }/*WDI_DeleteSession*/ |
| 20380 | |
| 20381 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20382 | @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] | 20383 | The bcast STA ID is assigned by HAL and must be valid. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20384 | @param |
| 20385 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20386 | WDI_AddStaParams: - pointer to the WDI Add STA params |
| 20387 | usBcastStaIdx: - Broadcast STA index passed by HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20388 | |
| 20389 | @see |
| 20390 | @return void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20391 | */ |
| 20392 | void |
| 20393 | WDI_AddBcastSTAtoSTATable |
| 20394 | ( |
| 20395 | WDI_ControlBlockType* pWDICtx, |
| 20396 | WDI_AddStaParams * staParams, |
| 20397 | wpt_uint16 usBcastStaIdx |
| 20398 | ) |
| 20399 | { |
| 20400 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 20401 | wpt_macAddr bcastMacAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; |
| 20402 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20403 | |
| 20404 | /*--------------------------------------------------------------------- |
| 20405 | Sanity check |
| 20406 | ---------------------------------------------------------------------*/ |
| 20407 | if ( NULL == staParams ) |
| 20408 | { |
| 20409 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20410 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20411 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20412 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20413 | } |
| 20414 | |
| 20415 | wdiAddSTAParam.bcastDpuIndex = staParams->bcastDpuIndex; |
| 20416 | wdiAddSTAParam.bcastDpuSignature = staParams->bcastDpuSignature; |
| 20417 | wdiAddSTAParam.bcastMgmtDpuIndex = staParams->bcastMgmtDpuIndex; |
| 20418 | wdiAddSTAParam.bcastMgmtDpuSignature = staParams->bcastMgmtDpuSignature; |
| 20419 | wdiAddSTAParam.dpuIndex = staParams->dpuIndex; |
| 20420 | wdiAddSTAParam.dpuSig = staParams->dpuSig; |
| 20421 | wpalMemoryCopy( wdiAddSTAParam.macBSSID, staParams->macBSSID, |
| 20422 | WDI_MAC_ADDR_LEN ); |
| 20423 | wpalMemoryCopy( wdiAddSTAParam.staMacAddr, bcastMacAddr, WDI_MAC_ADDR_LEN ); |
| 20424 | wdiAddSTAParam.ucBSSIdx = staParams->ucBSSIdx; |
| 20425 | wdiAddSTAParam.ucHTCapable = staParams->ucHTCapable; |
| 20426 | wdiAddSTAParam.ucRmfEnabled = staParams->ucRmfEnabled; |
| 20427 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_BCAST; |
| 20428 | wdiAddSTAParam.ucWmmEnabled = staParams->ucWmmEnabled; |
| 20429 | wdiAddSTAParam.ucSTAIdx = usBcastStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20430 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20431 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 20432 | } |
| 20433 | |
| 20434 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20435 | @brief NV blob will be divided into fragments of size 4kb and |
| 20436 | Sent to HAL |
| 20437 | |
| 20438 | @param pWDICtx: pointer to the WLAN DAL context |
| 20439 | pEventData: pointer to the event information structure |
| 20440 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20441 | @see |
| 20442 | @return Result of the function call |
| 20443 | */ |
| 20444 | |
| 20445 | WDI_Status WDI_SendNvBlobReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20446 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20447 | WDI_ControlBlockType* pWDICtx, |
| 20448 | WDI_EventInfoType* pEventData |
| 20449 | ) |
| 20450 | { |
| 20451 | |
| 20452 | tHalNvImgDownloadReqMsg halNvImgDownloadParam; |
| 20453 | wpt_uint8* pSendBuffer = NULL; |
| 20454 | wpt_uint16 usDataOffset = 0; |
| 20455 | wpt_uint16 usSendSize = 0; |
| 20456 | wpt_uint16 usCurrentFragmentSize =0; |
| 20457 | wpt_uint8* pSrcBuffer = NULL; |
| 20458 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams =NULL ; |
| 20459 | WDI_NvDownloadRspCb wdiNvDownloadRspCb; |
| 20460 | |
| 20461 | wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pEventData->pCBfnc; |
| 20462 | WDI_ASSERT(NULL != wdiNvDownloadRspCb); |
| 20463 | pwdiNvDownloadReqParams = (WDI_NvDownloadReqParamsType*)pEventData->pEventData; |
| 20464 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20465 | /* Sanity Check is done by the caller */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20466 | pSrcBuffer =(wpt_uint8 *) pwdiNvDownloadReqParams->wdiBlobInfo.pBlobAddress; |
| 20467 | |
| 20468 | /* Update the current Fragment Number */ |
| 20469 | pWDICtx->wdiNvBlobInfo.usCurrentFragment += 1; |
| 20470 | |
| 20471 | /*Update the HAL REQ structure */ |
| 20472 | /*HAL maintaining the fragment count as 0,1,2...n where at WDI it is represented as 1,2,3.. n*/ |
| 20473 | halNvImgDownloadParam.nvImageReqParams.fragNumber = |
| 20474 | pWDICtx->wdiNvBlobInfo.usCurrentFragment-1; |
| 20475 | |
| 20476 | /* 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] | 20477 | 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] | 20478 | image will be sent to HAL*/ |
| 20479 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20480 | if(pWDICtx->wdiNvBlobInfo.usTotalFragment |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20481 | == pWDICtx->wdiNvBlobInfo.usCurrentFragment) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20482 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20483 | /* Taking care of boundry condition */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20484 | if( !(usCurrentFragmentSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20485 | pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize%FRAGMENT_SIZE )) |
| 20486 | usCurrentFragmentSize = FRAGMENT_SIZE; |
| 20487 | |
| 20488 | /*Update the HAL REQ structure */ |
| 20489 | halNvImgDownloadParam.nvImageReqParams.isLastFragment = 1; |
| 20490 | halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize= usCurrentFragmentSize; |
| 20491 | |
| 20492 | } |
| 20493 | else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20494 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20495 | usCurrentFragmentSize = FRAGMENT_SIZE; |
| 20496 | |
| 20497 | /*Update the HAL REQ structure */ |
| 20498 | halNvImgDownloadParam.nvImageReqParams.isLastFragment =0; |
| 20499 | halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize = usCurrentFragmentSize; |
| 20500 | } |
| 20501 | |
| 20502 | /*----------------------------------------------------------------------- |
| 20503 | Get message buffer |
| 20504 | -----------------------------------------------------------------------*/ |
| 20505 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,WDI_NV_DOWNLOAD_REQ, |
| 20506 | sizeof(halNvImgDownloadParam.nvImageReqParams)+ usCurrentFragmentSize, |
| 20507 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20508 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20509 | (usDataOffset + sizeof(halNvImgDownloadParam.nvImageReqParams) + usCurrentFragmentSize ))) |
| 20510 | { |
| 20511 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 20512 | "Unable to get send buffer in NV Download req %x %x ", |
| 20513 | pEventData, pwdiNvDownloadReqParams); |
| 20514 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20515 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20516 | } |
| 20517 | |
| 20518 | /* Copying the Hal NV download REQ structure */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20519 | wpalMemoryCopy(pSendBuffer + usDataOffset , |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20520 | &halNvImgDownloadParam.nvImageReqParams ,sizeof(tHalNvImgDownloadReqParams)); |
| 20521 | |
| 20522 | /* Appending the NV image fragment */ |
| 20523 | wpalMemoryCopy(pSendBuffer + usDataOffset + sizeof(tHalNvImgDownloadReqParams), |
| 20524 | (void *)(pSrcBuffer + halNvImgDownloadParam.nvImageReqParams.fragNumber * FRAGMENT_SIZE), |
| 20525 | usCurrentFragmentSize); |
| 20526 | |
| 20527 | pWDICtx->wdiReqStatusCB = pwdiNvDownloadReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20528 | pWDICtx->pReqStatusUserData = pwdiNvDownloadReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20529 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20530 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 20531 | wdiNvDownloadRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20532 | WDI_NV_DOWNLOAD_RESP); |
| 20533 | |
| 20534 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20535 | /*============================================================================ |
| 20536 | Helper inline functions for |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20537 | ============================================================================*/ |
| 20538 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20539 | @brief Helper routine used to find a session based on the BSSID |
| 20540 | @param pContext: pointer to the WLAN DAL context |
| 20541 | @param pDPContext: pointer to the Datapath context |
| 20542 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20543 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20544 | @return |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20545 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20546 | WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20547 | WDI_DS_AssignDatapathContext (void *pContext, void *pDPContext) |
| 20548 | { |
| 20549 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 20550 | |
| 20551 | pCB->pDPContext = pDPContext; |
| 20552 | return; |
| 20553 | } |
| 20554 | |
| 20555 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20556 | @brief Helper routine used to find a session based on the BSSID |
| 20557 | |
| 20558 | |
| 20559 | @param pContext: pointer to the WLAN DAL context |
| 20560 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20561 | @see |
| 20562 | @return pointer to Datapath context |
| 20563 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20564 | WPT_INLINE void * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20565 | WDI_DS_GetDatapathContext (void *pContext) |
| 20566 | { |
| 20567 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 20568 | return pCB->pDPContext; |
| 20569 | } |
| 20570 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20571 | @brief Helper routine used to find a session based on the BSSID |
| 20572 | |
| 20573 | |
| 20574 | @param pContext: pointer to the WLAN DAL context |
| 20575 | @param pDTDriverContext: pointer to the Transport Driver context |
| 20576 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20577 | @see |
| 20578 | @return void |
| 20579 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20580 | WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20581 | WDT_AssignTransportDriverContext (void *pContext, void *pDTDriverContext) |
| 20582 | { |
| 20583 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 20584 | |
| 20585 | pCB->pDTDriverContext = pDTDriverContext; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20586 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20587 | } |
| 20588 | |
| 20589 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20590 | @brief Helper routine used to find a session based on the BSSID |
| 20591 | |
| 20592 | |
| 20593 | @param pWDICtx: pointer to the WLAN DAL context |
| 20594 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20595 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20596 | @return pointer to datapath context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20597 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20598 | WPT_INLINE void * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20599 | WDT_GetTransportDriverContext (void *pContext) |
| 20600 | { |
| 20601 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20602 | return(pCB->pDTDriverContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20603 | } |
| 20604 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20605 | /*============================================================================ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20606 | Helper inline converters |
| 20607 | ============================================================================*/ |
| 20608 | /*Convert WDI driver type into HAL driver type*/ |
| 20609 | WPT_STATIC WPT_INLINE WDI_Status |
| 20610 | WDI_HAL_2_WDI_STATUS |
| 20611 | ( |
| 20612 | eHalStatus halStatus |
| 20613 | ) |
| 20614 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20615 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20616 | the chances of getting inlined*/ |
| 20617 | switch( halStatus ) |
| 20618 | { |
| 20619 | case eHAL_STATUS_SUCCESS: |
| 20620 | case eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO: |
| 20621 | case eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO: |
| 20622 | return WDI_STATUS_SUCCESS; |
| 20623 | case eHAL_STATUS_FAILURE: |
| 20624 | return WDI_STATUS_E_FAILURE; |
| 20625 | case eHAL_STATUS_FAILED_ALLOC: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20626 | return WDI_STATUS_MEM_FAILURE; |
| 20627 | /*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] | 20628 | they refer to specific internal modules of our device*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20629 | default: |
| 20630 | return WDI_STATUS_DEV_INTERNAL_FAILURE; |
| 20631 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20632 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20633 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20634 | }/*WDI_HAL_2_WDI_STATUS*/ |
| 20635 | |
| 20636 | /*Convert WDI request type into HAL request type*/ |
| 20637 | WPT_STATIC WPT_INLINE tHalHostMsgType |
| 20638 | WDI_2_HAL_REQ_TYPE |
| 20639 | ( |
| 20640 | WDI_RequestEnumType wdiReqType |
| 20641 | ) |
| 20642 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20643 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20644 | the chances of getting inlined*/ |
| 20645 | switch( wdiReqType ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20646 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20647 | case WDI_START_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20648 | return WLAN_HAL_START_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20649 | case WDI_STOP_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20650 | return WLAN_HAL_STOP_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20651 | case WDI_INIT_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20652 | return WLAN_HAL_INIT_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20653 | case WDI_START_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20654 | return WLAN_HAL_START_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20655 | case WDI_END_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20656 | return WLAN_HAL_END_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20657 | case WDI_FINISH_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20658 | return WLAN_HAL_FINISH_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20659 | case WDI_JOIN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20660 | return WLAN_HAL_JOIN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20661 | case WDI_CONFIG_BSS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20662 | return WLAN_HAL_CONFIG_BSS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20663 | case WDI_DEL_BSS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20664 | return WLAN_HAL_DELETE_BSS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20665 | case WDI_POST_ASSOC_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20666 | return WLAN_HAL_POST_ASSOC_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20667 | case WDI_DEL_STA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20668 | return WLAN_HAL_DELETE_STA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20669 | case WDI_SET_BSS_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20670 | return WLAN_HAL_SET_BSSKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20671 | case WDI_RMV_BSS_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20672 | return WLAN_HAL_RMV_BSSKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20673 | case WDI_SET_STA_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20674 | return WLAN_HAL_SET_STAKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20675 | case WDI_RMV_STA_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20676 | return WLAN_HAL_RMV_STAKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20677 | case WDI_SET_STA_BCAST_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20678 | return WLAN_HAL_SET_BCASTKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20679 | case WDI_RMV_STA_BCAST_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20680 | //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] | 20681 | return WLAN_HAL_RMV_STAKEY_REQ; |
| 20682 | case WDI_ADD_TS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20683 | return WLAN_HAL_ADD_TS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20684 | case WDI_DEL_TS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20685 | return WLAN_HAL_DEL_TS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20686 | case WDI_UPD_EDCA_PRMS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20687 | return WLAN_HAL_UPD_EDCA_PARAMS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20688 | case WDI_ADD_BA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20689 | return WLAN_HAL_ADD_BA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20690 | case WDI_DEL_BA_REQ: |
| 20691 | return WLAN_HAL_DEL_BA_REQ; |
| 20692 | #ifdef FEATURE_WLAN_CCX |
| 20693 | case WDI_TSM_STATS_REQ: |
| 20694 | return WLAN_HAL_TSM_STATS_REQ; |
| 20695 | #endif |
| 20696 | case WDI_CH_SWITCH_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20697 | return WLAN_HAL_CH_SWITCH_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20698 | case WDI_CONFIG_STA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20699 | return WLAN_HAL_CONFIG_STA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20700 | case WDI_SET_LINK_ST_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20701 | return WLAN_HAL_SET_LINK_ST_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20702 | case WDI_GET_STATS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20703 | return WLAN_HAL_GET_STATS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20704 | case WDI_UPDATE_CFG_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20705 | return WLAN_HAL_UPDATE_CFG_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20706 | case WDI_ADD_BA_SESSION_REQ: |
| 20707 | return WLAN_HAL_ADD_BA_SESSION_REQ; |
| 20708 | case WDI_TRIGGER_BA_REQ: |
| 20709 | return WLAN_HAL_TRIGGER_BA_REQ; |
| 20710 | case WDI_UPD_BCON_PRMS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20711 | return WLAN_HAL_UPDATE_BEACON_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20712 | case WDI_SND_BCON_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20713 | return WLAN_HAL_SEND_BEACON_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20714 | case WDI_UPD_PROBE_RSP_TEMPLATE_REQ: |
| 20715 | return WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ; |
| 20716 | case WDI_SET_MAX_TX_POWER_REQ: |
| 20717 | return WLAN_HAL_SET_MAX_TX_POWER_REQ; |
| 20718 | #ifdef WLAN_FEATURE_P2P |
| 20719 | case WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ: |
| 20720 | return WLAN_HAL_SET_P2P_GONOA_REQ; |
| 20721 | #endif |
| 20722 | case WDI_ENTER_IMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20723 | return WLAN_HAL_ENTER_IMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20724 | case WDI_EXIT_IMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20725 | return WLAN_HAL_EXIT_IMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20726 | case WDI_ENTER_BMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20727 | return WLAN_HAL_ENTER_BMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20728 | case WDI_EXIT_BMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20729 | return WLAN_HAL_EXIT_BMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20730 | case WDI_ENTER_UAPSD_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20731 | return WLAN_HAL_ENTER_UAPSD_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20732 | case WDI_EXIT_UAPSD_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20733 | return WLAN_HAL_EXIT_UAPSD_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20734 | case WDI_SET_UAPSD_PARAM_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20735 | return WLAN_HAL_SET_UAPSD_AC_PARAMS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20736 | case WDI_UPDATE_UAPSD_PARAM_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20737 | return WLAN_HAL_UPDATE_UAPSD_PARAM_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20738 | case WDI_CONFIGURE_RXP_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20739 | return WLAN_HAL_CONFIGURE_RXP_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20740 | case WDI_SET_BEACON_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20741 | return WLAN_HAL_ADD_BCN_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20742 | case WDI_REM_BEACON_FILTER_REQ: |
| 20743 | return WLAN_HAL_REM_BCN_FILTER_REQ; |
| 20744 | case WDI_SET_RSSI_THRESHOLDS_REQ: |
| 20745 | return WLAN_HAL_SET_RSSI_THRESH_REQ; |
| 20746 | case WDI_HOST_OFFLOAD_REQ: |
| 20747 | return WLAN_HAL_HOST_OFFLOAD_REQ; |
| 20748 | case WDI_WOWL_ADD_BC_PTRN_REQ: |
| 20749 | return WLAN_HAL_ADD_WOWL_BCAST_PTRN; |
| 20750 | case WDI_WOWL_DEL_BC_PTRN_REQ: |
| 20751 | return WLAN_HAL_DEL_WOWL_BCAST_PTRN; |
| 20752 | case WDI_WOWL_ENTER_REQ: |
| 20753 | return WLAN_HAL_ENTER_WOWL_REQ; |
| 20754 | case WDI_WOWL_EXIT_REQ: |
| 20755 | return WLAN_HAL_EXIT_WOWL_REQ; |
| 20756 | case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ: |
| 20757 | return WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ; |
| 20758 | case WDI_NV_DOWNLOAD_REQ: |
| 20759 | return WLAN_HAL_DOWNLOAD_NV_REQ; |
| 20760 | case WDI_FLUSH_AC_REQ: |
| 20761 | return WLAN_HAL_TL_HAL_FLUSH_AC_REQ; |
| 20762 | case WDI_BTAMP_EVENT_REQ: |
| 20763 | return WLAN_HAL_SIGNAL_BTAMP_EVENT_REQ; |
| 20764 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 20765 | case WDI_AGGR_ADD_TS_REQ: |
| 20766 | return WLAN_HAL_AGGR_ADD_TS_REQ; |
| 20767 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 20768 | #ifdef ANI_MANF_DIAG |
| 20769 | case WDI_FTM_CMD_REQ: |
| 20770 | return WLAN_HAL_PROCESS_PTT_REQ; |
| 20771 | #endif /* ANI_MANF_DIAG */ |
| 20772 | case WDI_ADD_STA_SELF_REQ: |
| 20773 | return WLAN_HAL_ADD_STA_SELF_REQ; |
| 20774 | case WDI_DEL_STA_SELF_REQ: |
| 20775 | return WLAN_HAL_DEL_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20776 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 20777 | case WDI_START_OEM_DATA_REQ: |
| 20778 | return WLAN_HAL_START_OEM_DATA_REQ; |
| 20779 | #endif /* FEATURE_OEM_DATA_SUPPORT */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20780 | case WDI_HOST_RESUME_REQ: |
| 20781 | return WLAN_HAL_HOST_RESUME_REQ; |
| 20782 | case WDI_HOST_SUSPEND_IND: |
| 20783 | return WLAN_HAL_HOST_SUSPEND_IND; |
| 20784 | case WDI_KEEP_ALIVE_REQ: |
| 20785 | return WLAN_HAL_KEEP_ALIVE_REQ; |
| 20786 | |
| 20787 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 20788 | case WDI_SET_PREF_NETWORK_REQ: |
| 20789 | return WLAN_HAL_SET_PREF_NETWORK_REQ; |
| 20790 | case WDI_SET_RSSI_FILTER_REQ: |
| 20791 | return WLAN_HAL_SET_RSSI_FILTER_REQ; |
| 20792 | case WDI_UPDATE_SCAN_PARAMS_REQ: |
| 20793 | return WLAN_HAL_UPDATE_SCAN_PARAM_REQ; |
| 20794 | #endif // FEATURE_WLAN_SCAN_PNO |
| 20795 | case WDI_SET_TX_PER_TRACKING_REQ: |
| 20796 | return WLAN_HAL_SET_TX_PER_TRACKING_REQ; |
| 20797 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 20798 | case WDI_8023_MULTICAST_LIST_REQ: |
| 20799 | return WLAN_HAL_8023_MULTICAST_LIST_REQ; |
| 20800 | case WDI_RECEIVE_FILTER_SET_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20801 | return WLAN_HAL_SET_PACKET_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20802 | case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ: |
| 20803 | return WLAN_HAL_PACKET_FILTER_MATCH_COUNT_REQ; |
| 20804 | case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ: |
| 20805 | return WLAN_HAL_CLEAR_PACKET_FILTER_REQ; |
| 20806 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 20807 | case WDI_HAL_DUMP_CMD_REQ: |
| 20808 | return WLAN_HAL_DUMP_COMMAND_REQ; |
| 20809 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 20810 | case WDI_GTK_OFFLOAD_REQ: |
| 20811 | return WLAN_HAL_GTK_OFFLOAD_REQ; |
| 20812 | case WDI_GTK_OFFLOAD_GETINFO_REQ: |
| 20813 | return WLAN_HAL_GTK_OFFLOAD_GETINFO_REQ; |
| 20814 | #endif /* WLAN_FEATURE_GTK_OFFLOAD */ |
| 20815 | |
| 20816 | case WDI_INIT_SCAN_CON_REQ: |
| 20817 | return WLAN_HAL_INIT_SCAN_CON_REQ; |
| 20818 | case WDI_SET_POWER_PARAMS_REQ: |
| 20819 | return WLAN_HAL_SET_POWER_PARAMS_REQ; |
| 20820 | case WDI_SET_TM_LEVEL_REQ: |
| 20821 | return WLAN_HAL_SET_THERMAL_MITIGATION_REQ; |
| 20822 | case WDI_FEATURE_CAPS_EXCHANGE_REQ: |
| 20823 | return WLAN_HAL_FEATURE_CAPS_EXCHANGE_REQ; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 20824 | #ifdef WLAN_FEATURE_11AC |
| 20825 | case WDI_UPDATE_VHT_OP_MODE_REQ: |
| 20826 | return WLAN_HAL_UPDATE_VHT_OP_MODE_REQ; |
| 20827 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20828 | default: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20829 | return WLAN_HAL_MSG_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20830 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20831 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20832 | }/*WDI_2_HAL_REQ_TYPE*/ |
| 20833 | |
| 20834 | /*Convert WDI response type into HAL response type*/ |
| 20835 | WPT_STATIC WPT_INLINE WDI_ResponseEnumType |
| 20836 | HAL_2_WDI_RSP_TYPE |
| 20837 | ( |
| 20838 | tHalHostMsgType halMsg |
| 20839 | ) |
| 20840 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20841 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20842 | the chances of getting inlined*/ |
| 20843 | switch( halMsg ) |
| 20844 | { |
| 20845 | case WLAN_HAL_START_RSP: |
| 20846 | return WDI_START_RESP; |
| 20847 | case WLAN_HAL_STOP_RSP: |
| 20848 | return WDI_STOP_RESP; |
| 20849 | case WLAN_HAL_INIT_SCAN_RSP: |
| 20850 | return WDI_INIT_SCAN_RESP; |
| 20851 | case WLAN_HAL_START_SCAN_RSP: |
| 20852 | return WDI_START_SCAN_RESP; |
| 20853 | case WLAN_HAL_END_SCAN_RSP: |
| 20854 | return WDI_END_SCAN_RESP; |
| 20855 | case WLAN_HAL_FINISH_SCAN_RSP: |
| 20856 | return WDI_FINISH_SCAN_RESP; |
| 20857 | case WLAN_HAL_CONFIG_STA_RSP: |
| 20858 | return WDI_CONFIG_STA_RESP; |
| 20859 | case WLAN_HAL_DELETE_STA_RSP: |
| 20860 | return WDI_DEL_STA_RESP; |
| 20861 | case WLAN_HAL_CONFIG_BSS_RSP: |
| 20862 | return WDI_CONFIG_BSS_RESP; |
| 20863 | case WLAN_HAL_DELETE_BSS_RSP: |
| 20864 | return WDI_DEL_BSS_RESP; |
| 20865 | case WLAN_HAL_JOIN_RSP: |
| 20866 | return WDI_JOIN_RESP; |
| 20867 | case WLAN_HAL_POST_ASSOC_RSP: |
| 20868 | return WDI_POST_ASSOC_RESP; |
| 20869 | case WLAN_HAL_SET_BSSKEY_RSP: |
| 20870 | return WDI_SET_BSS_KEY_RESP; |
| 20871 | case WLAN_HAL_SET_STAKEY_RSP: |
| 20872 | return WDI_SET_STA_KEY_RESP; |
| 20873 | case WLAN_HAL_RMV_BSSKEY_RSP: |
| 20874 | return WDI_RMV_BSS_KEY_RESP; |
| 20875 | case WLAN_HAL_RMV_STAKEY_RSP: |
| 20876 | return WDI_RMV_STA_KEY_RESP; |
| 20877 | case WLAN_HAL_SET_BCASTKEY_RSP: |
| 20878 | return WDI_SET_STA_BCAST_KEY_RESP; |
| 20879 | //Some conflict in the old code - check this: case WLAN_HAL_RMV_BCASTKEY_RSP: |
| 20880 | // return WDI_RMV_STA_BCAST_KEY_RESP; |
| 20881 | case WLAN_HAL_ADD_TS_RSP: |
| 20882 | return WDI_ADD_TS_RESP; |
| 20883 | case WLAN_HAL_DEL_TS_RSP: |
| 20884 | return WDI_DEL_TS_RESP; |
| 20885 | case WLAN_HAL_UPD_EDCA_PARAMS_RSP: |
| 20886 | return WDI_UPD_EDCA_PRMS_RESP; |
| 20887 | case WLAN_HAL_ADD_BA_RSP: |
| 20888 | return WDI_ADD_BA_RESP; |
| 20889 | case WLAN_HAL_DEL_BA_RSP: |
| 20890 | return WDI_DEL_BA_RESP; |
| 20891 | #ifdef FEATURE_WLAN_CCX |
| 20892 | case WLAN_HAL_TSM_STATS_RSP: |
| 20893 | return WDI_TSM_STATS_RESP; |
| 20894 | #endif |
| 20895 | case WLAN_HAL_CH_SWITCH_RSP: |
| 20896 | return WDI_CH_SWITCH_RESP; |
| 20897 | case WLAN_HAL_SET_LINK_ST_RSP: |
| 20898 | return WDI_SET_LINK_ST_RESP; |
| 20899 | case WLAN_HAL_GET_STATS_RSP: |
| 20900 | return WDI_GET_STATS_RESP; |
| 20901 | case WLAN_HAL_UPDATE_CFG_RSP: |
| 20902 | return WDI_UPDATE_CFG_RESP; |
| 20903 | case WLAN_HAL_ADD_BA_SESSION_RSP: |
| 20904 | return WDI_ADD_BA_SESSION_RESP; |
| 20905 | case WLAN_HAL_TRIGGER_BA_RSP: |
| 20906 | return WDI_TRIGGER_BA_RESP; |
| 20907 | case WLAN_HAL_UPDATE_BEACON_RSP: |
| 20908 | return WDI_UPD_BCON_PRMS_RESP; |
| 20909 | case WLAN_HAL_SEND_BEACON_RSP: |
| 20910 | return WDI_SND_BCON_RESP; |
| 20911 | case WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP: |
| 20912 | return WDI_UPD_PROBE_RSP_TEMPLATE_RESP; |
| 20913 | /*Indications*/ |
| 20914 | case WLAN_HAL_RSSI_NOTIFICATION_IND: |
| 20915 | return WDI_HAL_RSSI_NOTIFICATION_IND; |
| 20916 | case WLAN_HAL_MISSED_BEACON_IND: |
| 20917 | return WDI_HAL_MISSED_BEACON_IND; |
| 20918 | case WLAN_HAL_UNKNOWN_ADDR2_FRAME_RX_IND: |
| 20919 | return WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND; |
| 20920 | case WLAN_HAL_MIC_FAILURE_IND: |
| 20921 | return WDI_HAL_MIC_FAILURE_IND; |
| 20922 | case WLAN_HAL_FATAL_ERROR_IND: |
| 20923 | return WDI_HAL_FATAL_ERROR_IND; |
| 20924 | case WLAN_HAL_DELETE_STA_CONTEXT_IND: |
| 20925 | return WDI_HAL_DEL_STA_IND; |
| 20926 | case WLAN_HAL_COEX_IND: |
| 20927 | return WDI_HAL_COEX_IND; |
| 20928 | case WLAN_HAL_OTA_TX_COMPL_IND: |
| 20929 | return WDI_HAL_TX_COMPLETE_IND; |
| 20930 | #ifdef WLAN_FEATURE_P2P |
| 20931 | case WLAN_HAL_P2P_NOA_ATTR_IND: |
| 20932 | return WDI_HAL_P2P_NOA_ATTR_IND; |
| 20933 | #endif |
| 20934 | case WLAN_HAL_TX_PER_HIT_IND: |
| 20935 | return WDI_HAL_TX_PER_HIT_IND; |
| 20936 | case WLAN_HAL_SET_MAX_TX_POWER_RSP: |
| 20937 | return WDI_SET_MAX_TX_POWER_RESP; |
| 20938 | #ifdef WLAN_FEATURE_P2P |
| 20939 | case WLAN_HAL_SET_P2P_GONOA_RSP: |
| 20940 | return WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP; |
| 20941 | #endif |
| 20942 | case WLAN_HAL_ENTER_IMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20943 | return WDI_ENTER_IMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20944 | case WLAN_HAL_EXIT_IMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20945 | return WDI_EXIT_IMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20946 | case WLAN_HAL_ENTER_BMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20947 | return WDI_ENTER_BMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20948 | case WLAN_HAL_EXIT_BMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20949 | return WDI_EXIT_BMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20950 | case WLAN_HAL_ENTER_UAPSD_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20951 | return WDI_ENTER_UAPSD_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20952 | case WLAN_HAL_EXIT_UAPSD_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20953 | return WDI_EXIT_UAPSD_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20954 | case WLAN_HAL_SET_UAPSD_AC_PARAMS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20955 | return WDI_SET_UAPSD_PARAM_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20956 | case WLAN_HAL_UPDATE_UAPSD_PARAM_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20957 | return WDI_UPDATE_UAPSD_PARAM_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20958 | case WLAN_HAL_CONFIGURE_RXP_FILTER_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20959 | return WDI_CONFIGURE_RXP_FILTER_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20960 | case WLAN_HAL_ADD_BCN_FILTER_RSP: |
| 20961 | return WDI_SET_BEACON_FILTER_RESP; |
| 20962 | case WLAN_HAL_REM_BCN_FILTER_RSP: |
| 20963 | return WDI_REM_BEACON_FILTER_RESP; |
| 20964 | case WLAN_HAL_SET_RSSI_THRESH_RSP: |
| 20965 | return WDI_SET_RSSI_THRESHOLDS_RESP; |
| 20966 | case WLAN_HAL_HOST_OFFLOAD_RSP: |
| 20967 | return WDI_HOST_OFFLOAD_RESP; |
| 20968 | case WLAN_HAL_ADD_WOWL_BCAST_PTRN_RSP: |
| 20969 | return WDI_WOWL_ADD_BC_PTRN_RESP; |
| 20970 | case WLAN_HAL_DEL_WOWL_BCAST_PTRN_RSP: |
| 20971 | return WDI_WOWL_DEL_BC_PTRN_RESP; |
| 20972 | case WLAN_HAL_ENTER_WOWL_RSP: |
| 20973 | return WDI_WOWL_ENTER_RESP; |
| 20974 | case WLAN_HAL_EXIT_WOWL_RSP: |
| 20975 | return WDI_WOWL_EXIT_RESP; |
| 20976 | case WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP: |
| 20977 | return WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP; |
| 20978 | case WLAN_HAL_DOWNLOAD_NV_RSP: |
| 20979 | return WDI_NV_DOWNLOAD_RESP; |
| 20980 | case WLAN_HAL_TL_HAL_FLUSH_AC_RSP: |
| 20981 | return WDI_FLUSH_AC_RESP; |
| 20982 | case WLAN_HAL_SIGNAL_BTAMP_EVENT_RSP: |
| 20983 | return WDI_BTAMP_EVENT_RESP; |
| 20984 | #ifdef ANI_MANF_DIAG |
| 20985 | case WLAN_HAL_PROCESS_PTT_RSP: |
| 20986 | return WDI_FTM_CMD_RESP; |
| 20987 | #endif /* ANI_MANF_DIAG */ |
| 20988 | case WLAN_HAL_ADD_STA_SELF_RSP: |
| 20989 | return WDI_ADD_STA_SELF_RESP; |
| 20990 | case WLAN_HAL_DEL_STA_SELF_RSP: |
| 20991 | return WDI_DEL_STA_SELF_RESP; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20992 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 20993 | case WLAN_HAL_START_OEM_DATA_RSP: |
| 20994 | return WDI_START_OEM_DATA_RESP; |
| 20995 | #endif /* FEATURE_OEM_DATA_SUPPORT */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20996 | case WLAN_HAL_HOST_RESUME_RSP: |
| 20997 | return WDI_HOST_RESUME_RESP; |
| 20998 | case WLAN_HAL_KEEP_ALIVE_RSP: |
| 20999 | return WDI_KEEP_ALIVE_RESP; |
| 21000 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 21001 | case WLAN_HAL_SET_PREF_NETWORK_RSP: |
| 21002 | return WDI_SET_PREF_NETWORK_RESP; |
| 21003 | case WLAN_HAL_SET_RSSI_FILTER_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21004 | return WDI_SET_RSSI_FILTER_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21005 | case WLAN_HAL_UPDATE_SCAN_PARAM_RSP: |
| 21006 | return WDI_UPDATE_SCAN_PARAMS_RESP; |
| 21007 | case WLAN_HAL_PREF_NETW_FOUND_IND: |
| 21008 | return WDI_HAL_PREF_NETWORK_FOUND_IND; |
| 21009 | #endif // FEATURE_WLAN_SCAN_PNO |
| 21010 | case WLAN_HAL_SET_TX_PER_TRACKING_RSP: |
| 21011 | return WDI_SET_TX_PER_TRACKING_RESP; |
| 21012 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 21013 | case WLAN_HAL_8023_MULTICAST_LIST_RSP: |
| 21014 | return WDI_8023_MULTICAST_LIST_RESP; |
| 21015 | case WLAN_HAL_SET_PACKET_FILTER_RSP: |
| 21016 | return WDI_RECEIVE_FILTER_SET_FILTER_RESP; |
| 21017 | case WLAN_HAL_PACKET_FILTER_MATCH_COUNT_RSP: |
| 21018 | return WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP; |
| 21019 | case WLAN_HAL_CLEAR_PACKET_FILTER_RSP: |
| 21020 | return WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP; |
| 21021 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 21022 | |
| 21023 | case WLAN_HAL_DUMP_COMMAND_RSP: |
| 21024 | return WDI_HAL_DUMP_CMD_RESP; |
| 21025 | case WLAN_HAL_SET_POWER_PARAMS_RSP: |
| 21026 | return WDI_SET_POWER_PARAMS_RESP; |
| 21027 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 21028 | case WLAN_HAL_AGGR_ADD_TS_RSP: |
| 21029 | return WDI_AGGR_ADD_TS_RESP; |
| 21030 | #endif |
| 21031 | |
| 21032 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 21033 | case WLAN_HAL_GTK_OFFLOAD_RSP: |
| 21034 | return WDI_GTK_OFFLOAD_RESP; |
| 21035 | case WLAN_HAL_GTK_OFFLOAD_GETINFO_RSP: |
| 21036 | return WDI_GTK_OFFLOAD_GETINFO_RESP; |
| 21037 | #endif /* WLAN_FEATURE_GTK_OFFLOAD */ |
| 21038 | #ifdef WLAN_WAKEUP_EVENTS |
| 21039 | case WLAN_HAL_WAKE_REASON_IND: |
| 21040 | return WDI_HAL_WAKE_REASON_IND; |
| 21041 | #endif // WLAN_WAKEUP_EVENTS |
| 21042 | |
| 21043 | case WLAN_HAL_SET_THERMAL_MITIGATION_RSP: |
| 21044 | return WDI_SET_TM_LEVEL_RESP; |
| 21045 | case WLAN_HAL_FEATURE_CAPS_EXCHANGE_RSP: |
| 21046 | return WDI_FEATURE_CAPS_EXCHANGE_RESP; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 21047 | #ifdef WLAN_FEATURE_11AC |
| 21048 | case WLAN_HAL_UPDATE_VHT_OP_MODE_RSP: |
| 21049 | return WDI_UPDATE_VHT_OP_MODE_RESP; |
| 21050 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21051 | default: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21052 | return eDRIVER_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21053 | } |
| 21054 | |
| 21055 | }/*HAL_2_WDI_RSP_TYPE*/ |
| 21056 | |
| 21057 | |
| 21058 | /*Convert WDI driver type into HAL driver type*/ |
| 21059 | WPT_STATIC WPT_INLINE tDriverType |
| 21060 | WDI_2_HAL_DRV_TYPE |
| 21061 | ( |
| 21062 | WDI_DriverType wdiDriverType |
| 21063 | ) |
| 21064 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21065 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21066 | the chances of getting inlined*/ |
| 21067 | switch( wdiDriverType ) |
| 21068 | { |
| 21069 | case WDI_DRIVER_TYPE_PRODUCTION: |
| 21070 | return eDRIVER_TYPE_PRODUCTION; |
| 21071 | case WDI_DRIVER_TYPE_MFG: |
| 21072 | return eDRIVER_TYPE_MFG; |
| 21073 | case WDI_DRIVER_TYPE_DVT: |
| 21074 | return eDRIVER_TYPE_DVT; |
| 21075 | } |
| 21076 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21077 | return eDRIVER_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21078 | }/*WDI_2_HAL_DRV_TYPE*/ |
| 21079 | |
| 21080 | |
| 21081 | /*Convert WDI stop reason into HAL stop reason*/ |
| 21082 | WPT_STATIC WPT_INLINE tHalStopType |
| 21083 | WDI_2_HAL_STOP_REASON |
| 21084 | ( |
| 21085 | WDI_StopType wdiDriverType |
| 21086 | ) |
| 21087 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21088 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21089 | the chances of getting inlined*/ |
| 21090 | switch( wdiDriverType ) |
| 21091 | { |
| 21092 | case WDI_STOP_TYPE_SYS_RESET: |
| 21093 | return HAL_STOP_TYPE_SYS_RESET; |
| 21094 | case WDI_DRIVER_TYPE_MFG: |
| 21095 | return WDI_STOP_TYPE_SYS_DEEP_SLEEP; |
| 21096 | case WDI_STOP_TYPE_RF_KILL: |
| 21097 | return HAL_STOP_TYPE_RF_KILL; |
| 21098 | } |
| 21099 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21100 | return HAL_STOP_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21101 | }/*WDI_2_HAL_STOP_REASON*/ |
| 21102 | |
| 21103 | |
| 21104 | /*Convert WDI scan mode type into HAL scan mode type*/ |
| 21105 | WPT_STATIC WPT_INLINE eHalSysMode |
| 21106 | WDI_2_HAL_SCAN_MODE |
| 21107 | ( |
| 21108 | WDI_ScanMode wdiScanMode |
| 21109 | ) |
| 21110 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21111 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21112 | the chances of getting inlined*/ |
| 21113 | switch( wdiScanMode ) |
| 21114 | { |
| 21115 | case WDI_SCAN_MODE_NORMAL: |
| 21116 | return eHAL_SYS_MODE_NORMAL; |
| 21117 | case WDI_SCAN_MODE_LEARN: |
| 21118 | return eHAL_SYS_MODE_LEARN; |
| 21119 | case WDI_SCAN_MODE_SCAN: |
| 21120 | return eHAL_SYS_MODE_SCAN; |
| 21121 | case WDI_SCAN_MODE_PROMISC: |
| 21122 | return eHAL_SYS_MODE_PROMISC; |
| 21123 | case WDI_SCAN_MODE_SUSPEND_LINK: |
| 21124 | return eHAL_SYS_MODE_SUSPEND_LINK; |
Madan Mohan Koyyalamudi | 9b87678 | 2012-10-11 16:22:51 -0700 | [diff] [blame] | 21125 | case WDI_SCAN_MODE_ROAM_SCAN: |
| 21126 | return eHAL_SYS_MODE_ROAM_SCAN; |
| 21127 | case WDI_SCAN_MODE_ROAM_SUSPEND_LINK: |
| 21128 | return eHAL_SYS_MODE_ROAM_SUSPEND_LINK; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21129 | } |
| 21130 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21131 | return eHAL_SYS_MODE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21132 | }/*WDI_2_HAL_SCAN_MODE*/ |
| 21133 | |
| 21134 | /*Convert WDI sec ch offset into HAL sec ch offset type*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21135 | WPT_STATIC WPT_INLINE ePhyChanBondState |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21136 | WDI_2_HAL_SEC_CH_OFFSET |
| 21137 | ( |
| 21138 | WDI_HTSecondaryChannelOffset wdiSecChOffset |
| 21139 | ) |
| 21140 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21141 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21142 | the chances of getting inlined*/ |
| 21143 | switch( wdiSecChOffset ) |
| 21144 | { |
| 21145 | case WDI_SECONDARY_CHANNEL_OFFSET_NONE: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21146 | return PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21147 | case WDI_SECONDARY_CHANNEL_OFFSET_UP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21148 | return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21149 | case WDI_SECONDARY_CHANNEL_OFFSET_DOWN: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21150 | return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 21151 | #ifdef WLAN_FEATURE_11AC |
| 21152 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: |
| 21153 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 21154 | case WDI_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: |
| 21155 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 21156 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: |
| 21157 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED; |
| 21158 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 21159 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 21160 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 21161 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 21162 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 21163 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; |
| 21164 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 21165 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; |
| 21166 | #endif |
| 21167 | default: |
| 21168 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21169 | } |
| 21170 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21171 | return PHY_CHANNEL_BONDING_STATE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21172 | }/*WDI_2_HAL_SEC_CH_OFFSET*/ |
| 21173 | |
| 21174 | /*Convert WDI BSS type into HAL BSS type*/ |
| 21175 | WPT_STATIC WPT_INLINE tSirBssType |
| 21176 | WDI_2_HAL_BSS_TYPE |
| 21177 | ( |
| 21178 | WDI_BssType wdiBSSType |
| 21179 | ) |
| 21180 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21181 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21182 | the chances of getting inlined*/ |
| 21183 | switch( wdiBSSType ) |
| 21184 | { |
| 21185 | case WDI_INFRASTRUCTURE_MODE: |
| 21186 | return eSIR_INFRASTRUCTURE_MODE; |
| 21187 | case WDI_INFRA_AP_MODE: |
| 21188 | return eSIR_INFRA_AP_MODE; |
| 21189 | case WDI_IBSS_MODE: |
| 21190 | return eSIR_IBSS_MODE; |
| 21191 | case WDI_BTAMP_STA_MODE: |
| 21192 | return eSIR_BTAMP_STA_MODE; |
| 21193 | case WDI_BTAMP_AP_MODE: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21194 | return eSIR_BTAMP_AP_MODE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21195 | case WDI_BSS_AUTO_MODE: |
| 21196 | return eSIR_AUTO_MODE; |
| 21197 | } |
| 21198 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21199 | return eSIR_DONOT_USE_BSS_TYPE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21200 | }/*WDI_2_HAL_BSS_TYPE*/ |
| 21201 | |
| 21202 | /*Convert WDI NW type into HAL NW type*/ |
| 21203 | WPT_STATIC WPT_INLINE tSirNwType |
| 21204 | WDI_2_HAL_NW_TYPE |
| 21205 | ( |
| 21206 | WDI_NwType wdiNWType |
| 21207 | ) |
| 21208 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21209 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21210 | the chances of getting inlined*/ |
| 21211 | switch( wdiNWType ) |
| 21212 | { |
| 21213 | case WDI_11A_NW_TYPE: |
| 21214 | return eSIR_11A_NW_TYPE; |
| 21215 | case WDI_11B_NW_TYPE: |
| 21216 | return eSIR_11B_NW_TYPE; |
| 21217 | case WDI_11G_NW_TYPE: |
| 21218 | return eSIR_11G_NW_TYPE; |
| 21219 | case WDI_11N_NW_TYPE: |
| 21220 | return eSIR_11N_NW_TYPE; |
| 21221 | } |
| 21222 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21223 | return eSIR_DONOT_USE_NW_TYPE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21224 | }/*WDI_2_HAL_NW_TYPE*/ |
| 21225 | |
| 21226 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 21227 | WPT_STATIC WPT_INLINE ePhyChanBondState |
| 21228 | WDI_2_HAL_CB_STATE |
| 21229 | ( |
| 21230 | WDI_PhyChanBondState wdiCbState |
| 21231 | ) |
| 21232 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21233 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21234 | the chances of getting inlined*/ |
| 21235 | switch ( wdiCbState ) |
| 21236 | { |
| 21237 | case WDI_PHY_SINGLE_CHANNEL_CENTERED: |
| 21238 | return PHY_SINGLE_CHANNEL_CENTERED; |
| 21239 | case WDI_PHY_DOUBLE_CHANNEL_LOW_PRIMARY: |
| 21240 | return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 21241 | case WDI_PHY_DOUBLE_CHANNEL_CENTERED: |
| 21242 | return PHY_DOUBLE_CHANNEL_CENTERED; |
| 21243 | case WDI_PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: |
| 21244 | return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21245 | #ifdef WLAN_FEATURE_11AC |
| 21246 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: |
| 21247 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 21248 | case WDI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: |
| 21249 | return PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED; |
| 21250 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: |
| 21251 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED; |
| 21252 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 21253 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 21254 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 21255 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW; |
| 21256 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 21257 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; |
| 21258 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 21259 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; |
| 21260 | #endif |
| 21261 | case WDI_MAX_CB_STATE: |
| 21262 | default: |
| 21263 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21264 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21265 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21266 | return PHY_CHANNEL_BONDING_STATE_MAX; |
| 21267 | }/*WDI_2_HAL_CB_STATE*/ |
| 21268 | |
| 21269 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 21270 | WPT_STATIC WPT_INLINE tSirMacHTOperatingMode |
| 21271 | WDI_2_HAL_HT_OPER_MODE |
| 21272 | ( |
| 21273 | WDI_HTOperatingMode wdiHTOperMode |
| 21274 | ) |
| 21275 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21276 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21277 | the chances of getting inlined*/ |
| 21278 | switch ( wdiHTOperMode ) |
| 21279 | { |
| 21280 | case WDI_HT_OP_MODE_PURE: |
| 21281 | return eSIR_HT_OP_MODE_PURE; |
| 21282 | case WDI_HT_OP_MODE_OVERLAP_LEGACY: |
| 21283 | return eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 21284 | case WDI_HT_OP_MODE_NO_LEGACY_20MHZ_HT: |
| 21285 | return eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 21286 | case WDI_HT_OP_MODE_MIXED: |
| 21287 | return eSIR_HT_OP_MODE_MIXED; |
| 21288 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21289 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21290 | return eSIR_HT_OP_MODE_MAX; |
| 21291 | }/*WDI_2_HAL_HT_OPER_MODE*/ |
| 21292 | |
| 21293 | /*Convert WDI mimo PS type into HAL mimo PS type*/ |
| 21294 | WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState |
| 21295 | WDI_2_HAL_MIMO_PS |
| 21296 | ( |
| 21297 | WDI_HTMIMOPowerSaveState wdiHTOperMode |
| 21298 | ) |
| 21299 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21300 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21301 | the chances of getting inlined*/ |
| 21302 | switch ( wdiHTOperMode ) |
| 21303 | { |
| 21304 | case WDI_HT_MIMO_PS_STATIC: |
| 21305 | return eSIR_HT_MIMO_PS_STATIC; |
| 21306 | case WDI_HT_MIMO_PS_DYNAMIC: |
| 21307 | return eSIR_HT_MIMO_PS_DYNAMIC; |
| 21308 | case WDI_HT_MIMO_PS_NA: |
| 21309 | return eSIR_HT_MIMO_PS_NA; |
| 21310 | case WDI_HT_MIMO_PS_NO_LIMIT: |
| 21311 | return eSIR_HT_MIMO_PS_NO_LIMIT; |
| 21312 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21313 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21314 | return eSIR_HT_MIMO_PS_MAX; |
| 21315 | }/*WDI_2_HAL_MIMO_PS*/ |
| 21316 | |
| 21317 | /*Convert WDI ENC type into HAL ENC type*/ |
| 21318 | WPT_STATIC WPT_INLINE tAniEdType |
| 21319 | WDI_2_HAL_ENC_TYPE |
| 21320 | ( |
| 21321 | WDI_EncryptType wdiEncType |
| 21322 | ) |
| 21323 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21324 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21325 | the chances of getting inlined*/ |
| 21326 | switch ( wdiEncType ) |
| 21327 | { |
| 21328 | case WDI_ENCR_NONE: |
| 21329 | return eSIR_ED_NONE; |
| 21330 | |
| 21331 | case WDI_ENCR_WEP40: |
| 21332 | return eSIR_ED_WEP40; |
| 21333 | |
| 21334 | case WDI_ENCR_WEP104: |
| 21335 | return eSIR_ED_WEP104; |
| 21336 | |
| 21337 | case WDI_ENCR_TKIP: |
| 21338 | return eSIR_ED_TKIP; |
| 21339 | |
| 21340 | case WDI_ENCR_CCMP: |
| 21341 | return eSIR_ED_CCMP; |
| 21342 | |
| 21343 | case WDI_ENCR_AES_128_CMAC: |
| 21344 | return eSIR_ED_AES_128_CMAC; |
| 21345 | #if defined(FEATURE_WLAN_WAPI) |
| 21346 | case WDI_ENCR_WPI: |
| 21347 | return eSIR_ED_WPI; |
| 21348 | #endif |
| 21349 | default: |
| 21350 | return eSIR_ED_NOT_IMPLEMENTED; |
| 21351 | } |
| 21352 | |
| 21353 | }/*WDI_2_HAL_ENC_TYPE*/ |
| 21354 | |
| 21355 | /*Convert WDI WEP type into HAL WEP type*/ |
| 21356 | WPT_STATIC WPT_INLINE tAniWepType |
| 21357 | WDI_2_HAL_WEP_TYPE |
| 21358 | ( |
| 21359 | WDI_WepType wdiWEPType |
| 21360 | ) |
| 21361 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21362 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21363 | the chances of getting inlined*/ |
| 21364 | switch ( wdiWEPType ) |
| 21365 | { |
| 21366 | case WDI_WEP_STATIC: |
| 21367 | return eSIR_WEP_STATIC; |
| 21368 | |
| 21369 | case WDI_WEP_DYNAMIC: |
| 21370 | return eSIR_WEP_DYNAMIC; |
| 21371 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21372 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21373 | return eSIR_WEP_MAX; |
| 21374 | }/*WDI_2_HAL_WEP_TYPE*/ |
| 21375 | |
| 21376 | WPT_STATIC WPT_INLINE tSirLinkState |
| 21377 | WDI_2_HAL_LINK_STATE |
| 21378 | ( |
| 21379 | WDI_LinkStateType wdiLinkState |
| 21380 | ) |
| 21381 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21382 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21383 | the chances of getting inlined*/ |
| 21384 | switch ( wdiLinkState ) |
| 21385 | { |
| 21386 | case WDI_LINK_IDLE_STATE: |
| 21387 | return eSIR_LINK_IDLE_STATE; |
| 21388 | |
| 21389 | case WDI_LINK_PREASSOC_STATE: |
| 21390 | return eSIR_LINK_PREASSOC_STATE; |
| 21391 | |
| 21392 | case WDI_LINK_POSTASSOC_STATE: |
| 21393 | return eSIR_LINK_POSTASSOC_STATE; |
| 21394 | |
| 21395 | case WDI_LINK_AP_STATE: |
| 21396 | return eSIR_LINK_AP_STATE; |
| 21397 | |
| 21398 | case WDI_LINK_IBSS_STATE: |
| 21399 | return eSIR_LINK_IBSS_STATE; |
| 21400 | |
| 21401 | case WDI_LINK_BTAMP_PREASSOC_STATE: |
| 21402 | return eSIR_LINK_BTAMP_PREASSOC_STATE; |
| 21403 | |
| 21404 | case WDI_LINK_BTAMP_POSTASSOC_STATE: |
| 21405 | return eSIR_LINK_BTAMP_POSTASSOC_STATE; |
| 21406 | |
| 21407 | case WDI_LINK_BTAMP_AP_STATE: |
| 21408 | return eSIR_LINK_BTAMP_AP_STATE; |
| 21409 | |
| 21410 | case WDI_LINK_BTAMP_STA_STATE: |
| 21411 | return eSIR_LINK_BTAMP_STA_STATE; |
| 21412 | |
| 21413 | case WDI_LINK_LEARN_STATE: |
| 21414 | return eSIR_LINK_LEARN_STATE; |
| 21415 | |
| 21416 | case WDI_LINK_SCAN_STATE: |
| 21417 | return eSIR_LINK_SCAN_STATE; |
| 21418 | |
| 21419 | case WDI_LINK_FINISH_SCAN_STATE: |
| 21420 | return eSIR_LINK_FINISH_SCAN_STATE; |
| 21421 | |
| 21422 | case WDI_LINK_INIT_CAL_STATE: |
| 21423 | return eSIR_LINK_INIT_CAL_STATE; |
| 21424 | |
| 21425 | case WDI_LINK_FINISH_CAL_STATE: |
| 21426 | return eSIR_LINK_FINISH_CAL_STATE; |
| 21427 | |
| 21428 | #ifdef WLAN_FEATURE_P2P |
| 21429 | case WDI_LINK_LISTEN_STATE: |
| 21430 | return eSIR_LINK_LISTEN_STATE; |
| 21431 | #endif |
| 21432 | |
| 21433 | default: |
| 21434 | return eSIR_LINK_MAX; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21435 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21436 | } |
| 21437 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21438 | /*Translate a STA Context from WDI into HAL*/ |
| 21439 | WPT_STATIC WPT_INLINE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21440 | void |
| 21441 | WDI_CopyWDIStaCtxToHALStaCtx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21442 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21443 | tConfigStaParams* phalConfigSta, |
| 21444 | WDI_ConfigStaReqInfoType* pwdiConfigSta |
| 21445 | ) |
| 21446 | { |
| 21447 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21448 | #ifdef WLAN_FEATURE_11AC |
| 21449 | /* Get the Version 1 Handler */ |
| 21450 | tConfigStaParams_V1* phalConfigSta_V1 = NULL; |
| 21451 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
| 21452 | { |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 21453 | phalConfigSta_V1 = (tConfigStaParams_V1*)phalConfigSta; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21454 | } |
| 21455 | #endif |
| 21456 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21457 | the chances of getting inlined*/ |
| 21458 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21459 | wpalMemoryCopy(phalConfigSta->bssId, |
| 21460 | pwdiConfigSta->macBSSID, WDI_MAC_ADDR_LEN); |
| 21461 | |
| 21462 | wpalMemoryCopy(phalConfigSta->staMac, |
| 21463 | pwdiConfigSta->macSTA, WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21464 | |
| 21465 | phalConfigSta->assocId = pwdiConfigSta->usAssocId; |
| 21466 | phalConfigSta->staType = pwdiConfigSta->wdiSTAType; |
| 21467 | phalConfigSta->shortPreambleSupported = pwdiConfigSta->ucShortPreambleSupported; |
| 21468 | phalConfigSta->listenInterval = pwdiConfigSta->usListenInterval; |
| 21469 | phalConfigSta->wmmEnabled = pwdiConfigSta->ucWMMEnabled; |
| 21470 | phalConfigSta->htCapable = pwdiConfigSta->ucHTCapable; |
| 21471 | phalConfigSta->txChannelWidthSet = pwdiConfigSta->ucTXChannelWidthSet; |
| 21472 | phalConfigSta->rifsMode = pwdiConfigSta->ucRIFSMode; |
| 21473 | phalConfigSta->lsigTxopProtection = pwdiConfigSta->ucLSIGTxopProtection; |
| 21474 | phalConfigSta->maxAmpduSize = pwdiConfigSta->ucMaxAmpduSize; |
| 21475 | phalConfigSta->maxAmpduDensity = pwdiConfigSta->ucMaxAmpduDensity; |
| 21476 | phalConfigSta->maxAmsduSize = pwdiConfigSta->ucMaxAmsduSize; |
| 21477 | phalConfigSta->fShortGI40Mhz = pwdiConfigSta->ucShortGI40Mhz; |
| 21478 | phalConfigSta->fShortGI20Mhz = pwdiConfigSta->ucShortGI20Mhz; |
| 21479 | phalConfigSta->rmfEnabled = pwdiConfigSta->ucRMFEnabled; |
| 21480 | phalConfigSta->action = pwdiConfigSta->wdiAction; |
| 21481 | phalConfigSta->uAPSD = pwdiConfigSta->ucAPSD; |
| 21482 | phalConfigSta->maxSPLen = pwdiConfigSta->ucMaxSPLen; |
| 21483 | phalConfigSta->greenFieldCapable = pwdiConfigSta->ucGreenFieldCapable; |
| 21484 | phalConfigSta->delayedBASupport = pwdiConfigSta->ucDelayedBASupport; |
| 21485 | phalConfigSta->us32MaxAmpduDuration = pwdiConfigSta->us32MaxAmpduDuratio; |
| 21486 | phalConfigSta->fDsssCckMode40Mhz = pwdiConfigSta->ucDsssCckMode40Mhz; |
| 21487 | phalConfigSta->encryptType = pwdiConfigSta->ucEncryptType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21488 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21489 | phalConfigSta->mimoPS = WDI_2_HAL_MIMO_PS(pwdiConfigSta->wdiMIMOPS); |
| 21490 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21491 | phalConfigSta->supportedRates.opRateMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21492 | pwdiConfigSta->wdiSupportedRates.opRateMode; |
| 21493 | for(i = 0; i < SIR_NUM_11B_RATES; i ++) |
| 21494 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21495 | phalConfigSta->supportedRates.llbRates[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21496 | pwdiConfigSta->wdiSupportedRates.llbRates[i]; |
| 21497 | } |
| 21498 | for(i = 0; i < SIR_NUM_11A_RATES; i ++) |
| 21499 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21500 | phalConfigSta->supportedRates.llaRates[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21501 | pwdiConfigSta->wdiSupportedRates.llaRates[i]; |
| 21502 | } |
| 21503 | for(i = 0; i < SIR_NUM_POLARIS_RATES; i ++) |
| 21504 | { |
| 21505 | phalConfigSta->supportedRates.aniLegacyRates[i] = |
| 21506 | pwdiConfigSta->wdiSupportedRates.aLegacyRates[i]; |
| 21507 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21508 | phalConfigSta->supportedRates.aniEnhancedRateBitmap = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21509 | pwdiConfigSta->wdiSupportedRates.uEnhancedRateBitmap; |
| 21510 | for(i = 0; i < SIR_MAC_MAX_SUPPORTED_MCS_SET; i ++) |
| 21511 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21512 | phalConfigSta->supportedRates.supportedMCSSet[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21513 | pwdiConfigSta->wdiSupportedRates.aSupportedMCSSet[i]; |
| 21514 | } |
| 21515 | phalConfigSta->supportedRates.rxHighestDataRate = |
| 21516 | pwdiConfigSta->wdiSupportedRates.aRxHighestDataRate; |
| 21517 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21518 | #ifdef WLAN_FEATURE_11AC |
| 21519 | if(phalConfigSta_V1 != NULL) |
| 21520 | { |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 21521 | phalConfigSta_V1->supportedRates.vhtRxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtRxMCSMap; |
| 21522 | phalConfigSta_V1->supportedRates.vhtRxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtRxHighestDataRate; |
| 21523 | phalConfigSta_V1->supportedRates.vhtTxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtTxMCSMap; |
| 21524 | phalConfigSta_V1->supportedRates.vhtTxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtTxHighestDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21525 | } |
| 21526 | #endif |
| 21527 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21528 | #ifdef WLAN_FEATURE_P2P |
| 21529 | phalConfigSta->p2pCapableSta = pwdiConfigSta->ucP2pCapableSta ; |
| 21530 | #endif |
| 21531 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21532 | #ifdef WLAN_FEATURE_11AC |
| 21533 | if(phalConfigSta_V1 != NULL) |
| 21534 | { |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 21535 | phalConfigSta_V1->vhtCapable = pwdiConfigSta->ucVhtCapableSta; |
| 21536 | phalConfigSta_V1->vhtTxChannelWidthSet = pwdiConfigSta->ucVhtTxChannelWidthSet; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21537 | } |
| 21538 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21539 | }/*WDI_CopyWDIStaCtxToHALStaCtx*/; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21540 | |
| 21541 | /*Translate a Rate set info from WDI into HAL*/ |
| 21542 | WPT_STATIC WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21543 | WDI_CopyWDIRateSetToHALRateSet |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21544 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21545 | tSirMacRateSet* pHalRateSet, |
| 21546 | WDI_RateSet* pwdiRateSet |
| 21547 | ) |
| 21548 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21549 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21550 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 21551 | |
| 21552 | pHalRateSet->numRates = ( pwdiRateSet->ucNumRates <= SIR_MAC_RATESET_EID_MAX )? |
| 21553 | pwdiRateSet->ucNumRates:SIR_MAC_RATESET_EID_MAX; |
| 21554 | |
| 21555 | for ( i = 0; i < pHalRateSet->numRates; i++ ) |
| 21556 | { |
| 21557 | pHalRateSet->rate[i] = pwdiRateSet->aRates[i]; |
| 21558 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21559 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21560 | }/*WDI_CopyWDIRateSetToHALRateSet*/ |
| 21561 | |
| 21562 | |
| 21563 | /*Translate an EDCA Parameter Record from WDI into HAL*/ |
| 21564 | WPT_STATIC WPT_INLINE void |
| 21565 | WDI_CopyWDIEDCAParamsToHALEDCAParams |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21566 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21567 | tSirMacEdcaParamRecord* phalEdcaParam, |
| 21568 | WDI_EdcaParamRecord* pWDIEdcaParam |
| 21569 | ) |
| 21570 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21571 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21572 | the chances of getting inlined*/ |
| 21573 | |
| 21574 | phalEdcaParam->aci.rsvd = pWDIEdcaParam->wdiACI.rsvd; |
| 21575 | phalEdcaParam->aci.aci = pWDIEdcaParam->wdiACI.aci; |
| 21576 | phalEdcaParam->aci.acm = pWDIEdcaParam->wdiACI.acm; |
| 21577 | phalEdcaParam->aci.aifsn = pWDIEdcaParam->wdiACI.aifsn; |
| 21578 | |
| 21579 | phalEdcaParam->cw.max = pWDIEdcaParam->wdiCW.max; |
| 21580 | phalEdcaParam->cw.min = pWDIEdcaParam->wdiCW.min; |
| 21581 | phalEdcaParam->txoplimit = pWDIEdcaParam->usTXOPLimit; |
| 21582 | }/*WDI_CopyWDIEDCAParamsToHALEDCAParams*/ |
| 21583 | |
| 21584 | |
| 21585 | /*Copy a management frame header from WDI fmt into HAL fmt*/ |
| 21586 | WPT_STATIC WPT_INLINE void |
| 21587 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr |
| 21588 | ( |
| 21589 | tSirMacMgmtHdr* pmacMgmtHdr, |
| 21590 | WDI_MacMgmtHdr* pwdiMacMgmtHdr |
| 21591 | ) |
| 21592 | { |
| 21593 | pmacMgmtHdr->fc.protVer = pwdiMacMgmtHdr->fc.protVer; |
| 21594 | pmacMgmtHdr->fc.type = pwdiMacMgmtHdr->fc.type; |
| 21595 | pmacMgmtHdr->fc.subType = pwdiMacMgmtHdr->fc.subType; |
| 21596 | pmacMgmtHdr->fc.toDS = pwdiMacMgmtHdr->fc.toDS; |
| 21597 | pmacMgmtHdr->fc.fromDS = pwdiMacMgmtHdr->fc.fromDS; |
| 21598 | pmacMgmtHdr->fc.moreFrag = pwdiMacMgmtHdr->fc.moreFrag; |
| 21599 | pmacMgmtHdr->fc.retry = pwdiMacMgmtHdr->fc.retry; |
| 21600 | pmacMgmtHdr->fc.powerMgmt = pwdiMacMgmtHdr->fc.powerMgmt; |
| 21601 | pmacMgmtHdr->fc.moreData = pwdiMacMgmtHdr->fc.moreData; |
| 21602 | pmacMgmtHdr->fc.wep = pwdiMacMgmtHdr->fc.wep; |
| 21603 | pmacMgmtHdr->fc.order = pwdiMacMgmtHdr->fc.order; |
| 21604 | |
| 21605 | pmacMgmtHdr->durationLo = pwdiMacMgmtHdr->durationLo; |
| 21606 | pmacMgmtHdr->durationHi = pwdiMacMgmtHdr->durationHi; |
| 21607 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21608 | wpalMemoryCopy(pmacMgmtHdr->da, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21609 | pwdiMacMgmtHdr->da, 6); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21610 | wpalMemoryCopy(pmacMgmtHdr->sa, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21611 | pwdiMacMgmtHdr->sa, 6); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21612 | wpalMemoryCopy(pmacMgmtHdr->bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21613 | pwdiMacMgmtHdr->bssId, 6); |
| 21614 | |
| 21615 | pmacMgmtHdr->seqControl.fragNum = pwdiMacMgmtHdr->seqControl.fragNum; |
| 21616 | pmacMgmtHdr->seqControl.seqNumLo = pwdiMacMgmtHdr->seqControl.seqNumLo; |
| 21617 | pmacMgmtHdr->seqControl.seqNumHi = pwdiMacMgmtHdr->seqControl.seqNumHi; |
| 21618 | |
| 21619 | }/*WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr*/ |
| 21620 | |
| 21621 | |
| 21622 | /*Copy config bss parameters from WDI fmt into HAL fmt*/ |
| 21623 | WPT_STATIC WPT_INLINE void |
| 21624 | WDI_CopyWDIConfigBSSToHALConfigBSS |
| 21625 | ( |
| 21626 | tConfigBssParams* phalConfigBSS, |
| 21627 | WDI_ConfigBSSReqInfoType* pwdiConfigBSS |
| 21628 | ) |
| 21629 | { |
| 21630 | |
| 21631 | wpt_uint8 keyIndex = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21632 | #ifdef WLAN_FEATURE_11AC |
| 21633 | /* Get the Version 1 Handler */ |
| 21634 | tConfigBssParams_V1* phalConfigBSS_V1 = NULL; |
| 21635 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 21636 | phalConfigBSS_V1 = (tConfigBssParams_V1*)phalConfigBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21637 | #endif |
| 21638 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21639 | wpalMemoryCopy( phalConfigBSS->bssId, |
| 21640 | pwdiConfigBSS->macBSSID, |
| 21641 | WDI_MAC_ADDR_LEN); |
| 21642 | |
| 21643 | #ifdef HAL_SELF_STA_PER_BSS |
| 21644 | wpalMemoryCopy( phalConfigBSS->selfMacAddr, |
| 21645 | pwdiConfigBSS->macSelfAddr, |
| 21646 | WDI_MAC_ADDR_LEN); |
| 21647 | #endif |
| 21648 | |
| 21649 | phalConfigBSS->bssType = WDI_2_HAL_BSS_TYPE(pwdiConfigBSS->wdiBSSType); |
| 21650 | |
| 21651 | phalConfigBSS->operMode = pwdiConfigBSS->ucOperMode; |
| 21652 | phalConfigBSS->nwType = WDI_2_HAL_NW_TYPE(pwdiConfigBSS->wdiNWType); |
| 21653 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21654 | phalConfigBSS->shortSlotTimeSupported = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21655 | pwdiConfigBSS->ucShortSlotTimeSupported; |
| 21656 | phalConfigBSS->llaCoexist = pwdiConfigBSS->ucllaCoexist; |
| 21657 | phalConfigBSS->llbCoexist = pwdiConfigBSS->ucllbCoexist; |
| 21658 | phalConfigBSS->llgCoexist = pwdiConfigBSS->ucllgCoexist; |
| 21659 | phalConfigBSS->ht20Coexist = pwdiConfigBSS->ucHT20Coexist; |
| 21660 | phalConfigBSS->llnNonGFCoexist = pwdiConfigBSS->ucllnNonGFCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21661 | phalConfigBSS->fLsigTXOPProtectionFullSupport = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21662 | pwdiConfigBSS->ucTXOPProtectionFullSupport; |
| 21663 | phalConfigBSS->fRIFSMode = pwdiConfigBSS->ucRIFSMode; |
| 21664 | phalConfigBSS->beaconInterval = pwdiConfigBSS->usBeaconInterval; |
| 21665 | phalConfigBSS->dtimPeriod = pwdiConfigBSS->ucDTIMPeriod; |
| 21666 | phalConfigBSS->txChannelWidthSet = pwdiConfigBSS->ucTXChannelWidthSet; |
| 21667 | phalConfigBSS->currentOperChannel = pwdiConfigBSS->ucCurrentOperChannel; |
| 21668 | phalConfigBSS->currentExtChannel = pwdiConfigBSS->ucCurrentExtChannel; |
| 21669 | phalConfigBSS->action = pwdiConfigBSS->wdiAction; |
| 21670 | phalConfigBSS->htCapable = pwdiConfigBSS->ucHTCapable; |
| 21671 | phalConfigBSS->obssProtEnabled = pwdiConfigBSS->ucObssProtEnabled; |
| 21672 | phalConfigBSS->rmfEnabled = pwdiConfigBSS->ucRMFEnabled; |
| 21673 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21674 | phalConfigBSS->htOperMode = |
| 21675 | WDI_2_HAL_HT_OPER_MODE(pwdiConfigBSS->wdiHTOperMod); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21676 | |
| 21677 | phalConfigBSS->dualCTSProtection = pwdiConfigBSS->ucDualCTSProtection; |
| 21678 | phalConfigBSS->ucMaxProbeRespRetryLimit = pwdiConfigBSS->ucMaxProbeRespRetryLimit; |
| 21679 | phalConfigBSS->bHiddenSSIDEn = pwdiConfigBSS->bHiddenSSIDEn; |
| 21680 | phalConfigBSS->bProxyProbeRespEn = pwdiConfigBSS->bProxyProbeRespEn; |
| 21681 | |
| 21682 | #ifdef WLAN_FEATURE_VOWIFI |
| 21683 | phalConfigBSS->maxTxPower = pwdiConfigBSS->cMaxTxPower; |
| 21684 | #endif |
| 21685 | |
| 21686 | /*! Used 32 as magic number because that is how the ssid is declared inside the |
| 21687 | hal header - hal needs a macro for it */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21688 | phalConfigBSS->ssId.length = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21689 | (pwdiConfigBSS->wdiSSID.ucLength <= 32)? |
| 21690 | pwdiConfigBSS->wdiSSID.ucLength : 32; |
| 21691 | wpalMemoryCopy(phalConfigBSS->ssId.ssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21692 | pwdiConfigBSS->wdiSSID.sSSID, |
| 21693 | phalConfigBSS->ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21694 | |
| 21695 | WDI_CopyWDIStaCtxToHALStaCtx( &phalConfigBSS->staContext, |
| 21696 | &pwdiConfigBSS->wdiSTAContext); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21697 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21698 | WDI_CopyWDIRateSetToHALRateSet( &phalConfigBSS->rateSet, |
| 21699 | &pwdiConfigBSS->wdiRateSet); |
| 21700 | |
| 21701 | phalConfigBSS->edcaParamsValid = pwdiConfigBSS->ucEDCAParamsValid; |
| 21702 | |
| 21703 | if(phalConfigBSS->edcaParamsValid) |
| 21704 | { |
| 21705 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbe, |
| 21706 | &pwdiConfigBSS->wdiBEEDCAParams); |
| 21707 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbk, |
| 21708 | &pwdiConfigBSS->wdiBKEDCAParams); |
| 21709 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvi, |
| 21710 | &pwdiConfigBSS->wdiVIEDCAParams); |
| 21711 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvo, |
| 21712 | &pwdiConfigBSS->wdiVOEDCAParams); |
| 21713 | } |
| 21714 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21715 | phalConfigBSS->halPersona = pwdiConfigBSS->ucPersona; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21716 | |
| 21717 | phalConfigBSS->bSpectrumMgtEnable = pwdiConfigBSS->bSpectrumMgtEn; |
| 21718 | |
| 21719 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 21720 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21721 | phalConfigBSS->extSetStaKeyParamValid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21722 | pwdiConfigBSS->bExtSetStaKeyParamValid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21723 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21724 | if( phalConfigBSS->extSetStaKeyParamValid ) |
| 21725 | { |
| 21726 | /*----------------------------------------------------------------------- |
| 21727 | Copy the STA Key parameters into the HAL message |
| 21728 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21729 | phalConfigBSS->extSetStaKeyParam.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21730 | WDI_2_HAL_ENC_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiEncType); |
| 21731 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21732 | phalConfigBSS->extSetStaKeyParam.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21733 | WDI_2_HAL_WEP_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiWEPType ); |
| 21734 | |
| 21735 | phalConfigBSS->extSetStaKeyParam.staIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucSTAIdx; |
| 21736 | |
| 21737 | phalConfigBSS->extSetStaKeyParam.defWEPIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucDefWEPIdx; |
| 21738 | |
| 21739 | phalConfigBSS->extSetStaKeyParam.singleTidRc = pwdiConfigBSS->wdiExtSetKeyParam.ucSingleTidRc; |
| 21740 | |
| 21741 | #ifdef WLAN_SOFTAP_FEATURE |
| 21742 | for(keyIndex = 0; keyIndex < pwdiConfigBSS->wdiExtSetKeyParam.ucNumKeys ; |
| 21743 | keyIndex++) |
| 21744 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21745 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21746 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyId; |
| 21747 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].unicast = |
| 21748 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].unicast; |
| 21749 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyDirection = |
| 21750 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyDirection; |
| 21751 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21752 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21753 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21754 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21755 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21756 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21757 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyLength; |
| 21758 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21759 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21760 | WDI_MAX_KEY_LENGTH); |
| 21761 | } |
| 21762 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21763 | phalConfigBSS->extSetStaKeyParam.key.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21764 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyId; |
| 21765 | phalConfigBSS->extSetStaKeyParam.key.unicast = |
| 21766 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].unicast; |
| 21767 | phalConfigBSS->extSetStaKeyParam.key.keyDirection = |
| 21768 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyDirection; |
| 21769 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21770 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21771 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21772 | phalConfigBSS->extSetStaKeyParam.key.paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21773 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21774 | phalConfigBSS->extSetStaKeyParam.key.keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21775 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyLength; |
| 21776 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21777 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21778 | WDI_MAX_KEY_LENGTH); |
| 21779 | #endif |
| 21780 | } |
| 21781 | else/* phalConfigBSS->extSetStaKeyParamValid is not set */ |
| 21782 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21783 | wpalMemoryZero( &phalConfigBSS->extSetStaKeyParam, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21784 | sizeof(phalConfigBSS->extSetStaKeyParam) ); |
| 21785 | } |
| 21786 | |
| 21787 | #endif /*WLAN_FEATURE_VOWIFI_11R*/ |
| 21788 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21789 | #ifdef WLAN_FEATURE_11AC |
| 21790 | if(phalConfigBSS_V1 != NULL) |
| 21791 | { |
| 21792 | phalConfigBSS_V1->vhtCapable = pwdiConfigBSS->ucVhtCapableSta; |
| 21793 | phalConfigBSS_V1->vhtTxChannelWidthSet = pwdiConfigBSS->ucVhtTxChannelWidthSet; |
| 21794 | } |
| 21795 | #endif |
| 21796 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21797 | }/*WDI_CopyWDIConfigBSSToHALConfigBSS*/ |
| 21798 | |
| 21799 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21800 | /*Extract the request CB function and user data from a request structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21801 | pointed to by user data */ |
| 21802 | WPT_STATIC WPT_INLINE void |
| 21803 | WDI_ExtractRequestCBFromEvent |
| 21804 | ( |
| 21805 | WDI_EventInfoType* pEvent, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21806 | WDI_ReqStatusCb* ppfnReqCB, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21807 | void** ppUserData |
| 21808 | ) |
| 21809 | { |
| 21810 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 21811 | switch ( pEvent->wdiRequest ) |
| 21812 | { |
| 21813 | case WDI_START_REQ: |
| 21814 | *ppfnReqCB = ((WDI_StartReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21815 | *ppUserData = ((WDI_StartReqParamsType*)pEvent->pEventData)->pUserData; |
| 21816 | break; |
| 21817 | case WDI_STOP_REQ: |
| 21818 | *ppfnReqCB = ((WDI_StopReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21819 | *ppUserData = ((WDI_StopReqParamsType*)pEvent->pEventData)->pUserData; |
| 21820 | break; |
| 21821 | case WDI_INIT_SCAN_REQ: |
| 21822 | *ppfnReqCB = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21823 | *ppUserData = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 21824 | break; |
| 21825 | case WDI_START_SCAN_REQ: |
| 21826 | *ppfnReqCB = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21827 | *ppUserData = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 21828 | break; |
| 21829 | case WDI_END_SCAN_REQ: |
| 21830 | *ppfnReqCB = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21831 | *ppUserData = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 21832 | break; |
| 21833 | case WDI_FINISH_SCAN_REQ: |
| 21834 | *ppfnReqCB = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21835 | *ppUserData = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 21836 | break; |
| 21837 | case WDI_JOIN_REQ: |
| 21838 | *ppfnReqCB = ((WDI_JoinReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21839 | *ppUserData = ((WDI_JoinReqParamsType*)pEvent->pEventData)->pUserData; |
| 21840 | break; |
| 21841 | case WDI_CONFIG_BSS_REQ: |
| 21842 | *ppfnReqCB = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21843 | *ppUserData = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->pUserData; |
| 21844 | break; |
| 21845 | case WDI_DEL_BSS_REQ: |
| 21846 | *ppfnReqCB = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21847 | *ppUserData = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->pUserData; |
| 21848 | break; |
| 21849 | case WDI_POST_ASSOC_REQ: |
| 21850 | *ppfnReqCB = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21851 | *ppUserData = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->pUserData; |
| 21852 | break; |
| 21853 | case WDI_DEL_STA_REQ: |
| 21854 | *ppfnReqCB = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21855 | *ppUserData = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->pUserData; |
| 21856 | break; |
| 21857 | case WDI_DEL_STA_SELF_REQ: |
| 21858 | *ppfnReqCB = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21859 | *ppUserData = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->pUserData; |
| 21860 | break; |
| 21861 | |
| 21862 | case WDI_SET_BSS_KEY_REQ: |
| 21863 | *ppfnReqCB = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21864 | *ppUserData = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 21865 | break; |
| 21866 | case WDI_RMV_BSS_KEY_REQ: |
| 21867 | *ppfnReqCB = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21868 | *ppUserData = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 21869 | break; |
| 21870 | case WDI_SET_STA_KEY_REQ: |
| 21871 | *ppfnReqCB = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21872 | *ppUserData = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 21873 | break; |
| 21874 | case WDI_RMV_STA_KEY_REQ: |
| 21875 | *ppfnReqCB = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21876 | *ppUserData = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 21877 | break; |
| 21878 | case WDI_ADD_TS_REQ: |
| 21879 | *ppfnReqCB = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21880 | *ppUserData = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->pUserData; |
| 21881 | break; |
| 21882 | case WDI_DEL_TS_REQ: |
| 21883 | *ppfnReqCB = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21884 | *ppUserData = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->pUserData; |
| 21885 | break; |
| 21886 | case WDI_UPD_EDCA_PRMS_REQ: |
| 21887 | *ppfnReqCB = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21888 | *ppUserData = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->pUserData; |
| 21889 | break; |
| 21890 | case WDI_ADD_BA_SESSION_REQ: |
| 21891 | *ppfnReqCB = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21892 | *ppUserData = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->pUserData; |
| 21893 | break; |
| 21894 | case WDI_DEL_BA_REQ: |
| 21895 | *ppfnReqCB = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21896 | *ppUserData = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 21897 | break; |
| 21898 | #ifdef FEATURE_WLAN_CCX |
| 21899 | case WDI_TSM_STATS_REQ: |
| 21900 | *ppfnReqCB = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21901 | *ppUserData = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->pUserData; |
| 21902 | break; |
| 21903 | #endif |
| 21904 | case WDI_CH_SWITCH_REQ: |
| 21905 | *ppfnReqCB = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21906 | *ppUserData = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->pUserData; |
| 21907 | break; |
| 21908 | case WDI_CONFIG_STA_REQ: |
| 21909 | *ppfnReqCB = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21910 | *ppUserData = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->pUserData; |
| 21911 | break; |
| 21912 | case WDI_SET_LINK_ST_REQ: |
| 21913 | *ppfnReqCB = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21914 | *ppUserData = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->pUserData; |
| 21915 | break; |
| 21916 | case WDI_GET_STATS_REQ: |
| 21917 | *ppfnReqCB = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21918 | *ppUserData = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->pUserData; |
| 21919 | break; |
| 21920 | case WDI_UPDATE_CFG_REQ: |
| 21921 | *ppfnReqCB = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21922 | *ppUserData = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->pUserData; |
| 21923 | break; |
| 21924 | case WDI_ADD_BA_REQ: |
| 21925 | *ppfnReqCB = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21926 | *ppUserData = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 21927 | break; |
| 21928 | case WDI_TRIGGER_BA_REQ: |
| 21929 | *ppfnReqCB = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21930 | *ppUserData = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 21931 | break; |
| 21932 | case WDI_UPD_BCON_PRMS_REQ: |
| 21933 | *ppfnReqCB = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21934 | *ppUserData = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->pUserData; |
| 21935 | break; |
| 21936 | case WDI_SND_BCON_REQ: |
| 21937 | *ppfnReqCB = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21938 | *ppUserData = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->pUserData; |
| 21939 | break; |
| 21940 | case WDI_ENTER_BMPS_REQ: |
| 21941 | *ppfnReqCB = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21942 | *ppUserData = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->pUserData; |
| 21943 | break; |
| 21944 | case WDI_EXIT_BMPS_REQ: |
| 21945 | *ppfnReqCB = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21946 | *ppUserData = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->pUserData; |
| 21947 | break; |
| 21948 | case WDI_ENTER_UAPSD_REQ: |
| 21949 | *ppfnReqCB = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21950 | *ppUserData = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->pUserData; |
| 21951 | break; |
| 21952 | case WDI_UPDATE_UAPSD_PARAM_REQ: |
| 21953 | *ppfnReqCB = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21954 | *ppUserData = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->pUserData; |
| 21955 | break; |
| 21956 | case WDI_CONFIGURE_RXP_FILTER_REQ: |
| 21957 | *ppfnReqCB = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21958 | *ppUserData = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->pUserData; |
| 21959 | break; |
| 21960 | case WDI_SET_BEACON_FILTER_REQ: |
| 21961 | *ppfnReqCB = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21962 | *ppUserData = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->pUserData; |
| 21963 | break; |
| 21964 | case WDI_REM_BEACON_FILTER_REQ: |
| 21965 | *ppfnReqCB = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21966 | *ppUserData = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->pUserData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21967 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21968 | case WDI_SET_RSSI_THRESHOLDS_REQ: |
| 21969 | *ppfnReqCB = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21970 | *ppUserData = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->pUserData; |
| 21971 | break; |
| 21972 | case WDI_HOST_OFFLOAD_REQ: |
| 21973 | *ppfnReqCB = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21974 | *ppUserData = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->pUserData; |
| 21975 | break; |
| 21976 | case WDI_WOWL_ADD_BC_PTRN_REQ: |
| 21977 | *ppfnReqCB = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21978 | *ppUserData = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->pUserData; |
| 21979 | break; |
| 21980 | case WDI_WOWL_DEL_BC_PTRN_REQ: |
| 21981 | *ppfnReqCB = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21982 | *ppUserData = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->pUserData; |
| 21983 | break; |
| 21984 | case WDI_WOWL_ENTER_REQ: |
| 21985 | *ppfnReqCB = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21986 | *ppUserData = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->pUserData; |
| 21987 | break; |
| 21988 | case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ: |
| 21989 | *ppfnReqCB = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21990 | *ppUserData = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->pUserData; |
| 21991 | break; |
| 21992 | case WDI_FLUSH_AC_REQ: |
| 21993 | *ppfnReqCB = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21994 | *ppUserData = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->pUserData; |
| 21995 | break; |
| 21996 | case WDI_BTAMP_EVENT_REQ: |
| 21997 | *ppfnReqCB = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21998 | *ppUserData = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->pUserData; |
| 21999 | break; |
| 22000 | case WDI_KEEP_ALIVE_REQ: |
| 22001 | *ppfnReqCB = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22002 | *ppUserData = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->pUserData; |
| 22003 | break; |
| 22004 | case WDI_SET_TX_PER_TRACKING_REQ: |
| 22005 | *ppfnReqCB = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22006 | *ppUserData = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->pUserData; |
| 22007 | default: |
| 22008 | *ppfnReqCB = NULL; |
| 22009 | *ppUserData = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22010 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22011 | } |
| 22012 | }/*WDI_ExtractRequestCBFromEvent*/ |
| 22013 | |
| 22014 | |
| 22015 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22016 | @brief WDI_IsHwFrameTxTranslationCapable checks to see if HW |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22017 | frame xtl is enabled for a particular STA. |
| 22018 | |
| 22019 | WDI_PostAssocReq must have been called. |
| 22020 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22021 | @param uSTAIdx: STA index |
| 22022 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22023 | @see WDI_PostAssocReq |
| 22024 | @return Result of the function call |
| 22025 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22026 | wpt_boolean |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22027 | WDI_IsHwFrameTxTranslationCapable |
| 22028 | ( |
| 22029 | wpt_uint8 uSTAIdx |
| 22030 | ) |
| 22031 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22032 | /*!! FIX ME - this must eventually be per station - for now just feedback |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22033 | uma value*/ |
| 22034 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22035 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22036 | ------------------------------------------------------------------------*/ |
| 22037 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 22038 | { |
| 22039 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22040 | "WDI API call before module is initialized - Fail request"); |
| 22041 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22042 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22043 | } |
| 22044 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22045 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22046 | return gWDICb.bFrameTransEnabled; |
| 22047 | }/*WDI_IsHwFrameTxTranslationCapable*/ |
| 22048 | |
| 22049 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 22050 | /** |
| 22051 | @brief WDI_SetPreferredNetworkList |
| 22052 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22053 | @param pwdiPNOScanReqParams: the Set PNO as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22054 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22055 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22056 | wdiPNOScanCb: callback for passing back the response |
| 22057 | of the Set PNO operation received from the |
| 22058 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22059 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22060 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22061 | callback |
| 22062 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22063 | @return Result of the function call |
| 22064 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22065 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22066 | WDI_SetPreferredNetworkReq |
| 22067 | ( |
| 22068 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 22069 | WDI_PNOScanCb wdiPNOScanCb, |
| 22070 | void* pUserData |
| 22071 | ) |
| 22072 | { |
| 22073 | WDI_EventInfoType wdiEventData = {{0}}; |
| 22074 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22075 | |
| 22076 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22077 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22078 | ------------------------------------------------------------------------*/ |
| 22079 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 22080 | { |
| 22081 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22082 | "WDI API call before module is initialized - Fail request"); |
| 22083 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22084 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22085 | } |
| 22086 | |
| 22087 | /*------------------------------------------------------------------------ |
| 22088 | Fill in Event data and post to the Main FSM |
| 22089 | ------------------------------------------------------------------------*/ |
| 22090 | wdiEventData.wdiRequest = WDI_SET_PREF_NETWORK_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22091 | wdiEventData.pEventData = pwdiPNOScanReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22092 | wdiEventData.uEventDataSize = sizeof(*pwdiPNOScanReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22093 | wdiEventData.pCBfnc = wdiPNOScanCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22094 | wdiEventData.pUserData = pUserData; |
| 22095 | |
| 22096 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 22097 | } |
| 22098 | |
| 22099 | |
| 22100 | /** |
| 22101 | @brief WDI_SetRssiFilterReq |
| 22102 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22103 | @param pwdiRssiFilterReqParams: the Set RSSI Filter as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22104 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22105 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22106 | wdiRssiFilterCb: callback for passing back the response |
| 22107 | of the Set RSSI Filter operation received from the |
| 22108 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22109 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22110 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22111 | callback |
| 22112 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22113 | @return Result of the function call |
| 22114 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22115 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22116 | WDI_SetRssiFilterReq |
| 22117 | ( |
| 22118 | WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams, |
| 22119 | WDI_RssiFilterCb wdiRssiFilterCb, |
| 22120 | void* pUserData |
| 22121 | ) |
| 22122 | { |
| 22123 | WDI_EventInfoType wdiEventData = {{0}}; |
| 22124 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22125 | |
| 22126 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22127 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22128 | ------------------------------------------------------------------------*/ |
| 22129 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 22130 | { |
| 22131 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22132 | "WDI API call before module is initialized - Fail request"); |
| 22133 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22134 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22135 | } |
| 22136 | |
| 22137 | /*------------------------------------------------------------------------ |
| 22138 | Fill in Event data and post to the Main FSM |
| 22139 | ------------------------------------------------------------------------*/ |
| 22140 | wdiEventData.wdiRequest = WDI_SET_RSSI_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22141 | wdiEventData.pEventData = pwdiRssiFilterReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22142 | wdiEventData.uEventDataSize = sizeof(*pwdiRssiFilterReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22143 | wdiEventData.pCBfnc = wdiRssiFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22144 | wdiEventData.pUserData = pUserData; |
| 22145 | |
| 22146 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 22147 | }/*WDI_SetRssiFilterReq*/ |
| 22148 | |
| 22149 | /** |
| 22150 | @brief WDI_UpdateScanParamsReq |
| 22151 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22152 | @param pwdiUpdateScanParamsInfoType: the Update Scan Params as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22153 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22154 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22155 | wdiUpdateScanParamsCb: callback for passing back the response |
| 22156 | of the Set PNO operation received from the |
| 22157 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22158 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22159 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22160 | callback |
| 22161 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22162 | @return Result of the function call |
| 22163 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22164 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22165 | WDI_UpdateScanParamsReq |
| 22166 | ( |
| 22167 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParamsInfoType, |
| 22168 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb, |
| 22169 | void* pUserData |
| 22170 | ) |
| 22171 | { |
| 22172 | WDI_EventInfoType wdiEventData = {{0}}; |
| 22173 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22174 | |
| 22175 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22176 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22177 | ------------------------------------------------------------------------*/ |
| 22178 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 22179 | { |
| 22180 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22181 | "WDI API call before module is initialized - Fail request"); |
| 22182 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22183 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22184 | } |
| 22185 | |
| 22186 | /*------------------------------------------------------------------------ |
| 22187 | Fill in Event data and post to the Main FSM |
| 22188 | ------------------------------------------------------------------------*/ |
| 22189 | wdiEventData.wdiRequest = WDI_UPDATE_SCAN_PARAMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22190 | wdiEventData.pEventData = pwdiUpdateScanParamsInfoType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22191 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateScanParamsInfoType); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22192 | wdiEventData.pCBfnc = wdiUpdateScanParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22193 | wdiEventData.pUserData = pUserData; |
| 22194 | |
| 22195 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 22196 | } |
| 22197 | |
| 22198 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22199 | @brief Helper function to pack Set Preferred Network List |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22200 | Request parameters |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22201 | |
| 22202 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22203 | pwdiPNOScanReqParams: pointer to the info received |
| 22204 | from upper layers |
| 22205 | ppSendBuffer, pSize - out pointers of the packed buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22206 | and its size |
| 22207 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22208 | @return Result of the function call |
| 22209 | */ |
| 22210 | |
| 22211 | WDI_Status |
| 22212 | WDI_PackPreferredNetworkList |
| 22213 | ( |
| 22214 | WDI_ControlBlockType* pWDICtx, |
| 22215 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 22216 | wpt_uint8** ppSendBuffer, |
| 22217 | wpt_uint16* pSize |
| 22218 | ) |
| 22219 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22220 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22221 | wpt_uint16 usDataOffset = 0; |
| 22222 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22223 | tpPrefNetwListParams pPrefNetwListParams = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22224 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22225 | /*----------------------------------------------------------------------- |
| 22226 | Get message buffer |
| 22227 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22228 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22229 | sizeof(tPrefNetwListParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22230 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22231 | ( usSendSize < (usDataOffset + sizeof(tPrefNetwListParams) ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22232 | { |
| 22233 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22234 | "Unable to get send buffer in Set PNO req %x ", |
| 22235 | pwdiPNOScanReqParams); |
| 22236 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22237 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22238 | } |
| 22239 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22240 | pPrefNetwListParams = (tpPrefNetwListParams)(pSendBuffer + usDataOffset); |
| 22241 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22242 | /*------------------------------------------------------------------------- |
| 22243 | Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo |
| 22244 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22245 | pPrefNetwListParams->enable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22246 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22247 | pPrefNetwListParams->modePNO = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22248 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO; |
| 22249 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22250 | pPrefNetwListParams->ucNetworksCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22251 | (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22252 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS)? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22253 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount : |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22254 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS; |
| 22255 | |
| 22256 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22257 | "WDI SET PNO: Enable %d, Mode %d, Netw Count %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22258 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable, |
| 22259 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO, |
| 22260 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount); |
| 22261 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22262 | for ( i = 0; i < pPrefNetwListParams->ucNetworksCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22263 | { |
| 22264 | /*SSID of the BSS*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22265 | pPrefNetwListParams->aNetworks[i].ssId.length |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22266 | = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength; |
| 22267 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22268 | wpalMemoryCopy( pPrefNetwListParams->aNetworks[i].ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22269 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22270 | pPrefNetwListParams->aNetworks[i].ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22271 | |
| 22272 | /*Authentication type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22273 | pPrefNetwListParams->aNetworks[i].authentication = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22274 | (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22275 | |
| 22276 | /*Encryption type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22277 | pPrefNetwListParams->aNetworks[i].encryption = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22278 | (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22279 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22280 | /*Indicate the channel on which the Network can be found |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22281 | 0 - if all channels */ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22282 | pPrefNetwListParams->aNetworks[i].ucChannelCount = |
Madan Mohan Koyyalamudi | a208d10 | 2012-10-15 15:18:18 -0700 | [diff] [blame] | 22283 | (pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount < |
| 22284 | WLAN_HAL_PNO_MAX_NETW_CHANNELS)? |
| 22285 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount : |
| 22286 | WLAN_HAL_PNO_MAX_NETW_CHANNELS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22287 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22288 | wpalMemoryCopy(pPrefNetwListParams->aNetworks[i].aChannels, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22289 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22290 | pPrefNetwListParams->aNetworks[i].ucChannelCount); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22291 | |
| 22292 | /*Indicates the RSSI threshold for the network to be considered*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22293 | pPrefNetwListParams->aNetworks[i].rssiThreshold = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22294 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold; |
| 22295 | |
| 22296 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22297 | "WDI SET PNO: SSID %d %s", |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22298 | pPrefNetwListParams->aNetworks[i].ssId.length, |
| 22299 | pPrefNetwListParams->aNetworks[i].ssId.ssId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22300 | } |
| 22301 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22302 | pPrefNetwListParams->scanTimers.ucScanTimersCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22303 | (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22304 | WLAN_HAL_PNO_MAX_SCAN_TIMERS)? |
| 22305 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount : |
| 22306 | WLAN_HAL_PNO_MAX_SCAN_TIMERS; |
| 22307 | |
| 22308 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22309 | "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d", |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22310 | pPrefNetwListParams->scanTimers.ucScanTimersCount, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22311 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize, |
| 22312 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize); |
| 22313 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22314 | for ( i = 0; i < pPrefNetwListParams->scanTimers.ucScanTimersCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22315 | { |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22316 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22317 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22318 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerRepeat = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22319 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat; |
| 22320 | } |
| 22321 | |
| 22322 | /*Copy the probe template*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22323 | pPrefNetwListParams->us24GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22324 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize< |
| 22325 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 22326 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22327 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22328 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22329 | wpalMemoryCopy(pPrefNetwListParams->a24GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22330 | pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22331 | pPrefNetwListParams->us24GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22332 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22333 | pPrefNetwListParams->us5GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22334 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize < |
| 22335 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 22336 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22337 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22338 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22339 | wpalMemoryCopy(pPrefNetwListParams->a5GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22340 | pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22341 | pPrefNetwListParams->us5GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22342 | |
| 22343 | /*Set the output values*/ |
| 22344 | *ppSendBuffer = pSendBuffer; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22345 | *pSize = usSendSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22346 | |
| 22347 | return WDI_STATUS_SUCCESS; |
| 22348 | }/*WDI_PackPreferredNetworkList*/ |
| 22349 | |
| 22350 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22351 | @brief Helper function to pack Set Preferred Network List |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22352 | Request parameters |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22353 | |
| 22354 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22355 | pwdiPNOScanReqParams: pointer to the info received |
| 22356 | from upper layers |
| 22357 | ppSendBuffer, pSize - out pointers of the packed buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22358 | and its size |
| 22359 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22360 | @return Result of the function call |
| 22361 | */ |
| 22362 | |
| 22363 | WDI_Status |
| 22364 | WDI_PackPreferredNetworkListNew |
| 22365 | ( |
| 22366 | WDI_ControlBlockType* pWDICtx, |
| 22367 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 22368 | wpt_uint8** ppSendBuffer, |
| 22369 | wpt_uint16* pSize |
| 22370 | ) |
| 22371 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22372 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22373 | wpt_uint16 usDataOffset = 0; |
| 22374 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22375 | tpPrefNetwListParamsNew pPrefNetwListParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22376 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22377 | |
| 22378 | /*----------------------------------------------------------------------- |
| 22379 | Get message buffer |
| 22380 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22381 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22382 | sizeof(tPrefNetwListParamsNew), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22383 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22384 | ( usSendSize < (usDataOffset + sizeof(tPrefNetwListParamsNew) ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22385 | { |
| 22386 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22387 | "Unable to get send buffer in Set PNO req %x ", |
| 22388 | pwdiPNOScanReqParams); |
| 22389 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22390 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22391 | } |
| 22392 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22393 | pPrefNetwListParams = (tpPrefNetwListParamsNew)(pSendBuffer + usDataOffset); |
| 22394 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22395 | /*------------------------------------------------------------------------- |
| 22396 | Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo |
| 22397 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22398 | pPrefNetwListParams->enable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22399 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22400 | pPrefNetwListParams->modePNO = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22401 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO; |
| 22402 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22403 | pPrefNetwListParams->ucNetworksCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22404 | (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22405 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS)? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22406 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount : |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22407 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS; |
| 22408 | |
| 22409 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22410 | "WDI SET PNO: Enable %d, Mode %d, Netw Count %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22411 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable, |
| 22412 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO, |
| 22413 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount); |
| 22414 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22415 | for ( i = 0; i < pPrefNetwListParams->ucNetworksCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22416 | { |
| 22417 | /*SSID of the BSS*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22418 | pPrefNetwListParams->aNetworks[i].ssId.length |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22419 | = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength; |
| 22420 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22421 | wpalMemoryCopy( pPrefNetwListParams->aNetworks[i].ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22422 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22423 | pPrefNetwListParams->aNetworks[i].ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22424 | |
| 22425 | /*Authentication type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22426 | pPrefNetwListParams->aNetworks[i].authentication = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22427 | (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22428 | |
| 22429 | /*Encryption type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22430 | pPrefNetwListParams->aNetworks[i].encryption = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22431 | (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22432 | |
| 22433 | /*SSID bcast type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22434 | pPrefNetwListParams->aNetworks[i].bcastNetworkType = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22435 | (tSSIDBcastType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiBcastNetworkType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22436 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22437 | /*Indicate the channel on which the Network can be found |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22438 | 0 - if all channels */ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22439 | pPrefNetwListParams->aNetworks[i].ucChannelCount = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22440 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount; |
| 22441 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22442 | wpalMemoryCopy(pPrefNetwListParams->aNetworks[i].aChannels, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22443 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22444 | pPrefNetwListParams->aNetworks[i].ucChannelCount); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22445 | |
| 22446 | /*Indicates the RSSI threshold for the network to be considered*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22447 | pPrefNetwListParams->aNetworks[i].rssiThreshold = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22448 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold; |
| 22449 | |
| 22450 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22451 | "WDI SET PNO: SSID %d %s", |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22452 | pPrefNetwListParams->aNetworks[i].ssId.length, |
| 22453 | pPrefNetwListParams->aNetworks[i].ssId.ssId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22454 | } |
| 22455 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22456 | pPrefNetwListParams->scanTimers.ucScanTimersCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22457 | (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22458 | WLAN_HAL_PNO_MAX_SCAN_TIMERS)? |
| 22459 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount : |
| 22460 | WLAN_HAL_PNO_MAX_SCAN_TIMERS; |
| 22461 | |
| 22462 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22463 | "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d", |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22464 | pPrefNetwListParams->scanTimers.ucScanTimersCount, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22465 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize, |
| 22466 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize); |
| 22467 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22468 | for ( i = 0; i < pPrefNetwListParams->scanTimers.ucScanTimersCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22469 | { |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22470 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22471 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22472 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerRepeat = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22473 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat; |
| 22474 | } |
| 22475 | |
| 22476 | /*Copy the probe template*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22477 | pPrefNetwListParams->us24GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22478 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize< |
| 22479 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 22480 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22481 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22482 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22483 | wpalMemoryCopy(pPrefNetwListParams->a24GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22484 | pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22485 | pPrefNetwListParams->us24GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22486 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22487 | pPrefNetwListParams->us5GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22488 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize < |
| 22489 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 22490 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22491 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22492 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22493 | wpalMemoryCopy(pPrefNetwListParams->a5GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22494 | pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22495 | pPrefNetwListParams->us5GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22496 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22497 | |
| 22498 | /*Set the output values*/ |
| 22499 | *ppSendBuffer = pSendBuffer; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22500 | *pSize = usSendSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22501 | |
| 22502 | return WDI_STATUS_SUCCESS; |
| 22503 | }/*WDI_PackPreferredNetworkListNew*/ |
| 22504 | |
| 22505 | /** |
| 22506 | @brief Process Set Preferred Network List Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22507 | |
| 22508 | @param pWDICtx: pointer to the WLAN DAL context |
| 22509 | pEventData: pointer to the event information structure |
| 22510 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22511 | @return Result of the function call |
| 22512 | */ |
| 22513 | WDI_Status |
| 22514 | WDI_ProcessSetPreferredNetworkReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22515 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22516 | WDI_ControlBlockType* pWDICtx, |
| 22517 | WDI_EventInfoType* pEventData |
| 22518 | ) |
| 22519 | { |
| 22520 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams = NULL; |
| 22521 | WDI_PNOScanCb wdiPNOScanCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22522 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22523 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22524 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22525 | |
| 22526 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22527 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22528 | -------------------------------------------------------------------------*/ |
| 22529 | if (( NULL == pEventData ) || |
| 22530 | ( NULL == (pwdiPNOScanReqParams = (WDI_PNOScanReqParamsType*)pEventData->pEventData)) || |
| 22531 | ( NULL == (wdiPNOScanCb = (WDI_PNOScanCb)pEventData->pCBfnc))) |
| 22532 | { |
| 22533 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22534 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22535 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22536 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22537 | } |
| 22538 | |
| 22539 | /*------------------------------------------------------------------------- |
| 22540 | Pack the PNO request structure based on version |
| 22541 | -------------------------------------------------------------------------*/ |
| 22542 | if ( pWDICtx->wdiPNOVersion > 0 ) |
| 22543 | { |
| 22544 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22545 | "%s: PNO new version %d ", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22546 | pWDICtx->wdiPNOVersion); |
| 22547 | |
| 22548 | wdiStatus = WDI_PackPreferredNetworkListNew( pWDICtx, pwdiPNOScanReqParams, |
| 22549 | &pSendBuffer, &usSendSize); |
| 22550 | } |
| 22551 | else |
| 22552 | { |
| 22553 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22554 | "%s: PNO old version %d ", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22555 | pWDICtx->wdiPNOVersion); |
| 22556 | |
| 22557 | wdiStatus = WDI_PackPreferredNetworkList( pWDICtx, pwdiPNOScanReqParams, |
| 22558 | &pSendBuffer, &usSendSize); |
| 22559 | } |
| 22560 | |
| 22561 | if (( WDI_STATUS_SUCCESS != wdiStatus )|| |
| 22562 | ( NULL == pSendBuffer )||( 0 == usSendSize )) |
| 22563 | { |
| 22564 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22565 | "%s: failed to pack request parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22566 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22567 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22568 | } |
| 22569 | |
| 22570 | pWDICtx->wdiReqStatusCB = pwdiPNOScanReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22571 | pWDICtx->pReqStatusUserData = pwdiPNOScanReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22572 | |
| 22573 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22574 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22575 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22576 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 22577 | wdiPNOScanCb, pEventData->pUserData, WDI_SET_PREF_NETWORK_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22578 | } |
| 22579 | |
| 22580 | /** |
| 22581 | @brief Process Set RSSI Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22582 | |
| 22583 | @param pWDICtx: pointer to the WLAN DAL context |
| 22584 | pEventData: pointer to the event information structure |
| 22585 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22586 | @see |
| 22587 | @return Result of the function call |
| 22588 | */ |
| 22589 | WDI_Status |
| 22590 | WDI_ProcessSetRssiFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22591 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22592 | WDI_ControlBlockType* pWDICtx, |
| 22593 | WDI_EventInfoType* pEventData |
| 22594 | ) |
| 22595 | { |
| 22596 | WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams = NULL; |
| 22597 | WDI_RssiFilterCb wdiRssiFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22598 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22599 | wpt_uint16 usDataOffset = 0; |
| 22600 | wpt_uint16 usSendSize = 0; |
| 22601 | wpt_uint8 ucRssiThreshold; |
| 22602 | |
| 22603 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22604 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22605 | -------------------------------------------------------------------------*/ |
| 22606 | if (( NULL == pEventData ) || |
| 22607 | ( NULL == (pwdiRssiFilterReqParams = (WDI_SetRssiFilterReqParamsType*)pEventData->pEventData)) || |
| 22608 | ( NULL == (wdiRssiFilterCb = (WDI_RssiFilterCb)pEventData->pCBfnc))) |
| 22609 | { |
| 22610 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22611 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22612 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22613 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22614 | } |
| 22615 | |
| 22616 | /*----------------------------------------------------------------------- |
| 22617 | Get message buffer |
| 22618 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22619 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22620 | sizeof(ucRssiThreshold), |
| 22621 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 22622 | ( usSendSize < (usDataOffset + sizeof(ucRssiThreshold) ))) |
| 22623 | { |
| 22624 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22625 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 22626 | pEventData, pwdiRssiFilterReqParams, wdiRssiFilterCb); |
| 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 | |
| 22631 | ucRssiThreshold = pwdiRssiFilterReqParams->rssiThreshold; |
| 22632 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22633 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 22634 | &ucRssiThreshold, |
| 22635 | sizeof(ucRssiThreshold)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22636 | |
| 22637 | pWDICtx->wdiReqStatusCB = pwdiRssiFilterReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22638 | pWDICtx->pReqStatusUserData = pwdiRssiFilterReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22639 | |
| 22640 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22641 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22642 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22643 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 22644 | wdiRssiFilterCb, pEventData->pUserData, WDI_SET_RSSI_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22645 | } |
| 22646 | |
| 22647 | |
| 22648 | /** |
| 22649 | @brief Process Update Scan Params function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22650 | |
| 22651 | @param pWDICtx: pointer to the WLAN DAL context |
| 22652 | pEventData: pointer to the event information structure |
| 22653 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22654 | @see |
| 22655 | @return Result of the function call |
| 22656 | */ |
| 22657 | WDI_Status |
| 22658 | WDI_ProcessUpdateScanParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22659 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22660 | WDI_ControlBlockType* pWDICtx, |
| 22661 | WDI_EventInfoType* pEventData |
| 22662 | ) |
| 22663 | { |
| 22664 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams = NULL; |
| 22665 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22666 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22667 | wpt_uint16 usDataOffset = 0; |
| 22668 | wpt_uint16 usSendSize = 0; |
| 22669 | tUpdateScanParams updateScanParams = {0}; |
| 22670 | |
| 22671 | |
| 22672 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22673 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22674 | -------------------------------------------------------------------------*/ |
| 22675 | if (( NULL == pEventData ) || |
| 22676 | ( NULL == (pwdiUpdateScanParams = (WDI_UpdateScanParamsInfoType*)pEventData->pEventData)) || |
| 22677 | ( NULL == (wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pEventData->pCBfnc))) |
| 22678 | { |
| 22679 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22680 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22681 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22682 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22683 | } |
| 22684 | |
| 22685 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 22686 | "Begin WDI Update Scan Parameters"); |
| 22687 | /*----------------------------------------------------------------------- |
| 22688 | Get message buffer |
| 22689 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22690 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22691 | sizeof(updateScanParams), |
| 22692 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 22693 | ( usSendSize < (usDataOffset + sizeof(updateScanParams) ))) |
| 22694 | { |
| 22695 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22696 | "Unable to get send buffer in Update Scan Params req %x %x %x", |
| 22697 | pEventData, pwdiUpdateScanParams, wdiUpdateScanParamsCb); |
| 22698 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22699 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22700 | } |
| 22701 | |
| 22702 | // |
| 22703 | // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo |
| 22704 | // |
| 22705 | |
| 22706 | updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled; |
| 22707 | updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22708 | updateScanParams.ucChannelCount = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22709 | (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount < |
| 22710 | WLAN_HAL_PNO_MAX_NETW_CHANNELS)? |
| 22711 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount : |
| 22712 | WLAN_HAL_PNO_MAX_NETW_CHANNELS; |
| 22713 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22714 | wpalMemoryCopy( updateScanParams.aChannels, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22715 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels, |
| 22716 | updateScanParams.ucChannelCount); |
| 22717 | |
| 22718 | updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime; |
| 22719 | updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime; |
| 22720 | updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime; |
| 22721 | updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime; |
| 22722 | updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState; |
| 22723 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22724 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 22725 | &updateScanParams, |
| 22726 | sizeof(updateScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22727 | |
| 22728 | pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22729 | pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22730 | |
| 22731 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 22732 | "End Update Scan Parameters"); |
| 22733 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22734 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22735 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22736 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 22737 | wdiUpdateScanParamsCb, pEventData->pUserData, WDI_UPDATE_SCAN_PARAMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22738 | } |
| 22739 | |
| 22740 | /** |
| 22741 | @brief Process Preferred Network Found Indication function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22742 | |
| 22743 | @param pWDICtx: pointer to the WLAN DAL context |
| 22744 | pEventData: pointer to the event information structure |
| 22745 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22746 | @see |
| 22747 | @return Result of the function call |
| 22748 | */ |
| 22749 | WDI_Status |
| 22750 | WDI_ProcessPrefNetworkFoundInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22751 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22752 | WDI_ControlBlockType* pWDICtx, |
| 22753 | WDI_EventInfoType* pEventData |
| 22754 | ) |
| 22755 | { |
| 22756 | WDI_LowLevelIndType wdiInd; |
| 22757 | tPrefNetwFoundInd prefNetwFoundInd = {{0}}; |
| 22758 | |
| 22759 | |
| 22760 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22761 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22762 | -------------------------------------------------------------------------*/ |
| 22763 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 22764 | ( NULL == pEventData->pEventData )) |
| 22765 | { |
| 22766 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22767 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22768 | WDI_ASSERT( 0 ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22769 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22770 | } |
| 22771 | |
| 22772 | /*------------------------------------------------------------------------- |
| 22773 | Extract indication and send it to UMAC |
| 22774 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22775 | wpalMemoryCopy( (void *)&prefNetwFoundInd.prefNetwFoundParams, |
| 22776 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22777 | sizeof(tPrefNetwFoundParams)); |
| 22778 | |
| 22779 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22780 | wdiInd.wdiIndicationType = WDI_PREF_NETWORK_FOUND_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22781 | |
| 22782 | wpalMemoryZero(wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,32); |
| 22783 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22784 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22785 | (prefNetwFoundInd.prefNetwFoundParams.ssId.length < 31 )? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22786 | prefNetwFoundInd.prefNetwFoundParams.ssId.length : 31; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22787 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22788 | wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID, |
| 22789 | prefNetwFoundInd.prefNetwFoundParams.ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22790 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength); |
| 22791 | |
| 22792 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi = |
| 22793 | prefNetwFoundInd.prefNetwFoundParams.rssi; |
| 22794 | |
| 22795 | // DEBUG |
| 22796 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 22797 | "[PNO WDI] PREF_NETWORK_FOUND_IND Type (%x) data (SSID=%s, RSSI=%d)", |
| 22798 | wdiInd.wdiIndicationType, |
| 22799 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID, |
| 22800 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi ); |
| 22801 | |
| 22802 | /*Notify UMAC*/ |
| 22803 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22804 | |
| 22805 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22806 | } |
| 22807 | |
| 22808 | /** |
| 22809 | @brief Process PNO Rsp function (called when a |
| 22810 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22811 | |
| 22812 | @param pWDICtx: pointer to the WLAN DAL context |
| 22813 | pEventData: pointer to the event information structure |
| 22814 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22815 | @see |
| 22816 | @return Result of the function call |
| 22817 | */ |
| 22818 | WDI_Status |
| 22819 | WDI_ProcessSetPreferredNetworkRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22820 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22821 | WDI_ControlBlockType* pWDICtx, |
| 22822 | WDI_EventInfoType* pEventData |
| 22823 | ) |
| 22824 | { |
| 22825 | WDI_Status wdiStatus; |
| 22826 | eHalStatus halStatus; |
| 22827 | WDI_PNOScanCb wdiPNOScanCb = NULL; |
| 22828 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22829 | |
| 22830 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22831 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22832 | -------------------------------------------------------------------------*/ |
| 22833 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 22834 | ( NULL == pEventData->pEventData )) |
| 22835 | { |
| 22836 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22837 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22838 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22839 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22840 | } |
| 22841 | |
| 22842 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22843 | wdiPNOScanCb = (WDI_PNOScanCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22844 | |
| 22845 | /*------------------------------------------------------------------------- |
| 22846 | Extract response and send it to UMAC |
| 22847 | -------------------------------------------------------------------------*/ |
| 22848 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22849 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22850 | |
| 22851 | /*Notify UMAC*/ |
| 22852 | wdiPNOScanCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 22853 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22854 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22855 | }/*WDI_ProcessSetPreferredNetworkRsp*/ |
| 22856 | |
| 22857 | /** |
| 22858 | @brief Process RSSI Filter Rsp function (called when a |
| 22859 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22860 | |
| 22861 | @param pWDICtx: pointer to the WLAN DAL context |
| 22862 | pEventData: pointer to the event information structure |
| 22863 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22864 | @see |
| 22865 | @return Result of the function call |
| 22866 | */ |
| 22867 | WDI_Status |
| 22868 | WDI_ProcessSetRssiFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22869 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22870 | WDI_ControlBlockType* pWDICtx, |
| 22871 | WDI_EventInfoType* pEventData |
| 22872 | ) |
| 22873 | { |
| 22874 | WDI_Status wdiStatus; |
| 22875 | eHalStatus halStatus; |
| 22876 | WDI_RssiFilterCb wdiRssiFilterCb; |
| 22877 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22878 | |
| 22879 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22880 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22881 | -------------------------------------------------------------------------*/ |
| 22882 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 22883 | ( NULL == pEventData->pEventData )) |
| 22884 | { |
| 22885 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22886 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22887 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22888 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22889 | } |
| 22890 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22891 | wdiRssiFilterCb = (WDI_RssiFilterCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22892 | |
| 22893 | /*------------------------------------------------------------------------- |
| 22894 | Extract response and send it to UMAC |
| 22895 | -------------------------------------------------------------------------*/ |
| 22896 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22897 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22898 | |
| 22899 | /*Notify UMAC*/ |
| 22900 | wdiRssiFilterCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 22901 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22902 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22903 | }/*WDI_ProcessSetRssiFilterRsp*/ |
| 22904 | |
| 22905 | /** |
| 22906 | @brief Process Update Scan Params Rsp function (called when a |
| 22907 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22908 | |
| 22909 | @param pWDICtx: pointer to the WLAN DAL context |
| 22910 | pEventData: pointer to the event information structure |
| 22911 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22912 | @see |
| 22913 | @return Result of the function call |
| 22914 | */ |
| 22915 | WDI_Status |
| 22916 | WDI_ProcessUpdateScanParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22917 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22918 | WDI_ControlBlockType* pWDICtx, |
| 22919 | WDI_EventInfoType* pEventData |
| 22920 | ) |
| 22921 | { |
| 22922 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22923 | tUpdateScanParamsResp halUpdScanParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22924 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22925 | wpt_uint32 uStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22926 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22927 | |
| 22928 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22929 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22930 | -------------------------------------------------------------------------*/ |
| 22931 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 22932 | ( NULL == pEventData->pEventData )) |
| 22933 | { |
| 22934 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22935 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22936 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22937 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22938 | } |
| 22939 | |
| 22940 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22941 | "Process UPD scan params ptr : %x", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22942 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22943 | wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22944 | |
| 22945 | /*------------------------------------------------------------------------- |
| 22946 | Extract response and send it to UMAC |
| 22947 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22948 | wpalMemoryCopy( (void *)&halUpdScanParams.status, |
| 22949 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22950 | sizeof(halUpdScanParams.status)); |
| 22951 | |
| 22952 | uStatus = halUpdScanParams.status; |
| 22953 | |
| 22954 | /*Extract PNO version - 1st bit of the status */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22955 | pWDICtx->wdiPNOVersion = (uStatus & WDI_PNO_VERSION_MASK)? 1:0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22956 | |
| 22957 | /*Remove version bit*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22958 | uStatus = uStatus & ( ~(WDI_PNO_VERSION_MASK)); |
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 | wdiStatus = WDI_HAL_2_WDI_STATUS(uStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22961 | |
| 22962 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22963 | "UPD Scan Parameters rsp with status: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22964 | halUpdScanParams.status); |
| 22965 | |
| 22966 | /*Notify UMAC*/ |
| 22967 | wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 22968 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22969 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22970 | } |
| 22971 | #endif // FEATURE_WLAN_SCAN_PNO |
| 22972 | |
| 22973 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22974 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22975 | WDI_8023MulticastListReq |
| 22976 | ( |
| 22977 | WDI_RcvFltPktSetMcListReqParamsType* pwdiRcvFltPktSetMcListReqInfo, |
| 22978 | WDI_8023MulticastListCb wdi8023MulticastListCallback, |
| 22979 | void* pUserData |
| 22980 | ) |
| 22981 | { |
| 22982 | WDI_EventInfoType wdiEventData; |
| 22983 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22984 | |
| 22985 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22986 | "%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22987 | |
| 22988 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22989 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22990 | ------------------------------------------------------------------------*/ |
| 22991 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 22992 | { |
| 22993 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22994 | "WDI API call before module is initialized - Fail request"); |
| 22995 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22996 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22997 | } |
| 22998 | |
| 22999 | /*------------------------------------------------------------------------ |
| 23000 | Fill in Event data and post to the Main FSM |
| 23001 | ------------------------------------------------------------------------*/ |
| 23002 | wdiEventData.wdiRequest = WDI_8023_MULTICAST_LIST_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23003 | wdiEventData.pEventData = pwdiRcvFltPktSetMcListReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23004 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktSetMcListReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23005 | wdiEventData.pCBfnc = wdi8023MulticastListCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23006 | wdiEventData.pUserData = pUserData; |
| 23007 | |
| 23008 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23009 | } |
| 23010 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23011 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23012 | WDI_ReceiveFilterSetFilterReq |
| 23013 | ( |
| 23014 | WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo, |
| 23015 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCallback, |
| 23016 | void* pUserData |
| 23017 | ) |
| 23018 | { |
| 23019 | WDI_EventInfoType wdiEventData; |
| 23020 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23021 | |
| 23022 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23023 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23024 | |
| 23025 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23026 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23027 | ------------------------------------------------------------------------*/ |
| 23028 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23029 | { |
| 23030 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23031 | "WDI API call before module is initialized - Fail request"); |
| 23032 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23033 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23034 | } |
| 23035 | |
| 23036 | /*------------------------------------------------------------------------ |
| 23037 | Fill in Event data and post to the Main FSM |
| 23038 | ------------------------------------------------------------------------*/ |
| 23039 | wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_SET_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23040 | wdiEventData.pEventData = pwdiSetRcvPktFilterReqInfo; |
| 23041 | wdiEventData.uEventDataSize = sizeof(*pwdiSetRcvPktFilterReqInfo) + |
| 23042 | (pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23043 | * sizeof(WDI_RcvPktFilterFieldParams) - 1); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23044 | wdiEventData.pCBfnc = wdiReceiveFilterSetFilterCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23045 | wdiEventData.pUserData = pUserData; |
| 23046 | |
| 23047 | |
| 23048 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23049 | } |
| 23050 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23051 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23052 | WDI_FilterMatchCountReq |
| 23053 | ( |
| 23054 | WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqInfo, |
| 23055 | WDI_FilterMatchCountCb wdiFilterMatchCountCallback, |
| 23056 | void* pUserData |
| 23057 | ) |
| 23058 | { |
| 23059 | WDI_EventInfoType wdiEventData; |
| 23060 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23061 | |
| 23062 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23063 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23064 | |
| 23065 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23066 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23067 | ------------------------------------------------------------------------*/ |
| 23068 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23069 | { |
| 23070 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23071 | "WDI API call before module is initialized - Fail request"); |
| 23072 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23073 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23074 | } |
| 23075 | |
| 23076 | /*------------------------------------------------------------------------ |
| 23077 | Fill in Event data and post to the Main FSM |
| 23078 | ------------------------------------------------------------------------*/ |
| 23079 | wdiEventData.wdiRequest = WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23080 | wdiEventData.pEventData = pwdiRcvFltPktMatchCntReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23081 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktMatchCntReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23082 | wdiEventData.pCBfnc = wdiFilterMatchCountCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23083 | wdiEventData.pUserData = pUserData; |
| 23084 | |
| 23085 | |
| 23086 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23087 | } |
| 23088 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23089 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23090 | WDI_ReceiveFilterClearFilterReq |
| 23091 | ( |
| 23092 | WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqInfo, |
| 23093 | WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCallback, |
| 23094 | void* pUserData |
| 23095 | ) |
| 23096 | { |
| 23097 | WDI_EventInfoType wdiEventData; |
| 23098 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23099 | |
| 23100 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23101 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23102 | |
| 23103 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23104 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23105 | ------------------------------------------------------------------------*/ |
| 23106 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23107 | { |
| 23108 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23109 | "WDI API call before module is initialized - Fail request"); |
| 23110 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23111 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23112 | } |
| 23113 | |
| 23114 | /*------------------------------------------------------------------------ |
| 23115 | Fill in Event data and post to the Main FSM |
| 23116 | ------------------------------------------------------------------------*/ |
| 23117 | wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23118 | wdiEventData.pEventData = pwdiRcvFltPktClearReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23119 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktClearReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23120 | wdiEventData.pCBfnc = wdiReceiveFilterClearFilterCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23121 | wdiEventData.pUserData = pUserData; |
| 23122 | |
| 23123 | |
| 23124 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23125 | } |
| 23126 | |
| 23127 | /** |
| 23128 | @brief Process 8023 Multicast List Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23129 | |
| 23130 | @param pWDICtx: pointer to the WLAN DAL context |
| 23131 | pEventData: pointer to the event information structure |
| 23132 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23133 | @see |
| 23134 | @return Result of the function call |
| 23135 | */ |
| 23136 | WDI_Status |
| 23137 | WDI_Process8023MulticastListReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23138 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23139 | WDI_ControlBlockType* pWDICtx, |
| 23140 | WDI_EventInfoType* pEventData |
| 23141 | ) |
| 23142 | { |
| 23143 | WDI_RcvFltPktSetMcListReqParamsType* pwdiFltPktSetMcListReqParamsType = NULL; |
| 23144 | WDI_8023MulticastListCb wdi8023MulticastListCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23145 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23146 | wpt_uint16 usDataOffset = 0; |
| 23147 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23148 | tpHalRcvFltMcAddrListType pRcvFltMcAddrListType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23149 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23150 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 23151 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23152 | |
| 23153 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23154 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23155 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23156 | pRcvFltMcAddrListType = wpalMemoryAllocate(sizeof(tHalRcvFltMcAddrListType)) ; |
| 23157 | if( NULL == pRcvFltMcAddrListType ) |
| 23158 | { |
| 23159 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23160 | "Failed to alloc in WDI_Process8023MulticastListReq"); |
| 23161 | return WDI_STATUS_E_FAILURE; |
| 23162 | } |
| 23163 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23164 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23165 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23166 | -------------------------------------------------------------------------*/ |
| 23167 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23168 | ( NULL == (pwdiFltPktSetMcListReqParamsType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23169 | (WDI_RcvFltPktSetMcListReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23170 | ( NULL == (wdi8023MulticastListCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23171 | (WDI_8023MulticastListCb)pEventData->pCBfnc))) |
| 23172 | { |
| 23173 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23174 | "%s: Invalid parameters", __func__); |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23175 | wpalMemoryFree(pRcvFltMcAddrListType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23176 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23177 | return WDI_STATUS_E_FAILURE; |
| 23178 | } |
| 23179 | |
| 23180 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 23181 | pwdiFltPktSetMcListReqParamsType->mcAddrList.bssId, |
| 23182 | &pBSSSes); |
| 23183 | if ( NULL == pBSSSes ) |
| 23184 | { |
| 23185 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23186 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23187 | wpalMemoryFree(pRcvFltMcAddrListType); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23188 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23189 | } |
| 23190 | |
| 23191 | /*----------------------------------------------------------------------- |
| 23192 | Get message buffer |
| 23193 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23194 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 23195 | WDI_8023_MULTICAST_LIST_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23196 | sizeof(tHalRcvFltMcAddrListType), |
| 23197 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23198 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltMcAddrListType)))) |
| 23199 | { |
| 23200 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23201 | "Unable to get send buffer in " |
| 23202 | "WDI_Process8023MulticastListReq() %x %x %x", |
| 23203 | pEventData, pwdiFltPktSetMcListReqParamsType, |
| 23204 | wdi8023MulticastListCb); |
| 23205 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23206 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23207 | } |
| 23208 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23209 | pRcvFltMcAddrListType->cMulticastAddr = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23210 | pwdiFltPktSetMcListReqParamsType->mcAddrList.ulMulticastAddrCnt; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23211 | for( i = 0; i < pRcvFltMcAddrListType->cMulticastAddr; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23212 | { |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23213 | wpalMemoryCopy(pRcvFltMcAddrListType->multicastAddr[i], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23214 | pwdiFltPktSetMcListReqParamsType->mcAddrList.multicastAddr[i], |
| 23215 | sizeof(tSirMacAddr)); |
| 23216 | } |
| 23217 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23218 | pRcvFltMcAddrListType->bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23219 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23220 | pRcvFltMcAddrListType, |
| 23221 | sizeof(tHalRcvFltMcAddrListType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23222 | |
| 23223 | pWDICtx->wdiReqStatusCB = pwdiFltPktSetMcListReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23224 | pWDICtx->pReqStatusUserData = pwdiFltPktSetMcListReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23225 | |
| 23226 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23227 | wpalMemoryFree(pRcvFltMcAddrListType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23228 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23229 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23230 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23231 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23232 | wdi8023MulticastListCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23233 | WDI_8023_MULTICAST_LIST_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23234 | } |
| 23235 | |
| 23236 | /** |
| 23237 | @brief Process Receive Filter Set Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23238 | |
| 23239 | @param pWDICtx: pointer to the WLAN DAL context |
| 23240 | pEventData: pointer to the event information structure |
| 23241 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23242 | @see |
| 23243 | @return Result of the function call |
| 23244 | */ |
| 23245 | WDI_Status |
| 23246 | WDI_ProcessReceiveFilterSetFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23247 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23248 | WDI_ControlBlockType* pWDICtx, |
| 23249 | WDI_EventInfoType* pEventData |
| 23250 | ) |
| 23251 | { |
| 23252 | WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo = NULL; |
| 23253 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23254 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23255 | wpt_uint16 usDataOffset = 0; |
| 23256 | wpt_uint16 usSendSize = 0; |
| 23257 | wpt_uint32 usRcvPktFilterCfgSize; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23258 | tHalRcvPktFilterCfgType *pRcvPktFilterCfg = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23259 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23260 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 23261 | WDI_BSSSessionType* pBSSSes = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23262 | tHalSessionizedRcvPktFilterCfgType *pSessRcvPktFilterCfg = NULL; |
| 23263 | wpt_uint32 usSessRcvPktFilterCfgSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23264 | |
| 23265 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23266 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23267 | |
| 23268 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23269 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23270 | -------------------------------------------------------------------------*/ |
| 23271 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23272 | ( NULL == (pwdiSetRcvPktFilterReqInfo = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23273 | (WDI_SetRcvPktFilterReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23274 | ( NULL == (wdiReceiveFilterSetFilterCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23275 | (WDI_ReceiveFilterSetFilterCb)pEventData->pCBfnc))) |
| 23276 | { |
| 23277 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23278 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23279 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23280 | return WDI_STATUS_E_FAILURE; |
| 23281 | } |
| 23282 | |
| 23283 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 23284 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.bssId, |
| 23285 | &pBSSSes); |
| 23286 | if ( NULL == pBSSSes ) |
| 23287 | { |
| 23288 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23289 | " %s : Association for this BSSID does not exist",__func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23290 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23291 | } |
| 23292 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23293 | if( WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION) ) |
| 23294 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23295 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23296 | usSessRcvPktFilterCfgSize = sizeof(tHalSessionizedRcvPktFilterCfgType) + |
| 23297 | ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1) |
| 23298 | * sizeof(tHalSessionizedRcvPktFilterCfgType)); |
| 23299 | |
| 23300 | pSessRcvPktFilterCfg = (tHalSessionizedRcvPktFilterCfgType *)wpalMemoryAllocate( |
| 23301 | usSessRcvPktFilterCfgSize); |
| 23302 | |
| 23303 | if(NULL == pSessRcvPktFilterCfg) |
| 23304 | { |
| 23305 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23306 | "%s: Failed to allocate memory for " |
| 23307 | "tHalRcvPktFilterCfgType: %x %x %x ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23308 | __func__, pWDICtx, pEventData, pEventData->pEventData); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23309 | WDI_ASSERT(0); |
| 23310 | return WDI_STATUS_E_FAILURE; |
| 23311 | } |
| 23312 | |
| 23313 | wpalMemoryZero(pSessRcvPktFilterCfg, usSessRcvPktFilterCfgSize); |
| 23314 | |
| 23315 | /*----------------------------------------------------------------------- |
| 23316 | Get message buffer |
| 23317 | -----------------------------------------------------------------------*/ |
| 23318 | |
| 23319 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ, |
| 23320 | usSessRcvPktFilterCfgSize, |
| 23321 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23322 | ( usSendSize < (usDataOffset + usSessRcvPktFilterCfgSize))) |
| 23323 | { |
| 23324 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23325 | "Unable to get send buffer in " |
| 23326 | "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x", |
| 23327 | pEventData, pwdiSetRcvPktFilterReqInfo, |
| 23328 | wdiReceiveFilterSetFilterCb); |
| 23329 | WDI_ASSERT(0); |
| 23330 | wpalMemoryFree(pSessRcvPktFilterCfg); |
| 23331 | return WDI_STATUS_E_FAILURE; |
| 23332 | } |
| 23333 | |
| 23334 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23335 | "UsData Off %d UsSend %d cfg %d",usDataOffset, |
| 23336 | usSendSize,pSessRcvPktFilterCfg); |
| 23337 | |
| 23338 | pSessRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId; |
| 23339 | pSessRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType; |
| 23340 | pSessRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams; |
| 23341 | pSessRcvPktFilterCfg->coleasceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime; |
| 23342 | |
| 23343 | pSessRcvPktFilterCfg->bssIdx = pBSSSes->ucBSSIdx; |
| 23344 | |
| 23345 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23346 | "Out: FID %d FT %d",pSessRcvPktFilterCfg->filterId, |
| 23347 | pSessRcvPktFilterCfg->filterType); |
| 23348 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23349 | "NParams %d CT %d",pSessRcvPktFilterCfg->numParams, |
| 23350 | pSessRcvPktFilterCfg->coleasceTime); |
| 23351 | |
| 23352 | for ( i = 0; i < pSessRcvPktFilterCfg->numParams; i++ ) |
| 23353 | { |
| 23354 | pSessRcvPktFilterCfg->paramsData[i].protocolLayer = |
| 23355 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer; |
| 23356 | pSessRcvPktFilterCfg->paramsData[i].cmpFlag = |
| 23357 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag; |
| 23358 | pSessRcvPktFilterCfg->paramsData[i].dataOffset = |
| 23359 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset; |
| 23360 | pSessRcvPktFilterCfg->paramsData[i].dataLength = |
| 23361 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength; |
| 23362 | |
| 23363 | wpalMemoryCopy(&pSessRcvPktFilterCfg->paramsData[i].compareData, |
| 23364 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData, |
| 23365 | 8); |
| 23366 | wpalMemoryCopy(&pSessRcvPktFilterCfg->paramsData[i].dataMask, |
| 23367 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask, |
| 23368 | 8); |
| 23369 | |
| 23370 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23371 | "Out:Proto %d Comp Flag %d \n", |
| 23372 | pSessRcvPktFilterCfg->paramsData[i].protocolLayer, |
| 23373 | pSessRcvPktFilterCfg->paramsData[i].cmpFlag); |
| 23374 | |
| 23375 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23376 | "Data Offset %d Data Len %d\n", |
| 23377 | pSessRcvPktFilterCfg->paramsData[i].dataOffset, |
| 23378 | pSessRcvPktFilterCfg->paramsData[i].dataLength); |
| 23379 | |
| 23380 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23381 | "CData: %d:%d:%d:%d:%d:%d\n", |
| 23382 | pSessRcvPktFilterCfg->paramsData[i].compareData[0], |
| 23383 | pSessRcvPktFilterCfg->paramsData[i].compareData[1], |
| 23384 | pSessRcvPktFilterCfg->paramsData[i].compareData[2], |
| 23385 | pSessRcvPktFilterCfg->paramsData[i].compareData[3], |
| 23386 | pSessRcvPktFilterCfg->paramsData[i].compareData[4], |
| 23387 | pSessRcvPktFilterCfg->paramsData[i].compareData[5]); |
| 23388 | |
| 23389 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23390 | "MData: %d:%d:%d:%d:%d:%d\n", |
| 23391 | pSessRcvPktFilterCfg->paramsData[i].dataMask[0], |
| 23392 | pSessRcvPktFilterCfg->paramsData[i].dataMask[1], |
| 23393 | pSessRcvPktFilterCfg->paramsData[i].dataMask[2], |
| 23394 | pSessRcvPktFilterCfg->paramsData[i].dataMask[3], |
| 23395 | pSessRcvPktFilterCfg->paramsData[i].dataMask[4], |
| 23396 | pSessRcvPktFilterCfg->paramsData[i].dataMask[5]); |
| 23397 | } |
| 23398 | |
| 23399 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 23400 | pSessRcvPktFilterCfg, |
| 23401 | usSessRcvPktFilterCfgSize); |
| 23402 | |
| 23403 | |
| 23404 | pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB; |
| 23405 | pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData; |
| 23406 | |
| 23407 | wpalMemoryFree(pSessRcvPktFilterCfg); |
| 23408 | |
| 23409 | } |
| 23410 | /*If SLM_SESSIONIZATION is not supported then do this */ |
| 23411 | else |
| 23412 | { |
| 23413 | usRcvPktFilterCfgSize = sizeof(tHalRcvPktFilterCfgType) + |
| 23414 | ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1) |
| 23415 | * sizeof(tHalRcvPktFilterParams)); |
| 23416 | |
| 23417 | pRcvPktFilterCfg = (tHalRcvPktFilterCfgType *)wpalMemoryAllocate( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23418 | usRcvPktFilterCfgSize); |
| 23419 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23420 | if(NULL == pRcvPktFilterCfg) |
| 23421 | { |
| 23422 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23423 | "%s: Failed to allocate memory for " |
| 23424 | "tHalRcvPktFilterCfgType: %x %x %x ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23425 | __func__, pWDICtx, pEventData, pEventData->pEventData); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23426 | WDI_ASSERT(0); |
| 23427 | return WDI_STATUS_E_FAILURE; |
| 23428 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23429 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23430 | wpalMemoryZero(pRcvPktFilterCfg, usRcvPktFilterCfgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23431 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23432 | /*----------------------------------------------------------------------- |
| 23433 | Get message buffer |
| 23434 | -----------------------------------------------------------------------*/ |
| 23435 | 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] | 23436 | usRcvPktFilterCfgSize, |
| 23437 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23438 | ( usSendSize < (usDataOffset + usRcvPktFilterCfgSize))) |
| 23439 | { |
| 23440 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23441 | "Unable to get send buffer in " |
| 23442 | "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x", |
| 23443 | pEventData, pwdiSetRcvPktFilterReqInfo, |
| 23444 | wdiReceiveFilterSetFilterCb); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23445 | WDI_ASSERT(0); |
| 23446 | wpalMemoryFree(pRcvPktFilterCfg); |
| 23447 | return WDI_STATUS_E_FAILURE; |
| 23448 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23449 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23450 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23451 | "UsData Off %d UsSend %d cfg %d",usDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23452 | usSendSize,usRcvPktFilterCfgSize); |
| 23453 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23454 | pRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId; |
| 23455 | pRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType; |
| 23456 | pRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams; |
| 23457 | pRcvPktFilterCfg->coalesceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23458 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23459 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23460 | "Out: FID %d FT %d",pRcvPktFilterCfg->filterId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23461 | pRcvPktFilterCfg->filterType); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23462 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23463 | "NParams %d CT %d",pRcvPktFilterCfg->numParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23464 | pRcvPktFilterCfg->coalesceTime); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23465 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23466 | for ( i = 0; i < pRcvPktFilterCfg->numParams; i++ ) |
| 23467 | { |
| 23468 | pRcvPktFilterCfg->paramsData[i].protocolLayer = |
| 23469 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer; |
| 23470 | pRcvPktFilterCfg->paramsData[i].cmpFlag = |
| 23471 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag; |
| 23472 | pRcvPktFilterCfg->paramsData[i].dataOffset = |
| 23473 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset; |
| 23474 | pRcvPktFilterCfg->paramsData[i].dataLength = |
| 23475 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23476 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23477 | wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].compareData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23478 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData, |
| 23479 | 8); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23480 | wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].dataMask, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23481 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask, |
| 23482 | 8); |
| 23483 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23484 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23485 | "Out:Proto %d Comp Flag %d \n", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23486 | pRcvPktFilterCfg->paramsData[i].protocolLayer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23487 | pRcvPktFilterCfg->paramsData[i].cmpFlag); |
| 23488 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23489 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23490 | "Data Offset %d Data Len %d\n", |
| 23491 | pRcvPktFilterCfg->paramsData[i].dataOffset, |
| 23492 | pRcvPktFilterCfg->paramsData[i].dataLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23493 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23494 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23495 | "CData: %d:%d:%d:%d:%d:%d\n", |
| 23496 | pRcvPktFilterCfg->paramsData[i].compareData[0], |
| 23497 | pRcvPktFilterCfg->paramsData[i].compareData[1], |
| 23498 | pRcvPktFilterCfg->paramsData[i].compareData[2], |
| 23499 | pRcvPktFilterCfg->paramsData[i].compareData[3], |
| 23500 | pRcvPktFilterCfg->paramsData[i].compareData[4], |
| 23501 | pRcvPktFilterCfg->paramsData[i].compareData[5]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23502 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23503 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23504 | "MData: %d:%d:%d:%d:%d:%d\n", |
| 23505 | pRcvPktFilterCfg->paramsData[i].dataMask[0], |
| 23506 | pRcvPktFilterCfg->paramsData[i].dataMask[1], |
| 23507 | pRcvPktFilterCfg->paramsData[i].dataMask[2], |
| 23508 | pRcvPktFilterCfg->paramsData[i].dataMask[3], |
| 23509 | pRcvPktFilterCfg->paramsData[i].dataMask[4], |
| 23510 | pRcvPktFilterCfg->paramsData[i].dataMask[5]); |
| 23511 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23512 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23513 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23514 | pRcvPktFilterCfg, |
| 23515 | usRcvPktFilterCfgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23516 | |
| 23517 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23518 | pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB; |
| 23519 | pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23520 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23521 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23522 | "%s",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23523 | wpalMemoryFree(pRcvPktFilterCfg); |
| 23524 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23525 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23526 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23527 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23528 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23529 | wdiReceiveFilterSetFilterCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23530 | WDI_RECEIVE_FILTER_SET_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23531 | } |
| 23532 | |
| 23533 | /** |
| 23534 | @brief Process Packet Filter Match Count Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23535 | |
| 23536 | @param pWDICtx: pointer to the WLAN DAL context |
| 23537 | pEventData: pointer to the event information structure |
| 23538 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23539 | @see |
| 23540 | @return Result of the function call |
| 23541 | */ |
| 23542 | WDI_Status |
| 23543 | WDI_ProcessFilterMatchCountReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23544 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23545 | WDI_ControlBlockType* pWDICtx, |
| 23546 | WDI_EventInfoType* pEventData |
| 23547 | ) |
| 23548 | { |
| 23549 | WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqParamsType = |
| 23550 | NULL; |
| 23551 | WDI_FilterMatchCountCb wdiFilterMatchCountCb = |
| 23552 | NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23553 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23554 | wpt_uint16 usDataOffset = 0; |
| 23555 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23556 | tHalRcvFltPktMatchCntReqParams rcvFltPktMatchCntReqParam = {0}; |
| 23557 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 23558 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23559 | |
| 23560 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23561 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23562 | |
| 23563 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23564 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23565 | -------------------------------------------------------------------------*/ |
| 23566 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23567 | ( NULL == (pwdiRcvFltPktMatchCntReqParamsType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23568 | (WDI_RcvFltPktMatchCntReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23569 | ( NULL == (wdiFilterMatchCountCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23570 | (WDI_FilterMatchCountCb)pEventData->pCBfnc))) |
| 23571 | { |
| 23572 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23573 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23574 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23575 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23576 | } |
| 23577 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23578 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 23579 | pwdiRcvFltPktMatchCntReqParamsType->bssId, |
| 23580 | &pBSSSes); |
| 23581 | if ( NULL == pBSSSes ) |
| 23582 | { |
| 23583 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23584 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23585 | return WDI_STATUS_E_FAILURE; |
| 23586 | } |
| 23587 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23588 | /*----------------------------------------------------------------------- |
| 23589 | Get message buffer |
| 23590 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23591 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 23592 | WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23593 | sizeof(tHalRcvFltPktMatchCntReqParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23594 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23595 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktMatchCntReqParams)))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23596 | { |
| 23597 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23598 | "Unable to get send buffer in " |
| 23599 | "WDI_ProcessFilterMatchCountReq() %x %x %x", |
| 23600 | pEventData, pwdiRcvFltPktMatchCntReqParamsType, |
| 23601 | wdiFilterMatchCountCb); |
| 23602 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23603 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23604 | } |
| 23605 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23606 | rcvFltPktMatchCntReqParam.bssIdx = pBSSSes->ucBSSIdx; |
| 23607 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 23608 | &rcvFltPktMatchCntReqParam, |
| 23609 | sizeof(rcvFltPktMatchCntReqParam)); |
| 23610 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23611 | // |
| 23612 | // Don't need to fill send buffer other than header |
| 23613 | // |
| 23614 | pWDICtx->wdiReqStatusCB = pwdiRcvFltPktMatchCntReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23615 | pWDICtx->pReqStatusUserData = pwdiRcvFltPktMatchCntReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23616 | |
| 23617 | |
| 23618 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23619 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23620 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23621 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 23622 | wdiFilterMatchCountCb, |
| 23623 | pEventData->pUserData, |
| 23624 | WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23625 | } |
| 23626 | |
| 23627 | /** |
| 23628 | @brief Process Receive Filter Clear Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23629 | |
| 23630 | @param pWDICtx: pointer to the WLAN DAL context |
| 23631 | pEventData: pointer to the event information structure |
| 23632 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23633 | @see |
| 23634 | @return Result of the function call |
| 23635 | */ |
| 23636 | WDI_Status |
| 23637 | WDI_ProcessReceiveFilterClearFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23638 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23639 | WDI_ControlBlockType* pWDICtx, |
| 23640 | WDI_EventInfoType* pEventData |
| 23641 | ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23642 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23643 | WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqParamsType = NULL; |
| 23644 | WDI_ReceiveFilterClearFilterCb wdiRcvFltPktClearFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23645 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23646 | wpt_uint16 usDataOffset = 0; |
| 23647 | wpt_uint16 usSendSize = 0; |
| 23648 | tHalRcvFltPktClearParam rcvFltPktClearParam; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23649 | wpt_uint8 ucCurrentSessionId = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23650 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23651 | |
| 23652 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23653 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23654 | |
| 23655 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23656 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23657 | -------------------------------------------------------------------------*/ |
| 23658 | if (( NULL == pEventData ) || |
| 23659 | ( NULL == (pwdiRcvFltPktClearReqParamsType = |
| 23660 | (WDI_RcvFltPktClearReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23661 | ( NULL == (wdiRcvFltPktClearFilterCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23662 | (WDI_ReceiveFilterClearFilterCb)pEventData->pCBfnc))) |
| 23663 | { |
| 23664 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23665 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23666 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23667 | return WDI_STATUS_E_FAILURE; |
| 23668 | } |
| 23669 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23670 | ucCurrentSessionId = WDI_FindAssocSession( pWDICtx, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23671 | pwdiRcvFltPktClearReqParamsType->filterClearParam.bssId, |
| 23672 | &pBSSSes); |
| 23673 | if ( NULL == pBSSSes ) |
| 23674 | { |
| 23675 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23676 | " %s : Association for this BSSID does not exist",__func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23677 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23678 | } |
| 23679 | |
| 23680 | /*----------------------------------------------------------------------- |
| 23681 | Get message buffer |
| 23682 | -----------------------------------------------------------------------*/ |
| 23683 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23684 | WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23685 | sizeof(tHalRcvFltPktClearParam), |
| 23686 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23687 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktClearParam)))) |
| 23688 | { |
| 23689 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23690 | "Unable to get send buffer in " |
| 23691 | "WDI_ProcessReceiveFilterClearFilterReq() %x %x %x", |
| 23692 | pEventData, pwdiRcvFltPktClearReqParamsType, |
| 23693 | wdiRcvFltPktClearFilterCb); |
| 23694 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23695 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23696 | } |
| 23697 | |
| 23698 | |
| 23699 | rcvFltPktClearParam.status = pwdiRcvFltPktClearReqParamsType-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23700 | filterClearParam.status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23701 | rcvFltPktClearParam.filterId = pwdiRcvFltPktClearReqParamsType-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23702 | filterClearParam.filterId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23703 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23704 | rcvFltPktClearParam.bssIdx = pBSSSes->ucBSSIdx; |
| 23705 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 23706 | &rcvFltPktClearParam, |
| 23707 | sizeof(rcvFltPktClearParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23708 | |
| 23709 | pWDICtx->wdiReqStatusCB = pwdiRcvFltPktClearReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23710 | pWDICtx->pReqStatusUserData = pwdiRcvFltPktClearReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23711 | |
| 23712 | |
| 23713 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23714 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23715 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23716 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23717 | wdiRcvFltPktClearFilterCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23718 | WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23719 | } |
| 23720 | |
| 23721 | /** |
| 23722 | @brief Process 8023 Multicast List Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23723 | |
| 23724 | @param pWDICtx: pointer to the WLAN DAL context |
| 23725 | pEventData: pointer to the event information structure |
| 23726 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23727 | @see |
| 23728 | @return Result of the function call |
| 23729 | */ |
| 23730 | WDI_Status |
| 23731 | WDI_Process8023MulticastListRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23732 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23733 | WDI_ControlBlockType* pWDICtx, |
| 23734 | WDI_EventInfoType* pEventData |
| 23735 | ) |
| 23736 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23737 | eHalStatus halStatus; |
| 23738 | WDI_8023MulticastListCb wdi8023MulticastListCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23739 | tHalRcvFltPktSetMcListRspType halRcvFltPktSetMcListRsp; |
| 23740 | WDI_RcvFltPktSetMcListRspParamsType wdiRcvFltPktSetMcListRspInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23741 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23742 | |
| 23743 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23744 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23745 | |
| 23746 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23747 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23748 | -------------------------------------------------------------------------*/ |
| 23749 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23750 | ( NULL == pEventData->pEventData )) |
| 23751 | { |
| 23752 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23753 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23754 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23755 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23756 | } |
| 23757 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23758 | wdi8023MulticastListCb = (WDI_8023MulticastListCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23759 | |
| 23760 | /*------------------------------------------------------------------------- |
| 23761 | Extract response and send it to UMAC |
| 23762 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23763 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 23764 | { |
| 23765 | wpalMemoryCopy( &halRcvFltPktSetMcListRsp, |
| 23766 | pEventData->pEventData, |
| 23767 | sizeof(halRcvFltPktSetMcListRsp)); |
| 23768 | |
| 23769 | wdiRcvFltPktSetMcListRspInfo.wdiStatus = |
| 23770 | WDI_HAL_2_WDI_STATUS(halRcvFltPktSetMcListRsp.status); |
| 23771 | wdiRcvFltPktSetMcListRspInfo.bssIdx = |
| 23772 | halRcvFltPktSetMcListRsp.bssIdx; |
| 23773 | } |
| 23774 | else |
| 23775 | { |
| 23776 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 23777 | wdiRcvFltPktSetMcListRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 23778 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23779 | |
| 23780 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23781 | wdi8023MulticastListCb(&wdiRcvFltPktSetMcListRspInfo, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23782 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23783 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23784 | } |
| 23785 | |
| 23786 | /** |
| 23787 | @brief Process Set Rsp function (called when a |
| 23788 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23789 | |
| 23790 | @param pWDICtx: pointer to the WLAN DAL context |
| 23791 | pEventData: pointer to the event information structure |
| 23792 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23793 | @see |
| 23794 | @return Result of the function call |
| 23795 | */ |
| 23796 | WDI_Status |
| 23797 | WDI_ProcessReceiveFilterSetFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23798 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23799 | WDI_ControlBlockType* pWDICtx, |
| 23800 | WDI_EventInfoType* pEventData |
| 23801 | ) |
| 23802 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23803 | eHalStatus halStatus; |
| 23804 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23805 | tHalSetPktFilterRspParams halSetPktFilterRspParams; |
| 23806 | WDI_SetRcvPktFilterRspParamsType wdiSetRcvPktFilterRspInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23807 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23808 | |
| 23809 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23810 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23811 | |
| 23812 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23813 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23814 | -------------------------------------------------------------------------*/ |
| 23815 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23816 | ( NULL == pEventData->pEventData )) |
| 23817 | { |
| 23818 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23819 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23820 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23821 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23822 | } |
| 23823 | |
| 23824 | wdiReceiveFilterSetFilterCb = (WDI_ReceiveFilterSetFilterCb)pWDICtx-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23825 | pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23826 | |
| 23827 | /*------------------------------------------------------------------------- |
| 23828 | Extract response and send it to UMAC |
| 23829 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23830 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 23831 | { |
| 23832 | wpalMemoryCopy( &halSetPktFilterRspParams, |
| 23833 | pEventData->pEventData, |
| 23834 | sizeof(halSetPktFilterRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23835 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23836 | wdiSetRcvPktFilterRspInfo.bssIdx = halSetPktFilterRspParams.bssIdx; |
| 23837 | wdiSetRcvPktFilterRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halSetPktFilterRspParams.status); |
| 23838 | } |
| 23839 | else |
| 23840 | { |
| 23841 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 23842 | wdiSetRcvPktFilterRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 23843 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23844 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23845 | wdiReceiveFilterSetFilterCb(&wdiSetRcvPktFilterRspInfo, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23846 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23847 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23848 | } |
| 23849 | |
| 23850 | /** |
| 23851 | @brief Process Packet Filter Match Count Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23852 | |
| 23853 | @param pWDICtx: pointer to the WLAN DAL context |
| 23854 | pEventData: pointer to the event information structure |
| 23855 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23856 | @see |
| 23857 | @return Result of the function call |
| 23858 | */ |
| 23859 | WDI_Status |
| 23860 | WDI_ProcessFilterMatchCountRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23861 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23862 | WDI_ControlBlockType* pWDICtx, |
| 23863 | WDI_EventInfoType* pEventData |
| 23864 | ) |
| 23865 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23866 | eHalStatus halStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23867 | WDI_FilterMatchCountCb wdiFilterMatchCountCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23868 | tHalRcvFltPktMatchRspParams halRcvFltrPktMatachRsp; |
| 23869 | WDI_RcvFltPktMatchCntRspParamsType wdiRcvFltPktMatchRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23870 | |
| 23871 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23872 | |
| 23873 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23874 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23875 | |
| 23876 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23877 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23878 | -------------------------------------------------------------------------*/ |
| 23879 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23880 | ( NULL == pEventData->pEventData )) |
| 23881 | { |
| 23882 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23883 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23884 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23885 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23886 | } |
| 23887 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23888 | wdiFilterMatchCountCb = (WDI_FilterMatchCountCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23889 | |
| 23890 | /*------------------------------------------------------------------------- |
| 23891 | Extract response and send it to UMAC |
| 23892 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23893 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 23894 | { |
| 23895 | wpalMemoryCopy( &halRcvFltrPktMatachRsp, |
| 23896 | pEventData->pEventData, |
| 23897 | sizeof(halRcvFltrPktMatachRsp)); |
| 23898 | |
| 23899 | wdiRcvFltPktMatchRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halRcvFltrPktMatachRsp.status); |
| 23900 | wdiRcvFltPktMatchRspParams.bssIdx = halRcvFltrPktMatachRsp.bssIdx; |
| 23901 | } |
| 23902 | else |
| 23903 | { |
| 23904 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 23905 | wdiRcvFltPktMatchRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 23906 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23907 | |
| 23908 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23909 | wdiFilterMatchCountCb(&wdiRcvFltPktMatchRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23910 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23911 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23912 | } |
| 23913 | |
| 23914 | /** |
| 23915 | @brief Process Receive Filter Clear Filter Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23916 | |
| 23917 | @param pWDICtx: pointer to the WLAN DAL context |
| 23918 | pEventData: pointer to the event information structure |
| 23919 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23920 | @see |
| 23921 | @return Result of the function call |
| 23922 | */ |
| 23923 | WDI_Status |
| 23924 | WDI_ProcessReceiveFilterClearFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23925 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23926 | WDI_ControlBlockType* pWDICtx, |
| 23927 | WDI_EventInfoType* pEventData |
| 23928 | ) |
| 23929 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23930 | eHalStatus halStatus; |
| 23931 | WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23932 | tHalRcvFltPktClearParam halRcvFltPktClearRspMsg; |
| 23933 | WDI_RcvFltPktClearRspParamsType wdiRcvFltPktClearRspParamsType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23934 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23935 | |
| 23936 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23937 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23938 | |
| 23939 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23940 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23941 | -------------------------------------------------------------------------*/ |
| 23942 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23943 | ( NULL == pEventData->pEventData )) |
| 23944 | { |
| 23945 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23946 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23947 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23948 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23949 | } |
| 23950 | |
| 23951 | wdiReceiveFilterClearFilterCb = (WDI_ReceiveFilterClearFilterCb)pWDICtx-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23952 | pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23953 | |
| 23954 | /*------------------------------------------------------------------------- |
| 23955 | Extract response and send it to UMAC |
| 23956 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23957 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 23958 | { |
| 23959 | wpalMemoryCopy( &halRcvFltPktClearRspMsg, |
| 23960 | pEventData->pEventData, |
| 23961 | sizeof(halRcvFltPktClearRspMsg)); |
| 23962 | |
| 23963 | wdiRcvFltPktClearRspParamsType.wdiStatus = |
| 23964 | WDI_HAL_2_WDI_STATUS(halRcvFltPktClearRspMsg.status); |
| 23965 | wdiRcvFltPktClearRspParamsType.bssIdx = |
| 23966 | halRcvFltPktClearRspMsg.bssIdx; |
| 23967 | } |
| 23968 | else |
| 23969 | { |
| 23970 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 23971 | wdiRcvFltPktClearRspParamsType.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 23972 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23973 | |
| 23974 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23975 | wdiReceiveFilterClearFilterCb(&wdiRcvFltPktClearRspParamsType, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23976 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23977 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23978 | } |
| 23979 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 23980 | |
| 23981 | /** |
| 23982 | @brief Process Shutdown Rsp function |
| 23983 | There is no shutdown response comming from HAL |
| 23984 | - function just kept for simmetry |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23985 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23986 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23987 | pEventData: pointer to the event information structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23988 | |
| 23989 | @see |
| 23990 | @return Result of the function call |
| 23991 | */ |
| 23992 | WDI_Status |
| 23993 | WDI_ProcessShutdownRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23994 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23995 | WDI_ControlBlockType* pWDICtx, |
| 23996 | WDI_EventInfoType* pEventData |
| 23997 | ) |
| 23998 | { |
| 23999 | /*There is no shutdown response comming from HAL - function just kept for |
| 24000 | simmetry */ |
| 24001 | WDI_ASSERT(0); |
| 24002 | return WDI_STATUS_SUCCESS; |
| 24003 | }/*WDI_ProcessShutdownRsp*/ |
| 24004 | |
| 24005 | /** |
| 24006 | @brief WDI_SetPowerParamsReq |
| 24007 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24008 | @param pwdiPowerParamsReqParams: the Set Power Params as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24009 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24010 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24011 | wdiPowerParamsCb: callback for passing back the response |
| 24012 | of the Set Power Params operation received from the |
| 24013 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24014 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24015 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24016 | callback |
| 24017 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24018 | @return Result of the function call |
| 24019 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24020 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24021 | WDI_SetPowerParamsReq |
| 24022 | ( |
| 24023 | WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams, |
| 24024 | WDI_SetPowerParamsCb wdiPowerParamsCb, |
| 24025 | void* pUserData |
| 24026 | ) |
| 24027 | { |
| 24028 | WDI_EventInfoType wdiEventData; |
| 24029 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24030 | |
| 24031 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24032 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24033 | ------------------------------------------------------------------------*/ |
| 24034 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24035 | { |
| 24036 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24037 | "WDI API call before module is initialized - Fail request"); |
| 24038 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24039 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24040 | } |
| 24041 | |
| 24042 | /*------------------------------------------------------------------------ |
| 24043 | Fill in Event data and post to the Main FSM |
| 24044 | ------------------------------------------------------------------------*/ |
| 24045 | wdiEventData.wdiRequest = WDI_SET_POWER_PARAMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24046 | wdiEventData.pEventData = pwdiPowerParamsReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24047 | wdiEventData.uEventDataSize = sizeof(*pwdiPowerParamsReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24048 | wdiEventData.pCBfnc = wdiPowerParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24049 | wdiEventData.pUserData = pUserData; |
| 24050 | |
| 24051 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24052 | }/*WDI_SetPowerParamsReq*/ |
| 24053 | |
| 24054 | /** |
| 24055 | @brief Process Set Power Params Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24056 | |
| 24057 | @param pWDICtx: pointer to the WLAN DAL context |
| 24058 | pEventData: pointer to the event information structure |
| 24059 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24060 | @see |
| 24061 | @return Result of the function call |
| 24062 | */ |
| 24063 | WDI_Status |
| 24064 | WDI_ProcessSetPowerParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24065 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24066 | WDI_ControlBlockType* pWDICtx, |
| 24067 | WDI_EventInfoType* pEventData |
| 24068 | ) |
| 24069 | { |
| 24070 | WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams = NULL; |
| 24071 | WDI_SetPowerParamsCb wdiPowerParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24072 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24073 | wpt_uint16 usDataOffset = 0; |
| 24074 | wpt_uint16 usSendSize = 0; |
| 24075 | tSetPowerParamsType powerParams; |
| 24076 | |
| 24077 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24078 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24079 | -------------------------------------------------------------------------*/ |
| 24080 | if (( NULL == pEventData ) || |
| 24081 | ( NULL == (pwdiPowerParamsReqParams = (WDI_SetPowerParamsReqParamsType*)pEventData->pEventData)) || |
| 24082 | ( NULL == (wdiPowerParamsCb = (WDI_SetPowerParamsCb)pEventData->pCBfnc))) |
| 24083 | { |
| 24084 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24085 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24086 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24087 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24088 | } |
| 24089 | |
| 24090 | /*----------------------------------------------------------------------- |
| 24091 | Get message buffer |
| 24092 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24093 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_POWER_PARAMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24094 | sizeof(powerParams), |
| 24095 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24096 | ( usSendSize < (usDataOffset + sizeof(powerParams) ))) |
| 24097 | { |
| 24098 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24099 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 24100 | pEventData, pwdiPowerParamsReqParams, wdiPowerParamsCb); |
| 24101 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24102 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24103 | } |
| 24104 | |
| 24105 | /* Ignore DTIM */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24106 | powerParams.uIgnoreDTIM = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24107 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uIgnoreDTIM; |
| 24108 | |
| 24109 | /*DTIM Period*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24110 | powerParams.uDTIMPeriod = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24111 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uDTIMPeriod; |
| 24112 | |
| 24113 | /* Listen Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24114 | powerParams.uListenInterval= |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24115 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uListenInterval; |
| 24116 | |
| 24117 | /* Broadcast Multicas Filter */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24118 | powerParams.uBcastMcastFilter = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24119 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBcastMcastFilter; |
| 24120 | |
| 24121 | /* Beacon Early Termination */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24122 | powerParams.uEnableBET = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24123 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uEnableBET; |
| 24124 | |
| 24125 | /* Beacon Early Termination Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24126 | powerParams.uBETInterval = |
| 24127 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBETInterval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24128 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24129 | |
| 24130 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24131 | &powerParams, |
| 24132 | sizeof(powerParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24133 | |
| 24134 | pWDICtx->wdiReqStatusCB = pwdiPowerParamsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24135 | pWDICtx->pReqStatusUserData = pwdiPowerParamsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24136 | |
| 24137 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24138 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24139 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24140 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 24141 | wdiPowerParamsCb, pEventData->pUserData, WDI_SET_POWER_PARAMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24142 | } |
| 24143 | |
| 24144 | /** |
| 24145 | @brief Process Power Params Rsp function (called when a |
| 24146 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24147 | |
| 24148 | @param pWDICtx: pointer to the WLAN DAL context |
| 24149 | pEventData: pointer to the event information structure |
| 24150 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24151 | @see |
| 24152 | @return Result of the function call |
| 24153 | */ |
| 24154 | WDI_Status |
| 24155 | WDI_ProcessSetPowerParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24156 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24157 | WDI_ControlBlockType* pWDICtx, |
| 24158 | WDI_EventInfoType* pEventData |
| 24159 | ) |
| 24160 | { |
| 24161 | WDI_Status wdiStatus; |
| 24162 | eHalStatus halStatus; |
| 24163 | WDI_SetPowerParamsCb wdiPowerParamsCb; |
| 24164 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24165 | |
| 24166 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24167 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24168 | -------------------------------------------------------------------------*/ |
| 24169 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24170 | ( NULL == pEventData->pEventData )) |
| 24171 | { |
| 24172 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24173 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24174 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24175 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24176 | } |
| 24177 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24178 | wdiPowerParamsCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24179 | |
| 24180 | /*------------------------------------------------------------------------- |
| 24181 | Extract response and send it to UMAC |
| 24182 | -------------------------------------------------------------------------*/ |
| 24183 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24184 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24185 | |
| 24186 | /*Notify UMAC*/ |
| 24187 | wdiPowerParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24188 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24189 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24190 | }/*WDI_ProcessSetPowerParamsRsp*/ |
| 24191 | |
| 24192 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 24193 | /** |
| 24194 | @brief WDI_GTKOffloadReq will be called when the upper MAC |
| 24195 | wants to set GTK Rekey Counter while in power save. Upon |
| 24196 | the call of this API the WLAN DAL will pack and send a |
| 24197 | HAL GTK offload request message to the lower RIVA |
| 24198 | sub-system if DAL is in state STARTED. |
| 24199 | |
| 24200 | In state BUSY this request will be queued. Request won't |
| 24201 | be allowed in any other state. |
| 24202 | |
| 24203 | WDI_PostAssocReq must have been called. |
| 24204 | |
| 24205 | @param pwdiGtkOffloadParams: the GTK offload as specified |
| 24206 | by the Device Interface |
| 24207 | |
| 24208 | wdiGtkOffloadCb: callback for passing back the response |
| 24209 | of the GTK offload operation received from the device |
| 24210 | |
| 24211 | pUserData: user data will be passed back with the |
| 24212 | callback |
| 24213 | |
| 24214 | @see WDI_PostAssocReq |
| 24215 | @return Result of the function call |
| 24216 | */ |
| 24217 | WDI_Status |
| 24218 | WDI_GTKOffloadReq |
| 24219 | ( |
| 24220 | WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg, |
| 24221 | WDI_GtkOffloadCb wdiGtkOffloadCb, |
| 24222 | void* pUserData |
| 24223 | ) |
| 24224 | { |
| 24225 | WDI_EventInfoType wdiEventData = {0}; |
| 24226 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24227 | |
| 24228 | /*------------------------------------------------------------------------ |
| 24229 | Sanity Check |
| 24230 | ------------------------------------------------------------------------*/ |
| 24231 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24232 | { |
| 24233 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24234 | "WDI API call before module is initialized - Fail request"); |
| 24235 | |
| 24236 | return WDI_STATUS_E_NOT_ALLOWED; |
| 24237 | } |
| 24238 | |
| 24239 | /*------------------------------------------------------------------------ |
| 24240 | Fill in Event data and post to the Main FSM |
| 24241 | ------------------------------------------------------------------------*/ |
| 24242 | wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_REQ; |
| 24243 | wdiEventData.pEventData = pwdiGtkOffloadReqMsg; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 24244 | wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadReqMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24245 | wdiEventData.pCBfnc = wdiGtkOffloadCb; |
| 24246 | wdiEventData.pUserData = pUserData; |
| 24247 | |
| 24248 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24249 | } |
| 24250 | |
| 24251 | |
| 24252 | /** |
| 24253 | @brief WDI_GTKOffloadGetInfoReq will be called when the upper |
| 24254 | MAC wants to get GTK Rekey Counter while in power save. |
| 24255 | Upon the call of this API the WLAN DAL will pack and |
| 24256 | send a HAL GTK offload request message to the lower RIVA |
| 24257 | sub-system if DAL is in state STARTED. |
| 24258 | |
| 24259 | In state BUSY this request will be queued. Request won't |
| 24260 | be allowed in any other state. |
| 24261 | |
| 24262 | WDI_PostAssocReq must have been called. |
| 24263 | |
| 24264 | @param pwdiGtkOffloadGetInfoReqMsg: the GTK Offload |
| 24265 | Information Message as specified by the |
| 24266 | Device Interface |
| 24267 | |
| 24268 | wdiGtkOffloadGetInfoCb: callback for passing back the |
| 24269 | response of the GTK offload operation received from the |
| 24270 | device |
| 24271 | |
| 24272 | pUserData: user data will be passed back with the |
| 24273 | callback |
| 24274 | |
| 24275 | @see WDI_PostAssocReq |
| 24276 | @return Result of the function call |
| 24277 | */ |
| 24278 | WDI_Status |
| 24279 | WDI_GTKOffloadGetInfoReq |
| 24280 | ( |
| 24281 | WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg, |
| 24282 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb, |
| 24283 | void* pUserData |
| 24284 | ) |
| 24285 | { |
| 24286 | WDI_EventInfoType wdiEventData = {0}; |
| 24287 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24288 | |
| 24289 | /*------------------------------------------------------------------------ |
| 24290 | Sanity Check |
| 24291 | ------------------------------------------------------------------------*/ |
| 24292 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24293 | { |
| 24294 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24295 | "WDI API call before module is initialized - Fail request"); |
| 24296 | |
| 24297 | return WDI_STATUS_E_NOT_ALLOWED; |
| 24298 | } |
| 24299 | |
| 24300 | /*------------------------------------------------------------------------ |
| 24301 | Fill in Event data and post to the Main FSM |
| 24302 | ------------------------------------------------------------------------*/ |
| 24303 | wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_GETINFO_REQ; |
| 24304 | wdiEventData.pEventData = pwdiGtkOffloadGetInfoReqMsg; |
| 24305 | wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadGetInfoReqMsg); |
| 24306 | wdiEventData.pCBfnc = wdiGtkOffloadGetInfoCb; |
| 24307 | wdiEventData.pUserData = pUserData; |
| 24308 | |
| 24309 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24310 | } |
| 24311 | |
| 24312 | |
| 24313 | /** |
| 24314 | @brief Process set GTK Offload Request function |
| 24315 | |
| 24316 | @param pWDICtx: pointer to the WLAN DAL context |
| 24317 | pEventData: pointer to the event information structure |
| 24318 | |
| 24319 | @see |
| 24320 | @return Result of the function call |
| 24321 | */ |
| 24322 | WDI_Status |
| 24323 | WDI_ProcessGTKOffloadReq |
| 24324 | ( |
| 24325 | WDI_ControlBlockType* pWDICtx, |
| 24326 | WDI_EventInfoType* pEventData |
| 24327 | ) |
| 24328 | { |
| 24329 | WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg = NULL; |
| 24330 | WDI_GtkOffloadCb wdiGtkOffloadCb = NULL; |
| 24331 | wpt_uint8* pSendBuffer = NULL; |
| 24332 | wpt_uint16 usDataOffset = 0; |
| 24333 | wpt_uint16 usSendSize = 0; |
| 24334 | tHalGtkOffloadReqParams gtkOffloadReqParams = {0}; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24335 | wpt_uint8 ucCurrentSessionId = 0; |
| 24336 | WDI_BSSSessionType* pBSSSes = NULL; |
| 24337 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24338 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24339 | |
| 24340 | /*------------------------------------------------------------------------- |
| 24341 | Sanity check |
| 24342 | -------------------------------------------------------------------------*/ |
| 24343 | if (( NULL == pEventData ) || |
| 24344 | ( NULL == (pwdiGtkOffloadReqMsg = (WDI_GtkOffloadReqMsg*)pEventData->pEventData)) || |
| 24345 | ( NULL == (wdiGtkOffloadCb = (WDI_GtkOffloadCb)pEventData->pCBfnc))) |
| 24346 | { |
| 24347 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24348 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24349 | WDI_ASSERT(0); |
| 24350 | return WDI_STATUS_E_FAILURE; |
| 24351 | } |
| 24352 | |
| 24353 | /*----------------------------------------------------------------------- |
| 24354 | Get message buffer |
| 24355 | -----------------------------------------------------------------------*/ |
| 24356 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_REQ, |
| 24357 | sizeof(gtkOffloadReqParams), |
| 24358 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24359 | ( usSendSize < (usDataOffset + sizeof(gtkOffloadReqParams) ))) |
| 24360 | { |
| 24361 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24362 | "Unable to get send buffer in GTK offload req %x %x %x", |
| 24363 | pEventData, pwdiGtkOffloadReqMsg, wdiGtkOffloadCb); |
| 24364 | WDI_ASSERT(0); |
| 24365 | return WDI_STATUS_E_FAILURE; |
| 24366 | } |
| 24367 | |
| 24368 | // |
| 24369 | // Fill gtkOffloadReqParams from pwdiGtkOffloadReqMsg->gtkOffloadReqParams |
| 24370 | // |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24371 | ucCurrentSessionId = WDI_FindAssocSession( pWDICtx, |
| 24372 | pwdiGtkOffloadReqMsg->gtkOffloadReqParams.bssId, |
| 24373 | &pBSSSes); |
| 24374 | if ( NULL == pBSSSes ) |
| 24375 | { |
| 24376 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24377 | " %s : Association for this BSSID does not exist", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24378 | return WDI_STATUS_E_FAILURE; |
| 24379 | } |
| 24380 | |
| 24381 | gtkOffloadReqParams.bssIdx = pBSSSes->ucBSSIdx; |
| 24382 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24383 | gtkOffloadReqParams.ulFlags = pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ulFlags; |
| 24384 | // Copy KCK |
| 24385 | wpalMemoryCopy(&(gtkOffloadReqParams.aKCK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKCK[0]), 16); |
| 24386 | // Copy KEK |
| 24387 | wpalMemoryCopy(&(gtkOffloadReqParams.aKEK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKEK[0]), 16); |
| 24388 | // Copy KeyReplayCounter |
| 24389 | wpalMemoryCopy(&(gtkOffloadReqParams.ullKeyReplayCounter), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ullKeyReplayCounter), sizeof(v_U64_t)); |
| 24390 | |
| 24391 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24392 | >kOffloadReqParams, |
| 24393 | sizeof(gtkOffloadReqParams)); |
| 24394 | |
| 24395 | pWDICtx->wdiReqStatusCB = pwdiGtkOffloadReqMsg->wdiReqStatusCB; |
| 24396 | pWDICtx->pReqStatusUserData = pwdiGtkOffloadReqMsg->pUserData; |
| 24397 | |
| 24398 | /*------------------------------------------------------------------------- |
| 24399 | Send Get STA Request to HAL |
| 24400 | -------------------------------------------------------------------------*/ |
| 24401 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 24402 | wdiGtkOffloadCb, pEventData->pUserData, WDI_GTK_OFFLOAD_RESP); |
| 24403 | } |
| 24404 | |
| 24405 | |
| 24406 | /** |
| 24407 | @brief Process GTK Offload Get Information Request function |
| 24408 | |
| 24409 | @param pWDICtx: pointer to the WLAN DAL context |
| 24410 | pEventData: pointer to the event information structure |
| 24411 | |
| 24412 | @see |
| 24413 | @return Result of the function call |
| 24414 | */ |
| 24415 | WDI_Status |
| 24416 | WDI_ProcessGTKOffloadGetInfoReq |
| 24417 | ( |
| 24418 | WDI_ControlBlockType* pWDICtx, |
| 24419 | WDI_EventInfoType* pEventData |
| 24420 | ) |
| 24421 | { |
| 24422 | WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg = NULL; |
| 24423 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL; |
| 24424 | wpt_uint8* pSendBuffer = NULL; |
| 24425 | wpt_uint16 usDataOffset = 0; |
| 24426 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24427 | tHalGtkOffloadGetInfoReqParams halGtkOffloadGetInfoReqParams; |
| 24428 | wpt_uint8 ucCurrentSessionId = 0; |
| 24429 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24430 | |
| 24431 | /*------------------------------------------------------------------------- |
| 24432 | Sanity check |
| 24433 | -------------------------------------------------------------------------*/ |
| 24434 | if (( NULL == pEventData ) || |
| 24435 | ( NULL == (pwdiGtkOffloadGetInfoReqMsg = (WDI_GtkOffloadGetInfoReqMsg*)pEventData->pEventData)) || |
| 24436 | ( NULL == (wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pEventData->pCBfnc))) |
| 24437 | { |
| 24438 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24439 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24440 | WDI_ASSERT(0); |
| 24441 | return WDI_STATUS_E_FAILURE; |
| 24442 | } |
| 24443 | |
| 24444 | /*----------------------------------------------------------------------- |
| 24445 | Get message buffer |
| 24446 | -----------------------------------------------------------------------*/ |
| 24447 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_GETINFO_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24448 | sizeof(halGtkOffloadGetInfoReqParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24449 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24450 | ( usSendSize < ( usDataOffset + sizeof(halGtkOffloadGetInfoReqParams))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24451 | { |
| 24452 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24453 | "Unable to get send buffer in WDI_ProcessGTKOffloadGetInfoReq() %x %x %x", |
| 24454 | pEventData, pwdiGtkOffloadGetInfoReqMsg, wdiGtkOffloadGetInfoCb); |
| 24455 | WDI_ASSERT(0); |
| 24456 | return WDI_STATUS_E_FAILURE; |
| 24457 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24458 | ucCurrentSessionId = WDI_FindAssocSession( pWDICtx, |
| 24459 | pwdiGtkOffloadGetInfoReqMsg->WDI_GtkOffloadGetInfoReqParams.bssId, |
| 24460 | &pBSSSes); |
| 24461 | if ( NULL == pBSSSes ) |
| 24462 | { |
| 24463 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24464 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24465 | return WDI_STATUS_E_FAILURE; |
| 24466 | } |
| 24467 | halGtkOffloadGetInfoReqParams.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24468 | |
| 24469 | // |
| 24470 | // Don't need to fill send buffer other than header |
| 24471 | // |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24472 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24473 | &halGtkOffloadGetInfoReqParams, |
| 24474 | sizeof(halGtkOffloadGetInfoReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24475 | |
| 24476 | pWDICtx->wdiReqStatusCB = pwdiGtkOffloadGetInfoReqMsg->wdiReqStatusCB; |
| 24477 | pWDICtx->pReqStatusUserData = pwdiGtkOffloadGetInfoReqMsg->pUserData; |
| 24478 | |
| 24479 | /*------------------------------------------------------------------------- |
| 24480 | Send Get STA Request to HAL |
| 24481 | -------------------------------------------------------------------------*/ |
| 24482 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 24483 | wdiGtkOffloadGetInfoCb, pEventData->pUserData, WDI_GTK_OFFLOAD_GETINFO_RESP); |
| 24484 | } |
| 24485 | |
| 24486 | /** |
| 24487 | @brief Process host offload Rsp function (called when a |
| 24488 | response is being received over the bus from HAL) |
| 24489 | |
| 24490 | @param pWDICtx: pointer to the WLAN DAL context |
| 24491 | pEventData: pointer to the event information structure |
| 24492 | |
| 24493 | @see |
| 24494 | @return Result of the function call |
| 24495 | */ |
| 24496 | WDI_Status |
| 24497 | WDI_ProcessGtkOffloadRsp |
| 24498 | ( |
| 24499 | WDI_ControlBlockType* pWDICtx, |
| 24500 | WDI_EventInfoType* pEventData |
| 24501 | ) |
| 24502 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24503 | eHalStatus halStatus; |
| 24504 | WDI_GtkOffloadCb wdiGtkOffloadCb = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24505 | tHalGtkOffloadRspParams halGtkOffloadRspParams; |
| 24506 | WDI_GtkOffloadRspParams wdiGtkOffloadRsparams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24507 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24508 | |
| 24509 | wdiGtkOffloadCb = (WDI_GtkOffloadCb)pWDICtx->pfncRspCB; |
| 24510 | |
| 24511 | /*------------------------------------------------------------------------- |
| 24512 | Sanity check |
| 24513 | -------------------------------------------------------------------------*/ |
| 24514 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24515 | ( NULL == pEventData->pEventData)) |
| 24516 | { |
| 24517 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24518 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24519 | WDI_ASSERT(0); |
| 24520 | return WDI_STATUS_E_FAILURE; |
| 24521 | } |
| 24522 | |
| 24523 | /*------------------------------------------------------------------------- |
| 24524 | Extract response and send it to UMAC |
| 24525 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24526 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 24527 | { |
| 24528 | wpalMemoryCopy( &halGtkOffloadRspParams, |
| 24529 | pEventData->pEventData, |
| 24530 | sizeof(halGtkOffloadRspParams)); |
| 24531 | |
| 24532 | wdiGtkOffloadRsparams.ulStatus = |
| 24533 | WDI_HAL_2_WDI_STATUS(halGtkOffloadRspParams.status); |
| 24534 | wdiGtkOffloadRsparams.bssIdx = |
| 24535 | halGtkOffloadRspParams.bssIdx; |
| 24536 | } |
| 24537 | else |
| 24538 | { |
| 24539 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24540 | wdiGtkOffloadRsparams.ulStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24541 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24542 | |
| 24543 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24544 | wdiGtkOffloadCb( &wdiGtkOffloadRsparams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24545 | |
| 24546 | return WDI_STATUS_SUCCESS; |
| 24547 | } |
| 24548 | |
| 24549 | /** |
| 24550 | @brief Process GTK Offload Get Information Response function |
| 24551 | |
| 24552 | @param pWDICtx: pointer to the WLAN DAL context |
| 24553 | pEventData: pointer to the event information structure |
| 24554 | |
| 24555 | @see |
| 24556 | @return Result of the function call |
| 24557 | */ |
| 24558 | WDI_Status |
| 24559 | WDI_ProcessGTKOffloadGetInfoRsp |
| 24560 | ( |
| 24561 | WDI_ControlBlockType* pWDICtx, |
| 24562 | WDI_EventInfoType* pEventData |
| 24563 | ) |
| 24564 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24565 | eHalStatus halStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24566 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24567 | tHalGtkOffloadGetInfoRspParams halGtkOffloadGetInfoRspParams; |
| 24568 | WDI_GtkOffloadGetInfoRspParams wdiGtkOffloadGetInfoRsparams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24569 | |
| 24570 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24571 | |
| 24572 | wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pWDICtx->pfncRspCB; |
| 24573 | |
| 24574 | /*------------------------------------------------------------------------- |
| 24575 | Sanity check |
| 24576 | -------------------------------------------------------------------------*/ |
| 24577 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24578 | ( NULL == pEventData->pEventData )) |
| 24579 | { |
| 24580 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24581 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24582 | WDI_ASSERT(0); |
| 24583 | return WDI_STATUS_E_FAILURE; |
| 24584 | } |
| 24585 | |
| 24586 | /*------------------------------------------------------------------------- |
| 24587 | Extract response and send it to UMAC |
| 24588 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24589 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 24590 | { |
| 24591 | wpalMemoryCopy( &halGtkOffloadGetInfoRspParams, |
| 24592 | pEventData->pEventData, |
| 24593 | sizeof(halGtkOffloadGetInfoRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24594 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24595 | wdiGtkOffloadGetInfoRsparams.ulStatus = |
| 24596 | WDI_HAL_2_WDI_STATUS(halGtkOffloadGetInfoRspParams.status); |
| 24597 | wdiGtkOffloadGetInfoRsparams.ullKeyReplayCounter = |
| 24598 | halGtkOffloadGetInfoRspParams.ullKeyReplayCounter; |
| 24599 | wdiGtkOffloadGetInfoRsparams.ulTotalRekeyCount = |
| 24600 | halGtkOffloadGetInfoRspParams.ulTotalRekeyCount; |
| 24601 | wdiGtkOffloadGetInfoRsparams.ulGTKRekeyCount = |
| 24602 | halGtkOffloadGetInfoRspParams.ulGTKRekeyCount; |
| 24603 | wdiGtkOffloadGetInfoRsparams.ulIGTKRekeyCount = |
| 24604 | halGtkOffloadGetInfoRspParams.ulIGTKRekeyCount; |
| 24605 | wdiGtkOffloadGetInfoRsparams.bssIdx = |
| 24606 | halGtkOffloadGetInfoRspParams.bssIdx; |
| 24607 | } |
| 24608 | else |
| 24609 | { |
| 24610 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24611 | wdiGtkOffloadGetInfoRsparams.ulStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24612 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24613 | /*Notify UMAC*/ |
| 24614 | //wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24615 | //wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24616 | wdiGtkOffloadGetInfoCb(&wdiGtkOffloadGetInfoRsparams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24617 | |
| 24618 | return WDI_STATUS_SUCCESS; |
| 24619 | } |
| 24620 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 24621 | |
| 24622 | #ifdef WLAN_WAKEUP_EVENTS |
| 24623 | WDI_Status |
| 24624 | WDI_ProcessWakeReasonInd |
| 24625 | ( |
| 24626 | WDI_ControlBlockType* pWDICtx, |
| 24627 | WDI_EventInfoType* pEventData |
| 24628 | ) |
| 24629 | { |
| 24630 | WDI_LowLevelIndType *pWdiInd; |
| 24631 | tpWakeReasonParams pWakeReasonParams; |
| 24632 | wpt_uint32 allocSize = 0; |
| 24633 | |
| 24634 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24635 | "+%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24636 | |
| 24637 | /*------------------------------------------------------------------------- |
| 24638 | Sanity check |
| 24639 | -------------------------------------------------------------------------*/ |
| 24640 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24641 | ( NULL == pEventData->pEventData )) |
| 24642 | { |
| 24643 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24644 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24645 | WDI_ASSERT( 0 ); |
| 24646 | return WDI_STATUS_E_FAILURE; |
| 24647 | } |
| 24648 | |
| 24649 | /*------------------------------------------------------------------------- |
| 24650 | Extract indication and send it to UMAC |
| 24651 | -------------------------------------------------------------------------*/ |
| 24652 | pWakeReasonParams = (tpWakeReasonParams)(pEventData->pEventData); |
| 24653 | |
| 24654 | allocSize = sizeof(WDI_LowLevelIndType) + (pWakeReasonParams->ulStoredDataLen - 1); |
| 24655 | |
| 24656 | //Allocate memory for WDI_WakeReasonIndType structure |
| 24657 | pWdiInd = wpalMemoryAllocate(allocSize) ; |
| 24658 | |
| 24659 | if(NULL == pWdiInd) |
| 24660 | { |
| 24661 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24662 | "%s: Failed to allocate memory for WDI_WakeReasonIndType: %x %x %x ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24663 | __func__, pWDICtx, pEventData, pEventData->pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24664 | WDI_ASSERT(0); |
| 24665 | return WDI_STATUS_E_FAILURE; |
| 24666 | } |
| 24667 | |
| 24668 | wpalMemoryZero(pWdiInd, allocSize); |
| 24669 | |
| 24670 | /* Fill in the indication parameters*/ |
| 24671 | // Fill wdiInd.wdiIndicationData.wakeReasonInd structure from wakeReasonInd.wakeReasonParams |
| 24672 | pWdiInd->wdiIndicationType = WDI_WAKE_REASON_IND; |
| 24673 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReason = pWakeReasonParams->ulReason; |
| 24674 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg = pWakeReasonParams->ulReasonArg; |
| 24675 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen = pWakeReasonParams->ulStoredDataLen; |
| 24676 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulActualDataLen = pWakeReasonParams->ulActualDataLen; |
| 24677 | wpalMemoryCopy( (void *)&(pWdiInd->wdiIndicationData.wdiWakeReasonInd.aDataStart[0]), |
| 24678 | &(pWakeReasonParams->aDataStart[0]), |
| 24679 | pWakeReasonParams->ulStoredDataLen); |
| 24680 | |
| 24681 | /*Notify UMAC*/ |
| 24682 | pWDICtx->wdiLowLevelIndCB( pWdiInd, pWDICtx->pIndUserData ); |
| 24683 | |
| 24684 | //Free memory allocated for WDI_WakeReasonIndType structure |
| 24685 | wpalMemoryFree(pWdiInd); |
| 24686 | |
| 24687 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24688 | "-%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24689 | |
| 24690 | return WDI_STATUS_SUCCESS; |
| 24691 | } |
| 24692 | #endif // WLAN_WAKEUP_EVENTS |
| 24693 | |
| 24694 | void WDI_GetWcnssCompiledApiVersion |
| 24695 | ( |
| 24696 | WDI_WlanVersionType *pWcnssApiVersion |
| 24697 | ) |
| 24698 | { |
| 24699 | pWcnssApiVersion->major = WLAN_HAL_VER_MAJOR; |
| 24700 | pWcnssApiVersion->minor = WLAN_HAL_VER_MINOR; |
| 24701 | pWcnssApiVersion->version = WLAN_HAL_VER_VERSION; |
| 24702 | pWcnssApiVersion->revision = WLAN_HAL_VER_REVISION; |
| 24703 | } |
| 24704 | |
| 24705 | /** |
| 24706 | @brief Process Set TM Level Rsp function (called when a |
| 24707 | response is being received over the bus from HAL) |
| 24708 | |
| 24709 | @param pWDICtx: pointer to the WLAN DAL context |
| 24710 | pEventData: pointer to the event information structure |
| 24711 | |
| 24712 | @see |
| 24713 | @return Result of the function call |
| 24714 | */ |
| 24715 | WDI_Status |
| 24716 | WDI_ProcessSetTmLevelRsp |
| 24717 | ( |
| 24718 | WDI_ControlBlockType* pWDICtx, |
| 24719 | WDI_EventInfoType* pEventData |
| 24720 | ) |
| 24721 | { |
| 24722 | WDI_Status wdiStatus; |
| 24723 | eHalStatus halStatus; |
| 24724 | WDI_SetTmLevelCb wdiSetTmLevelCb; |
| 24725 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24726 | |
| 24727 | /*------------------------------------------------------------------------- |
| 24728 | Sanity check |
| 24729 | -------------------------------------------------------------------------*/ |
| 24730 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24731 | ( NULL == pEventData->pEventData )) |
| 24732 | { |
| 24733 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24734 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24735 | WDI_ASSERT(0); |
| 24736 | return WDI_STATUS_E_FAILURE; |
| 24737 | } |
| 24738 | |
| 24739 | wdiSetTmLevelCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB; |
| 24740 | |
| 24741 | /*------------------------------------------------------------------------- |
| 24742 | Extract response and send it to UMAC |
| 24743 | -------------------------------------------------------------------------*/ |
| 24744 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24745 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24746 | |
| 24747 | /*Notify UMAC*/ |
| 24748 | wdiSetTmLevelCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24749 | |
| 24750 | return WDI_STATUS_SUCCESS; |
| 24751 | }/*WDI_ProcessSetTmLevelRsp*/ |
| 24752 | |
| 24753 | /** |
| 24754 | @brief Process Set Thermal Mitigation level Changed request |
| 24755 | |
| 24756 | @param pWDICtx: pointer to the WLAN DAL context |
| 24757 | pEventData: pointer to the event information structure |
| 24758 | |
| 24759 | @see |
| 24760 | @return Result of the function call |
| 24761 | */ |
| 24762 | WDI_Status |
| 24763 | WDI_ProcessSetTmLevelReq |
| 24764 | ( |
| 24765 | WDI_ControlBlockType* pWDICtx, |
| 24766 | WDI_EventInfoType* pEventData |
| 24767 | ) |
| 24768 | { |
| 24769 | WDI_SetTmLevelReqType *pwdiSetTmLevelReq = NULL; |
| 24770 | WDI_SetTmLevelCb wdiSetTmLevelCb = NULL; |
| 24771 | wpt_uint8* pSendBuffer = NULL; |
| 24772 | wpt_uint16 usDataOffset = 0; |
| 24773 | wpt_uint16 usSendSize = 0; |
| 24774 | tSetThermalMitgationType halTmMsg; |
| 24775 | |
| 24776 | /*------------------------------------------------------------------------- |
| 24777 | Sanity check |
| 24778 | -------------------------------------------------------------------------*/ |
| 24779 | if (( NULL == pEventData ) || |
| 24780 | ( NULL == (pwdiSetTmLevelReq = (WDI_SetTmLevelReqType*)pEventData->pEventData)) || |
| 24781 | ( NULL == (wdiSetTmLevelCb = (WDI_SetTmLevelCb)pEventData->pCBfnc))) |
| 24782 | { |
| 24783 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24784 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24785 | WDI_ASSERT(0); |
| 24786 | return WDI_STATUS_E_FAILURE; |
| 24787 | } |
| 24788 | |
| 24789 | /*----------------------------------------------------------------------- |
| 24790 | Get message buffer |
| 24791 | -----------------------------------------------------------------------*/ |
| 24792 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TM_LEVEL_REQ, |
| 24793 | sizeof(halTmMsg), |
| 24794 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24795 | ( usSendSize < (usDataOffset + sizeof(halTmMsg) ))) |
| 24796 | { |
| 24797 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24798 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 24799 | pEventData, pwdiSetTmLevelReq, wdiSetTmLevelCb); |
| 24800 | WDI_ASSERT(0); |
| 24801 | return WDI_STATUS_E_FAILURE; |
| 24802 | } |
| 24803 | |
| 24804 | halTmMsg.thermalMitMode = pwdiSetTmLevelReq->tmMode; |
| 24805 | halTmMsg.thermalMitLevel = pwdiSetTmLevelReq->tmLevel; |
| 24806 | |
| 24807 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24808 | &halTmMsg, |
| 24809 | sizeof(halTmMsg)); |
| 24810 | |
| 24811 | pWDICtx->pReqStatusUserData = pwdiSetTmLevelReq->pUserData; |
| 24812 | pWDICtx->pfncRspCB = NULL; |
| 24813 | /*------------------------------------------------------------------------- |
| 24814 | Send Get STA Request to HAL |
| 24815 | -------------------------------------------------------------------------*/ |
| 24816 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 24817 | wdiSetTmLevelCb, pEventData->pUserData, WDI_SET_TM_LEVEL_RESP); |
| 24818 | } |
| 24819 | |
| 24820 | /* Fill the value from the global features enabled array to the global capabilities |
| 24821 | * bitmap struct |
| 24822 | */ |
| 24823 | static void |
| 24824 | FillAllFeatureCaps(tWlanFeatCaps *fCaps, placeHolderInCapBitmap *enabledFeat, wpt_int8 len) |
| 24825 | { |
| 24826 | wpt_int8 i; |
| 24827 | for (i=0; i<len; i++) |
| 24828 | { |
| 24829 | setFeatCaps(fCaps, enabledFeat[i]); |
| 24830 | } |
| 24831 | } |
| 24832 | |
| 24833 | /** |
| 24834 | @brief WDI_featureCapsExchangeReq |
| 24835 | Post feature capability bitmap exchange event. |
| 24836 | Host will send its own capability to FW in this req and |
| 24837 | expect FW to send its capability back as a bitmap in Response |
| 24838 | |
| 24839 | @param |
| 24840 | |
| 24841 | wdiFeatureCapsExchangeCb: callback called on getting the response. |
| 24842 | It is kept to mantain similarity between WDI reqs and if needed, can |
| 24843 | be used in future. Currently, It is set to NULL |
| 24844 | |
| 24845 | pUserData: user data will be passed back with the |
| 24846 | callback |
| 24847 | |
| 24848 | @see |
| 24849 | @return Result of the function call |
| 24850 | */ |
| 24851 | WDI_Status |
| 24852 | WDI_featureCapsExchangeReq |
| 24853 | ( |
| 24854 | WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb, |
| 24855 | void* pUserData |
| 24856 | ) |
| 24857 | { |
| 24858 | WDI_EventInfoType wdiEventData; |
| 24859 | wpt_int32 fCapsStructSize; |
| 24860 | |
| 24861 | /*------------------------------------------------------------------------ |
| 24862 | Sanity Check |
| 24863 | ------------------------------------------------------------------------*/ |
| 24864 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24865 | { |
| 24866 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24867 | "WDI API call before module is initialized - Fail request"); |
| 24868 | |
| 24869 | return WDI_STATUS_E_NOT_ALLOWED; |
| 24870 | } |
| 24871 | |
| 24872 | /* Allocate memory separately for global variable carrying FW caps */ |
| 24873 | fCapsStructSize = sizeof(tWlanFeatCaps); |
| 24874 | gpHostWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize); |
| 24875 | if ( NULL == gpHostWlanFeatCaps ) |
| 24876 | { |
| 24877 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24878 | "Cannot allocate memory for host capability info\n"); |
| 24879 | WDI_ASSERT(0); |
| 24880 | return WDI_STATUS_MEM_FAILURE; |
| 24881 | } |
| 24882 | |
| 24883 | wpalMemoryZero(gpHostWlanFeatCaps, fCapsStructSize); |
| 24884 | |
| 24885 | /*------------------------------------------------------------------------ |
| 24886 | Fill in Event data and post to the Main FSM |
| 24887 | ------------------------------------------------------------------------*/ |
| 24888 | FillAllFeatureCaps(gpHostWlanFeatCaps, supportEnabledFeatures, |
| 24889 | (sizeof(supportEnabledFeatures)/sizeof(supportEnabledFeatures[0]))); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24890 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 24891 | "Host caps %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24892 | gpHostWlanFeatCaps->featCaps[0], |
| 24893 | gpHostWlanFeatCaps->featCaps[1], |
| 24894 | gpHostWlanFeatCaps->featCaps[2], |
| 24895 | gpHostWlanFeatCaps->featCaps[3] |
| 24896 | ); |
| 24897 | |
| 24898 | wdiEventData.wdiRequest = WDI_FEATURE_CAPS_EXCHANGE_REQ; |
| 24899 | wdiEventData.pEventData = gpHostWlanFeatCaps; |
| 24900 | wdiEventData.uEventDataSize = fCapsStructSize; |
| 24901 | wdiEventData.pCBfnc = wdiFeatureCapsExchangeCb; |
| 24902 | wdiEventData.pUserData = pUserData; |
| 24903 | |
| 24904 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24905 | } |
| 24906 | |
| 24907 | /** |
| 24908 | @brief Process Host-FW Capability Exchange Request function |
| 24909 | |
| 24910 | @param pWDICtx: pointer to the WLAN DAL context |
| 24911 | pEventData: pointer to the event information structure |
| 24912 | |
| 24913 | @see |
| 24914 | @return Result of the function call |
| 24915 | */ |
| 24916 | WDI_Status |
| 24917 | WDI_ProcessFeatureCapsExchangeReq |
| 24918 | ( |
| 24919 | WDI_ControlBlockType* pWDICtx, |
| 24920 | WDI_EventInfoType* pEventData |
| 24921 | ) |
| 24922 | { |
| 24923 | wpt_uint8* pSendBuffer = NULL; |
| 24924 | wpt_uint16 usDataOffset = 0; |
| 24925 | wpt_uint16 usSendSize = 0; |
| 24926 | wpt_uint16 usLen = 0; |
| 24927 | |
| 24928 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24929 | |
| 24930 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24931 | "%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24932 | |
| 24933 | /*------------------------------------------------------------------------- |
| 24934 | Sanity check |
| 24935 | -------------------------------------------------------------------------*/ |
| 24936 | /* Call back function is NULL since not required for cap exchange req */ |
| 24937 | if (( NULL == pEventData ) || |
| 24938 | ( NULL == (tWlanFeatCaps *)pEventData->pEventData)) |
| 24939 | { |
| 24940 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24941 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24942 | WDI_ASSERT(0); |
| 24943 | return WDI_STATUS_E_FAILURE; |
| 24944 | } |
| 24945 | |
| 24946 | /*----------------------------------------------------------------------- |
| 24947 | Get message buffer |
| 24948 | -----------------------------------------------------------------------*/ |
| 24949 | usLen = sizeof(tWlanFeatCaps); |
| 24950 | |
| 24951 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 24952 | WDI_FEATURE_CAPS_EXCHANGE_REQ, |
| 24953 | usLen, |
| 24954 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24955 | ( usSendSize < (usDataOffset + usLen ))) |
| 24956 | { |
| 24957 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 24958 | "Unable to get send buffer in feat caps exchange req %x %x", |
| 24959 | pEventData, (tWlanFeatCaps *)pEventData->pEventData); |
| 24960 | WDI_ASSERT(0); |
| 24961 | return WDI_STATUS_E_FAILURE; |
| 24962 | } |
| 24963 | |
| 24964 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24965 | "Host Caps - %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24966 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[0], |
| 24967 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[1], |
| 24968 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[2], |
| 24969 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[3] |
| 24970 | ); |
| 24971 | |
| 24972 | /* Copy host caps after the offset in the send buffer */ |
| 24973 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24974 | (tWlanFeatCaps *)pEventData->pEventData, |
| 24975 | usLen); |
| 24976 | |
| 24977 | /*------------------------------------------------------------------------- |
| 24978 | Send Start Request to HAL |
| 24979 | -------------------------------------------------------------------------*/ |
| 24980 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 24981 | (WDI_StartRspCb)pEventData->pCBfnc, |
| 24982 | pEventData->pUserData, WDI_FEATURE_CAPS_EXCHANGE_RESP); |
| 24983 | |
| 24984 | }/*WDI_ProcessFeatureCapsExchangeReq*/ |
| 24985 | |
| 24986 | /** |
| 24987 | @brief Process Host-FW Capability Exchange Response function |
| 24988 | |
| 24989 | @param pWDICtx: pointer to the WLAN DAL context |
| 24990 | pEventData: pointer to the event information structure |
| 24991 | |
| 24992 | @see |
| 24993 | @return Result of the function call |
| 24994 | */ |
| 24995 | WDI_Status |
| 24996 | WDI_ProcessFeatureCapsExchangeRsp |
| 24997 | ( |
| 24998 | WDI_ControlBlockType* pWDICtx, |
| 24999 | WDI_EventInfoType* pEventData |
| 25000 | ) |
| 25001 | { |
| 25002 | WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb; |
| 25003 | wpt_int32 fCapsStructSize; |
| 25004 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25005 | |
| 25006 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25007 | "%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25008 | |
| 25009 | /*------------------------------------------------------------------------- |
| 25010 | Sanity check |
| 25011 | -------------------------------------------------------------------------*/ |
| 25012 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25013 | ( NULL == pEventData->pEventData )) |
| 25014 | { |
| 25015 | /* It will go here when riva is old (doesn't understand this msg) and host is new */ |
| 25016 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25017 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25018 | WDI_ASSERT(0); |
| 25019 | return WDI_STATUS_E_FAILURE; |
| 25020 | } |
| 25021 | |
| 25022 | /* Allocate memory separately for global variable carrying FW caps */ |
| 25023 | fCapsStructSize = sizeof(tWlanFeatCaps); |
| 25024 | gpFwWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize); |
| 25025 | if ( NULL == gpFwWlanFeatCaps ) |
| 25026 | { |
| 25027 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25028 | "Cannot allocate memory for host capability info\n"); |
| 25029 | WDI_ASSERT(0); |
| 25030 | return WDI_STATUS_MEM_FAILURE; |
| 25031 | } |
| 25032 | |
| 25033 | /*------------------------------------------------------------------------- |
| 25034 | Unpack HAL Response Message - the header was already extracted by the |
| 25035 | main Response Handling procedure |
| 25036 | -------------------------------------------------------------------------*/ |
| 25037 | /*------------------------------------------------------------------------- |
| 25038 | Extract response and send it to UMAC |
| 25039 | -------------------------------------------------------------------------*/ |
| 25040 | |
| 25041 | wpalMemoryCopy(gpFwWlanFeatCaps,(tWlanFeatCaps *) pEventData -> pEventData, |
| 25042 | fCapsStructSize); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25043 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 25044 | "FW caps %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25045 | gpFwWlanFeatCaps->featCaps[0], |
| 25046 | gpFwWlanFeatCaps->featCaps[1], |
| 25047 | gpFwWlanFeatCaps->featCaps[2], |
| 25048 | gpFwWlanFeatCaps->featCaps[3] |
| 25049 | ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25050 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25051 | wdiFeatureCapsExchangeCb = (WDI_featureCapsExchangeCb) pWDICtx -> pfncRspCB; |
| 25052 | |
| 25053 | /*Notify UMAC - there is no callback right now but can be used in future if reqd */ |
| 25054 | if (wdiFeatureCapsExchangeCb != NULL) |
| 25055 | wdiFeatureCapsExchangeCb(NULL, NULL); |
| 25056 | |
| 25057 | return WDI_STATUS_SUCCESS; |
| 25058 | } |
| 25059 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 25060 | #ifdef WLAN_FEATURE_11AC |
| 25061 | WDI_Status |
| 25062 | WDI_ProcessUpdateVHTOpModeRsp |
| 25063 | ( |
| 25064 | WDI_ControlBlockType* pWDICtx, |
| 25065 | WDI_EventInfoType* pEventData |
| 25066 | ) |
| 25067 | { |
| 25068 | WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL; |
| 25069 | WDI_Status wdiStatus; |
| 25070 | eHalStatus halStatus; |
| 25071 | |
| 25072 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25073 | |
| 25074 | /*------------------------------------------------------------------------- |
| 25075 | Sanity check |
| 25076 | -------------------------------------------------------------------------*/ |
| 25077 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25078 | ( NULL == pEventData->pEventData)) |
| 25079 | { |
| 25080 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25081 | "%s: Invalid parameters", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 25082 | WDI_ASSERT(0); |
| 25083 | return WDI_STATUS_E_FAILURE; |
| 25084 | } |
| 25085 | wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc; |
| 25086 | |
| 25087 | /*------------------------------------------------------------------------- |
| 25088 | Extract response and send it to UMAC |
| 25089 | -------------------------------------------------------------------------*/ |
| 25090 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 25091 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 25092 | |
| 25093 | /*Notify UMAC*/ |
| 25094 | wdiVHTOpModeCb( wdiStatus, pEventData->pUserData); |
| 25095 | |
| 25096 | return WDI_STATUS_SUCCESS; |
| 25097 | } |
| 25098 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25099 | /** |
| 25100 | @brief WDI_getHostWlanFeatCaps |
| 25101 | WDI API that returns whether the feature passed to it as enum value in |
| 25102 | "placeHolderInCapBitmap" is supported by Host or not. It uses WDI global |
| 25103 | variable storing host capability bitmap to find this. This can be used by |
| 25104 | other moduels to decide certain things like call different APIs based on |
| 25105 | whether a particular feature is supported. |
| 25106 | |
| 25107 | @param |
| 25108 | |
| 25109 | feat_enum_value: enum value for the feature as in placeHolderInCapBitmap in wlan_hal_msg.h. |
| 25110 | |
| 25111 | @see |
| 25112 | @return |
| 25113 | 0 - if the feature is NOT supported in host |
| 25114 | any non-zero value - if the feature is SUPPORTED in host. |
| 25115 | */ |
| 25116 | wpt_uint8 WDI_getHostWlanFeatCaps(wpt_uint8 feat_enum_value) |
| 25117 | { |
| 25118 | wpt_uint8 featSupported = 0; |
| 25119 | if (gpHostWlanFeatCaps != NULL) |
| 25120 | { |
| 25121 | getFeatCaps(gpHostWlanFeatCaps, feat_enum_value, featSupported); |
| 25122 | } |
| 25123 | else |
| 25124 | { |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 25125 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 25126 | "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] | 25127 | } |
| 25128 | return featSupported; |
| 25129 | } |
| 25130 | |
| 25131 | /** |
| 25132 | @brief WDI_getFwWlanFeatCaps |
| 25133 | WDI API that returns whether the feature passed to it as enum value in |
| 25134 | "placeHolderInCapBitmap" is supported by FW or not. It uses WDI global |
| 25135 | variable storing host capability bitmap to find this. This can be used by |
| 25136 | other moduels to decide certain things like call different APIs based on |
| 25137 | whether a particular feature is supported. |
| 25138 | |
| 25139 | @param |
| 25140 | |
| 25141 | feat_enum_value: enum value for the feature as in placeHolderInCapBitmap |
| 25142 | in wlan_hal_msg.h. |
| 25143 | |
| 25144 | @see |
| 25145 | @return |
| 25146 | 0 - if the feature is NOT supported in FW |
| 25147 | any non-zero value - if the feature is SUPPORTED in FW. |
| 25148 | */ |
| 25149 | wpt_uint8 WDI_getFwWlanFeatCaps(wpt_uint8 feat_enum_value) |
| 25150 | { |
| 25151 | wpt_uint8 featSupported = 0; |
| 25152 | if (gpFwWlanFeatCaps != NULL) |
| 25153 | { |
| 25154 | getFeatCaps(gpFwWlanFeatCaps, feat_enum_value, featSupported); |
| 25155 | } |
| 25156 | else |
| 25157 | { |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 25158 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 25159 | "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] | 25160 | } |
| 25161 | return featSupported; |
| 25162 | } |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 25163 | |
| 25164 | #ifdef WLAN_FEATURE_11AC |
| 25165 | WDI_Status |
| 25166 | WDI_ProcessUpdateVHTOpModeReq |
| 25167 | ( |
| 25168 | WDI_ControlBlockType* pWDICtx, |
| 25169 | WDI_EventInfoType* pEventData |
| 25170 | ) |
| 25171 | { |
| 25172 | WDI_UpdateVHTOpMode* pwdiVHTOpModeParams = NULL; |
| 25173 | WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL; |
| 25174 | wpt_uint8* pSendBuffer = NULL; |
| 25175 | wpt_uint16 usDataOffset = 0; |
| 25176 | wpt_uint16 usSendSize = 0; |
| 25177 | |
| 25178 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25179 | |
| 25180 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25181 | "%s", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 25182 | |
| 25183 | /*------------------------------------------------------------------------- |
| 25184 | Sanity check |
| 25185 | -------------------------------------------------------------------------*/ |
| 25186 | if (( NULL == pEventData ) || |
| 25187 | ( NULL == (pwdiVHTOpModeParams = (WDI_UpdateVHTOpMode*)pEventData->pEventData)) || |
| 25188 | ( NULL == (wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc))) |
| 25189 | { |
| 25190 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25191 | "%s: Invalid parameters", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 25192 | WDI_ASSERT(0); |
| 25193 | return WDI_STATUS_E_FAILURE; |
| 25194 | } |
| 25195 | |
| 25196 | /*----------------------------------------------------------------------- |
| 25197 | Get message buffer |
| 25198 | -----------------------------------------------------------------------*/ |
| 25199 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_VHT_OP_MODE_REQ, |
| 25200 | sizeof(WDI_UpdateVHTOpMode), |
| 25201 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 25202 | ( usSendSize < (usDataOffset + sizeof(WDI_UpdateVHTOpMode) ))) |
| 25203 | { |
| 25204 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25205 | "Unable to get send buffer in update vht opMode req"); |
| 25206 | WDI_ASSERT(0); |
| 25207 | return WDI_STATUS_E_FAILURE; |
| 25208 | } |
| 25209 | |
| 25210 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25211 | "pwdiVHTOpModeParams->opMode=%d, pwdiVHTOpModeParams->staId=%d\n", pwdiVHTOpModeParams->opMode, pwdiVHTOpModeParams->staId); |
| 25212 | |
| 25213 | wpalMemoryCopy( pSendBuffer+usDataOffset, pwdiVHTOpModeParams, |
| 25214 | sizeof(WDI_UpdateVHTOpMode)); |
| 25215 | |
| 25216 | /*------------------------------------------------------------------------- |
| 25217 | Send Start Request to HAL |
| 25218 | -------------------------------------------------------------------------*/ |
| 25219 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 25220 | wdiVHTOpModeCb, |
| 25221 | pEventData->pUserData, WDI_UPDATE_VHT_OP_MODE_RESP); |
| 25222 | |
| 25223 | } |
| 25224 | |
| 25225 | WDI_Status |
| 25226 | WDI_UpdateVHTOpModeReq |
| 25227 | ( |
| 25228 | WDI_UpdateVHTOpMode *pData, |
| 25229 | WDI_UpdateVHTOpModeCb wdiUpdateVHTOpModeCb, |
| 25230 | void* pUserData |
| 25231 | ) |
| 25232 | { |
| 25233 | WDI_EventInfoType wdiEventData; |
| 25234 | |
| 25235 | /*------------------------------------------------------------------------ |
| 25236 | Sanity Check |
| 25237 | ------------------------------------------------------------------------*/ |
| 25238 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 25239 | { |
| 25240 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25241 | "WDI API call before module is initialized - Fail request"); |
| 25242 | |
| 25243 | return WDI_STATUS_E_NOT_ALLOWED; |
| 25244 | } |
| 25245 | |
| 25246 | /*------------------------------------------------------------------------ |
| 25247 | Fill in Event data and post to the Main FSM |
| 25248 | ------------------------------------------------------------------------*/ |
| 25249 | wdiEventData.wdiRequest = WDI_UPDATE_VHT_OP_MODE_REQ; |
| 25250 | wdiEventData.pEventData = pData; |
| 25251 | wdiEventData.uEventDataSize = sizeof(WDI_UpdateVHTOpMode); |
| 25252 | wdiEventData.pCBfnc = wdiUpdateVHTOpModeCb; |
| 25253 | wdiEventData.pUserData = pUserData; |
| 25254 | |
| 25255 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25256 | "pData->opMode=%d, pData->staId=%d\n", pData->opMode, pData->staId); |
| 25257 | |
| 25258 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 25259 | |
| 25260 | } |
| 25261 | #endif |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 25262 | |
| 25263 | /** |
| 25264 | @brief WDI_TransportChannelDebug - |
| 25265 | Display DXE Channel debugging information |
| 25266 | User may request to display DXE channel snapshot |
| 25267 | Or if host driver detects any abnormal stcuk may display |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 25268 | |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 25269 | @param displaySnapshot : Dispaly DXE snapshot option |
| 25270 | @param enableStallDetect : Enable stall detect feature |
| 25271 | This feature will take effect to data performance |
| 25272 | Not integrate till fully verification |
| 25273 | @see |
| 25274 | @return none |
| 25275 | */ |
| 25276 | void WDI_TransportChannelDebug |
| 25277 | ( |
| 25278 | wpt_boolean displaySnapshot, |
Madan Mohan Koyyalamudi | 24a00f9 | 2012-10-22 15:21:02 -0700 | [diff] [blame] | 25279 | wpt_boolean toggleStallDetect |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 25280 | ) |
| 25281 | { |
Madan Mohan Koyyalamudi | 24a00f9 | 2012-10-22 15:21:02 -0700 | [diff] [blame] | 25282 | WDTS_ChannelDebug(displaySnapshot, toggleStallDetect); |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 25283 | return; |
Madan Mohan Koyyalamudi | 3352adb | 2012-09-28 14:57:24 -0700 | [diff] [blame] | 25284 | } |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 25285 | /** |
| 25286 | @brief WDI_SsrTimerCB |
| 25287 | Callback function for SSR timer, if this is called then the graceful |
| 25288 | shutdown for Riva did not happen. |
| 25289 | |
| 25290 | @param pUserData : user data to timer |
| 25291 | |
| 25292 | @see |
| 25293 | @return none |
| 25294 | */ |
| 25295 | void |
| 25296 | WDI_SsrTimerCB |
| 25297 | ( |
| 25298 | void *pUserData |
| 25299 | ) |
| 25300 | { |
| 25301 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData; |
| 25302 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25303 | |
| 25304 | if (NULL == pWDICtx ) |
| 25305 | { |
| 25306 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25307 | "%s: Invalid parameters", __func__); |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 25308 | WDI_ASSERT(0); |
| 25309 | return; |
| 25310 | } |
| 25311 | wpalRivaSubystemRestart(); |
| 25312 | |
| 25313 | return; |
| 25314 | |
| 25315 | }/*WDI_SsrTimerCB*/ |