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 | |
Yathish | d871319 | 2012-12-10 14:21:35 -0800 | [diff] [blame^] | 97 | #define FEATURE_NOT_SUPPORTED 128 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 98 | |
| 99 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 100 | #define WDI_PNO_VERSION_MASK 0x8000 |
| 101 | #endif |
| 102 | |
| 103 | /* host capability bitmap global */ |
Madan Mohan Koyyalamudi | dfd6aa8 | 2012-10-18 20:18:43 -0700 | [diff] [blame] | 104 | static tWlanFeatCaps *gpHostWlanFeatCaps; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 105 | /* FW capability bitmap global */ |
Madan Mohan Koyyalamudi | dfd6aa8 | 2012-10-18 20:18:43 -0700 | [diff] [blame] | 106 | static tWlanFeatCaps *gpFwWlanFeatCaps; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 107 | /* array of features supported. Need to add a new feature |
| 108 | * and other two places - wlan_hal_msg.h and halMsg.c (FW file) |
| 109 | */ |
| 110 | static placeHolderInCapBitmap supportEnabledFeatures[] = |
Mohit Khanna | c0b992f | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 111 | {MCC, P2P, DOT11AC, SLM_SESSIONIZATION, DOT11AC_OPMODE |
Yathish | d871319 | 2012-12-10 14:21:35 -0800 | [diff] [blame^] | 112 | #ifdef WLAN_SOFTAP_VSTA_FEATURE |
| 113 | ,SAP32STA |
| 114 | #else |
| 115 | ,FEATURE_NOT_SUPPORTED |
| 116 | #endif |
Mohit Khanna | c0b992f | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 117 | #ifdef FEATURE_WLAN_TDLS |
Yathish | d871319 | 2012-12-10 14:21:35 -0800 | [diff] [blame^] | 118 | ,TDLS |
| 119 | #else |
| 120 | ,FEATURE_NOT_SUPPORTED |
Mohit Khanna | c0b992f | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 121 | #endif |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 122 | ,P2P_GO_NOA_DECOUPLE_INIT_SCAN |
Yathish | d871319 | 2012-12-10 14:21:35 -0800 | [diff] [blame^] | 123 | #ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE |
| 124 | ,WLANACTIVE_OFFLOAD |
| 125 | #else |
| 126 | ,FEATURE_NOT_SUPPORTED |
| 127 | #endif |
Mohit Khanna | c0b992f | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 128 | }; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 129 | |
| 130 | /*-------------------------------------------------------------------------- |
| 131 | WLAN DAL State Machine |
| 132 | --------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 133 | WPT_STATIC const WDI_MainFsmEntryType wdiMainFSM[WDI_MAX_ST] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 134 | { |
| 135 | /*WDI_INIT_ST*/ |
| 136 | {{ |
| 137 | WDI_MainStart, /*WDI_START_EVENT*/ |
| 138 | NULL, /*WDI_STOP_EVENT*/ |
| 139 | WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/ |
| 140 | WDI_MainRspInit, /*WDI_RESPONSE_EVENT*/ |
| 141 | WDI_MainClose, /*WDI_CLOSE_EVENT*/ |
| 142 | WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/ |
| 143 | }}, |
| 144 | |
| 145 | /*WDI_STARTED_ST*/ |
| 146 | {{ |
| 147 | WDI_MainStartStarted, /*WDI_START_EVENT*/ |
| 148 | WDI_MainStopStarted, /*WDI_STOP_EVENT*/ |
| 149 | WDI_MainReqStarted, /*WDI_REQUEST_EVENT*/ |
| 150 | WDI_MainRsp, /*WDI_RESPONSE_EVENT*/ |
| 151 | NULL, /*WDI_CLOSE_EVENT*/ |
| 152 | WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/ |
| 153 | }}, |
| 154 | |
| 155 | /*WDI_STOPPED_ST*/ |
| 156 | {{ |
| 157 | WDI_MainStart, /*WDI_START_EVENT*/ |
| 158 | WDI_MainStopStopped, /*WDI_STOP_EVENT*/ |
| 159 | NULL, /*WDI_REQUEST_EVENT*/ |
| 160 | WDI_MainRsp, /*WDI_RESPONSE_EVENT*/ |
| 161 | WDI_MainClose, /*WDI_CLOSE_EVENT*/ |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 162 | WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 163 | }}, |
| 164 | |
| 165 | /*WDI_BUSY_ST*/ |
| 166 | {{ |
| 167 | WDI_MainStartBusy, /*WDI_START_EVENT*/ |
| 168 | WDI_MainStopBusy, /*WDI_STOP_EVENT*/ |
| 169 | WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/ |
| 170 | WDI_MainRsp, /*WDI_RESPONSE_EVENT*/ |
| 171 | WDI_MainCloseBusy, /*WDI_CLOSE_EVENT*/ |
| 172 | WDI_MainShutdownBusy /*WDI_SHUTDOWN_EVENT*/ |
| 173 | }} |
| 174 | }; |
| 175 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 176 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 177 | DAL Request Processing Array - the functions in this table will only be |
| 178 | called when the processing of the specific request is allowed by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 179 | Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 180 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 181 | WDI_ReqProcFuncType pfnReqProcTbl[WDI_MAX_UMAC_IND] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 182 | { |
| 183 | /*INIT*/ |
| 184 | WDI_ProcessStartReq, /* WDI_START_REQ */ |
| 185 | WDI_ProcessStopReq, /* WDI_STOP_REQ */ |
| 186 | WDI_ProcessCloseReq, /* WDI_CLOSE_REQ */ |
| 187 | |
| 188 | /*SCAN*/ |
| 189 | WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_REQ */ |
| 190 | WDI_ProcessStartScanReq, /* WDI_START_SCAN_REQ */ |
| 191 | WDI_ProcessEndScanReq, /* WDI_END_SCAN_REQ */ |
| 192 | WDI_ProcessFinishScanReq, /* WDI_FINISH_SCAN_REQ */ |
| 193 | |
| 194 | /*ASSOCIATION*/ |
| 195 | WDI_ProcessJoinReq, /* WDI_JOIN_REQ */ |
| 196 | WDI_ProcessConfigBSSReq, /* WDI_CONFIG_BSS_REQ */ |
| 197 | WDI_ProcessDelBSSReq, /* WDI_DEL_BSS_REQ */ |
| 198 | WDI_ProcessPostAssocReq, /* WDI_POST_ASSOC_REQ */ |
| 199 | WDI_ProcessDelSTAReq, /* WDI_DEL_STA_REQ */ |
| 200 | |
| 201 | /* Security */ |
| 202 | WDI_ProcessSetBssKeyReq, /* WDI_SET_BSS_KEY_REQ */ |
| 203 | WDI_ProcessRemoveBssKeyReq, /* WDI_RMV_BSS_KEY_REQ */ |
| 204 | WDI_ProcessSetStaKeyReq, /* WDI_SET_STA_KEY_REQ */ |
| 205 | WDI_ProcessRemoveStaKeyReq, /* WDI_RMV_BSS_KEY_REQ */ |
| 206 | |
| 207 | /* QoS and BA APIs */ |
| 208 | WDI_ProcessAddTSpecReq, /* WDI_ADD_TS_REQ */ |
| 209 | WDI_ProcessDelTSpecReq, /* WDI_DEL_TS_REQ */ |
| 210 | WDI_ProcessUpdateEDCAParamsReq, /* WDI_UPD_EDCA_PRMS_REQ */ |
| 211 | WDI_ProcessAddBASessionReq, /* WDI_ADD_BA_SESSION_REQ */ |
| 212 | WDI_ProcessDelBAReq, /* WDI_DEL_BA_REQ */ |
| 213 | |
| 214 | /* Miscellaneous Control APIs */ |
| 215 | WDI_ProcessChannelSwitchReq, /* WDI_CH_SWITCH_REQ */ |
| 216 | WDI_ProcessConfigStaReq, /* WDI_CONFIG_STA_REQ */ |
| 217 | WDI_ProcessSetLinkStateReq, /* WDI_SET_LINK_ST_REQ */ |
| 218 | WDI_ProcessGetStatsReq, /* WDI_GET_STATS_REQ */ |
| 219 | WDI_ProcessUpdateCfgReq, /* WDI_UPDATE_CFG_REQ */ |
| 220 | |
| 221 | /*BA APIs*/ |
| 222 | WDI_ProcessAddBAReq, /* WDI_ADD_BA_REQ */ |
| 223 | WDI_ProcessTriggerBAReq, /* WDI_TRIGGER_BA_REQ */ |
| 224 | |
| 225 | /*Beacon processing APIs*/ |
| 226 | WDI_ProcessUpdateBeaconParamsReq, /* WDI_UPD_BCON_PRMS_REQ */ |
| 227 | WDI_ProcessSendBeaconParamsReq, /* WDI_SND_BCON_REQ */ |
| 228 | |
| 229 | WDI_ProcessUpdateProbeRspTemplateReq, /* WDI_UPD_PROBE_RSP_TEMPLATE_REQ */ |
| 230 | WDI_ProcessSetStaBcastKeyReq, /* WDI_SET_STA_BCAST_KEY_REQ */ |
| 231 | WDI_ProcessRemoveStaBcastKeyReq, /* WDI_RMV_STA_BCAST_KEY_REQ */ |
| 232 | WDI_ProcessSetMaxTxPowerReq, /*WDI_SET_MAX_TX_POWER_REQ*/ |
| 233 | #ifdef WLAN_FEATURE_P2P |
| 234 | WDI_ProcessP2PGONOAReq, /* WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ */ |
| 235 | #else |
| 236 | NULL, |
| 237 | #endif |
| 238 | /* PowerSave APIs */ |
| 239 | WDI_ProcessEnterImpsReq, /* WDI_ENTER_IMPS_REQ */ |
| 240 | WDI_ProcessExitImpsReq, /* WDI_EXIT_IMPS_REQ */ |
| 241 | WDI_ProcessEnterBmpsReq, /* WDI_ENTER_BMPS_REQ */ |
| 242 | WDI_ProcessExitBmpsReq, /* WDI_EXIT_BMPS_REQ */ |
| 243 | WDI_ProcessEnterUapsdReq, /* WDI_ENTER_UAPSD_REQ */ |
| 244 | WDI_ProcessExitUapsdReq, /* WDI_EXIT_UAPSD_REQ */ |
| 245 | WDI_ProcessSetUapsdAcParamsReq, /* WDI_SET_UAPSD_PARAM_REQ */ |
| 246 | WDI_ProcessUpdateUapsdParamsReq, /* WDI_UPDATE_UAPSD_PARAM_REQ */ |
| 247 | WDI_ProcessConfigureRxpFilterReq, /* WDI_CONFIGURE_RXP_FILTER_REQ */ |
| 248 | WDI_ProcessSetBeaconFilterReq, /* WDI_SET_BEACON_FILTER_REQ */ |
| 249 | WDI_ProcessRemBeaconFilterReq, /* WDI_REM_BEACON_FILTER_REQ */ |
| 250 | WDI_ProcessSetRSSIThresholdsReq, /* WDI_SET_RSSI_THRESHOLDS_REQ */ |
| 251 | WDI_ProcessHostOffloadReq, /* WDI_HOST_OFFLOAD_REQ */ |
| 252 | WDI_ProcessWowlAddBcPtrnReq, /* WDI_WOWL_ADD_BC_PTRN_REQ */ |
| 253 | WDI_ProcessWowlDelBcPtrnReq, /* WDI_WOWL_DEL_BC_PTRN_REQ */ |
| 254 | WDI_ProcessWowlEnterReq, /* WDI_WOWL_ENTER_REQ */ |
| 255 | WDI_ProcessWowlExitReq, /* WDI_WOWL_EXIT_REQ */ |
| 256 | WDI_ProcessConfigureAppsCpuWakeupStateReq, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ */ |
| 257 | /*NV Download APIs*/ |
| 258 | WDI_ProcessNvDownloadReq, /* WDI_NV_DOWNLOAD_REQ*/ |
| 259 | WDI_ProcessFlushAcReq, /* WDI_FLUSH_AC_REQ */ |
| 260 | WDI_ProcessBtAmpEventReq, /* WDI_BTAMP_EVENT_REQ */ |
| 261 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 262 | WDI_ProcessAggrAddTSpecReq, /* WDI_AGGR_ADD_TS_REQ */ |
| 263 | #else |
| 264 | NULL, |
| 265 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 266 | WDI_ProcessAddSTASelfReq, /* WDI_ADD_STA_SELF_REQ */ |
| 267 | WDI_ProcessDelSTASelfReq, /* WDI DEL STA SELF REQ */ |
| 268 | #ifdef ANI_MANF_DIAG |
| 269 | WDI_ProcessFTMCommandReq, /* WDI_FTM_CMD_REQ */ |
| 270 | #else |
| 271 | NULL, |
| 272 | #endif /* ANI_MANF_DIAG */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 273 | |
| 274 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 275 | WDI_ProcessStartOemDataReq, /*WDI_START_OEM_DATA_REQ*/ |
| 276 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 277 | NULL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 278 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 279 | WDI_ProcessHostResumeReq, /*WDI_HOST_RESUME_REQ*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 280 | |
| 281 | WDI_ProcessKeepAliveReq, /* WDI_KEEP_ALIVE_REQ */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 282 | |
| 283 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 284 | WDI_ProcessSetPreferredNetworkReq, /* WDI_SET_PREF_NETWORK_REQ */ |
| 285 | WDI_ProcessSetRssiFilterReq, /* WDI_SET_RSSI_FILTER_REQ */ |
| 286 | WDI_ProcessUpdateScanParamsReq, /* WDI_UPDATE_SCAN_PARAMS_REQ */ |
| 287 | #else |
| 288 | NULL, |
| 289 | NULL, |
| 290 | NULL, |
| 291 | #endif /* FEATURE_WLAN_SCAN_PNO */ |
| 292 | |
| 293 | WDI_ProcessSetTxPerTrackingReq, /* WDI_SET_TX_PER_TRACKING_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 294 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 295 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 296 | /* WDI_8023_MULTICAST_LIST_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 297 | WDI_Process8023MulticastListReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 298 | /* WDI_RECEIVE_FILTER_SET_FILTER_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 299 | WDI_ProcessReceiveFilterSetFilterReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 300 | /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 301 | WDI_ProcessFilterMatchCountReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 302 | /* WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 303 | WDI_ProcessReceiveFilterClearFilterReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 304 | #else |
| 305 | NULL, |
| 306 | NULL, |
| 307 | NULL, |
| 308 | NULL, |
| 309 | #endif // WLAN_FEATURE_PACKET_FILTERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 310 | WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_CON_REQ */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 311 | WDI_ProcessHALDumpCmdReq, /*WDI_HAL_DUMP_CMD_REQ */ |
| 312 | WDI_ProcessShutdownReq, /* WDI_SHUTDOWN_REQ */ |
| 313 | |
| 314 | WDI_ProcessSetPowerParamsReq, /*WDI_SET_POWER_PARAMS_REQ*/ |
| 315 | #ifdef FEATURE_WLAN_CCX |
| 316 | WDI_ProcessTSMStatsReq, /* WDI_TSM_STATS_REQ */ |
| 317 | #else |
| 318 | NULL, |
| 319 | #endif |
| 320 | |
| 321 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 322 | WDI_ProcessGTKOffloadReq, /* WDI_GTK_OFFLOAD_REQ */ |
| 323 | WDI_ProcessGTKOffloadGetInfoReq, /* WDI_GTK_OFFLOAD_GETINFO_REQ */ |
| 324 | #else |
| 325 | NULL, |
| 326 | NULL, |
| 327 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 328 | |
| 329 | WDI_ProcessSetTmLevelReq, /*WDI_SET_TM_LEVEL_REQ*/ |
| 330 | WDI_ProcessFeatureCapsExchangeReq, /* WDI_FEATURE_CAPS_EXCHANGE_REQ */ |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 331 | #ifdef WLAN_FEATURE_11AC |
| 332 | WDI_ProcessUpdateVHTOpModeReq, /* WDI_UPDATE_VHT_OP_MODE_REQ */ |
| 333 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 334 | /*------------------------------------------------------------------------- |
| 335 | Indications |
| 336 | -------------------------------------------------------------------------*/ |
| 337 | WDI_ProcessHostSuspendInd, /* WDI_HOST_SUSPEND_IND*/ |
| 338 | }; |
| 339 | |
| 340 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 341 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 342 | DAL Request Processing Array - the functions in this table will only be |
| 343 | called when the processing of the specific request is allowed by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 344 | Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 345 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 346 | WDI_RspProcFuncType pfnRspProcTbl[WDI_MAX_RESP] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 347 | { |
| 348 | /*INIT*/ |
| 349 | WDI_ProcessStartRsp, /* WDI_START_RESP */ |
| 350 | WDI_ProcessStopRsp, /* WDI_STOP_RESP */ |
| 351 | WDI_ProcessCloseRsp, /* WDI_CLOSE_RESP */ |
| 352 | |
| 353 | /*SCAN*/ |
| 354 | WDI_ProcessInitScanRsp, /* WDI_INIT_SCAN_RESP */ |
| 355 | WDI_ProcessStartScanRsp, /* WDI_START_SCAN_RESP */ |
| 356 | WDI_ProcessEndScanRsp, /* WDI_END_SCAN_RESP */ |
| 357 | WDI_ProcessFinishScanRsp, /* WDI_FINISH_SCAN_RESP */ |
| 358 | |
| 359 | /* ASSOCIATION*/ |
| 360 | WDI_ProcessJoinRsp, /* WDI_JOIN_RESP */ |
| 361 | WDI_ProcessConfigBSSRsp, /* WDI_CONFIG_BSS_RESP */ |
| 362 | WDI_ProcessDelBSSRsp, /* WDI_DEL_BSS_RESP */ |
| 363 | WDI_ProcessPostAssocRsp, /* WDI_POST_ASSOC_RESP */ |
| 364 | WDI_ProcessDelSTARsp, /* WDI_DEL_STA_RESP */ |
| 365 | |
| 366 | /* Security */ |
| 367 | WDI_ProcessSetBssKeyRsp, /* WDI_SET_BSS_KEY_RESP */ |
| 368 | WDI_ProcessRemoveBssKeyRsp, /* WDI_RMV_BSS_KEY_RESP */ |
| 369 | WDI_ProcessSetStaKeyRsp, /* WDI_SET_STA_KEY_RESP */ |
| 370 | WDI_ProcessRemoveStaKeyRsp, /* WDI_RMV_BSS_KEY_RESP */ |
| 371 | |
| 372 | /* QoS and BA APIs */ |
| 373 | WDI_ProcessAddTSpecRsp, /* WDI_ADD_TS_RESP */ |
| 374 | WDI_ProcessDelTSpecRsp, /* WDI_DEL_TS_RESP */ |
| 375 | WDI_ProcessUpdateEDCAParamsRsp, /* WDI_UPD_EDCA_PRMS_RESP */ |
| 376 | WDI_ProcessAddBASessionRsp, /* WDI_ADD_BA_SESSION_RESP */ |
| 377 | WDI_ProcessDelBARsp, /* WDI_DEL_BA_RESP */ |
| 378 | |
| 379 | /* Miscellaneous Control APIs */ |
| 380 | WDI_ProcessChannelSwitchRsp, /* WDI_CH_SWITCH_RESP */ |
| 381 | WDI_ProcessConfigStaRsp, /* WDI_CONFIG_STA_RESP */ |
| 382 | WDI_ProcessSetLinkStateRsp, /* WDI_SET_LINK_ST_RESP */ |
| 383 | WDI_ProcessGetStatsRsp, /* WDI_GET_STATS_RESP */ |
| 384 | WDI_ProcessUpdateCfgRsp, /* WDI_UPDATE_CFG_RESP */ |
| 385 | |
| 386 | /* BA APIs*/ |
| 387 | WDI_ProcessAddBARsp, /* WDI_ADD_BA_RESP */ |
| 388 | WDI_ProcessTriggerBARsp, /* WDI_TRIGGER_BA_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 389 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 390 | /* IBSS APIs*/ |
| 391 | WDI_ProcessUpdateBeaconParamsRsp, /* WDI_UPD_BCON_PRMS_RSP */ |
| 392 | WDI_ProcessSendBeaconParamsRsp, /* WDI_SND_BCON_RSP */ |
| 393 | |
| 394 | /*Soft AP APIs*/ |
| 395 | WDI_ProcessUpdateProbeRspTemplateRsp,/*WDI_UPD_PROBE_RSP_TEMPLATE_RESP */ |
| 396 | WDI_ProcessSetStaBcastKeyRsp, /*WDI_SET_STA_BCAST_KEY_RESP */ |
| 397 | WDI_ProcessRemoveStaBcastKeyRsp, /*WDI_RMV_STA_BCAST_KEY_RESP */ |
| 398 | WDI_ProcessSetMaxTxPowerRsp, /*WDI_SET_MAX_TX_POWER_RESP */ |
| 399 | |
| 400 | /* PowerSave APIs */ |
| 401 | WDI_ProcessEnterImpsRsp, /* WDI_ENTER_IMPS_RESP */ |
| 402 | WDI_ProcessExitImpsRsp, /* WDI_EXIT_IMPS_RESP */ |
| 403 | WDI_ProcessEnterBmpsRsp, /* WDI_ENTER_BMPS_RESP */ |
| 404 | WDI_ProcessExitBmpsRsp, /* WDI_EXIT_BMPS_RESP */ |
| 405 | WDI_ProcessEnterUapsdRsp, /* WDI_ENTER_UAPSD_RESP */ |
| 406 | WDI_ProcessExitUapsdRsp, /* WDI_EXIT_UAPSD_RESP */ |
| 407 | WDI_ProcessSetUapsdAcParamsRsp, /* WDI_SET_UAPSD_PARAM_RESP */ |
| 408 | WDI_ProcessUpdateUapsdParamsRsp, /* WDI_UPDATE_UAPSD_PARAM_RESP */ |
| 409 | WDI_ProcessConfigureRxpFilterRsp,/* WDI_CONFIGURE_RXP_FILTER_RESP */ |
| 410 | WDI_ProcessSetBeaconFilterRsp, /* WDI_SET_BEACON_FILTER_RESP */ |
| 411 | WDI_ProcessRemBeaconFilterRsp, /* WDI_REM_BEACON_FILTER_RESP */ |
| 412 | WDI_ProcessSetRSSIThresoldsRsp, /* WDI_SET_RSSI_THRESHOLDS_RESP */ |
| 413 | WDI_ProcessHostOffloadRsp, /* WDI_HOST_OFFLOAD_RESP */ |
| 414 | WDI_ProcessWowlAddBcPtrnRsp, /* WDI_WOWL_ADD_BC_PTRN_RESP */ |
| 415 | WDI_ProcessWowlDelBcPtrnRsp, /* WDI_WOWL_DEL_BC_PTRN_RESP */ |
| 416 | WDI_ProcessWowlEnterRsp, /* WDI_WOWL_ENTER_RESP */ |
| 417 | WDI_ProcessWowlExitRsp, /* WDI_WOWL_EXIT_RESP */ |
| 418 | WDI_ProcessConfigureAppsCpuWakeupStateRsp, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 419 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 420 | |
| 421 | WDI_ProcessNvDownloadRsp, /* WDI_NV_DOWNLOAD_RESP*/ |
| 422 | |
| 423 | WDI_ProcessFlushAcRsp, /* WDI_FLUSH_AC_RESP */ |
| 424 | WDI_ProcessBtAmpEventRsp, /* WDI_BTAMP_EVENT_RESP */ |
| 425 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 426 | WDI_ProcessAggrAddTSpecRsp, /* WDI_AGGR_ADD_TS_RESP */ |
| 427 | #else |
| 428 | NULL, |
| 429 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 430 | WDI_ProcessAddSTASelfRsp, /* WDI_ADD_STA_SELF_RESP */ |
| 431 | WDI_ProcessDelSTASelfRsp, /* WDI_DEL_STA_SELF_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 432 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 433 | WDI_ProcessStartOemDataRsp, /*WDI_START_OEM_DATA_RESP*/ |
| 434 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 435 | NULL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 436 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 437 | WDI_ProcessHostResumeRsp, /*WDI_HOST_RESUME_RESP*/ |
| 438 | |
| 439 | #ifdef WLAN_FEATURE_P2P |
| 440 | WDI_ProcessP2PGONOARsp, /*WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP */ |
| 441 | #else |
| 442 | NULL, |
| 443 | #endif |
| 444 | |
| 445 | #ifdef ANI_MANF_DIAG |
| 446 | WDI_ProcessFTMCommandRsp, /* WDI_FTM_CMD_RESP */ |
| 447 | #else |
| 448 | NULL, |
| 449 | #endif /* ANI_MANF_DIAG */ |
| 450 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 451 | WDI_ProcessKeepAliveRsp, /* WDI_KEEP_ALIVE_RESP */ |
| 452 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 453 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 454 | WDI_ProcessSetPreferredNetworkRsp, /* WDI_SET_PREF_NETWORK_RESP */ |
| 455 | WDI_ProcessSetRssiFilterRsp, /* WDI_SET_RSSI_FILTER_RESP */ |
| 456 | WDI_ProcessUpdateScanParamsRsp, /* WDI_UPDATE_SCAN_PARAMS_RESP */ |
| 457 | #else |
| 458 | NULL, |
| 459 | NULL, |
| 460 | NULL, |
| 461 | #endif // FEATURE_WLAN_SCAN_PNO |
| 462 | |
| 463 | WDI_ProcessSetTxPerTrackingRsp, /* WDI_SET_TX_PER_TRACKING_RESP */ |
| 464 | |
| 465 | /*--------------------------------------------------------------------- |
| 466 | Indications |
| 467 | ---------------------------------------------------------------------*/ |
| 468 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 469 | /* WDI_8023_MULTICAST_LIST_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 470 | WDI_Process8023MulticastListRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 471 | /* WDI_RECEIVE_FILTER_SET_FILTER_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 472 | WDI_ProcessReceiveFilterSetFilterRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 473 | /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 474 | WDI_ProcessFilterMatchCountRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 475 | /* WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 476 | WDI_ProcessReceiveFilterClearFilterRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 477 | #else |
| 478 | NULL, |
| 479 | NULL, |
| 480 | NULL, |
| 481 | NULL, |
| 482 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 483 | |
| 484 | WDI_ProcessHALDumpCmdRsp, /* WDI_HAL_DUMP_CMD_RESP */ |
| 485 | WDI_ProcessShutdownRsp, /* WDI_SHUTDOWN_RESP */ |
| 486 | |
| 487 | WDI_ProcessSetPowerParamsRsp, /*WDI_SET_POWER_PARAMS_RESP*/ |
| 488 | #ifdef FEATURE_WLAN_CCX |
| 489 | WDI_ProcessTsmStatsRsp, /* WDI_TSM_STATS_RESP */ |
| 490 | #else |
| 491 | NULL, |
| 492 | #endif |
| 493 | |
| 494 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 495 | WDI_ProcessGtkOffloadRsp, /* WDI_GTK_OFFLOAD_RESP */ |
| 496 | WDI_ProcessGTKOffloadGetInfoRsp, /* WDI_GTK_OFFLOAD_GETINFO_RESP */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 497 | #else |
| 498 | NULL, |
| 499 | NULL, |
| 500 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 501 | WDI_ProcessSetTmLevelRsp, /* WDI_SET_TM_LEVEL_RESP */ |
| 502 | WDI_ProcessFeatureCapsExchangeRsp, /* WDI_FEATURE_CAPS_EXCHANGE_RESP */ |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 503 | #ifdef WLAN_FEATURE_11AC |
| 504 | WDI_ProcessUpdateVHTOpModeRsp, /* WDI_UPDATE_VHT_OP_MODE_RESP */ |
| 505 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 506 | |
| 507 | /*--------------------------------------------------------------------- |
| 508 | Indications |
| 509 | ---------------------------------------------------------------------*/ |
| 510 | WDI_ProcessLowRSSIInd, /* Just threshold crossing not really low WDI_HAL_RSSI_NOTIFICATION_IND */ |
| 511 | WDI_ProcessMissedBeaconInd, /* WDI_HAL_MISSED_BEACON_IND */ |
| 512 | WDI_ProcessUnkAddrFrameInd, /* WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND */ |
| 513 | WDI_ProcessMicFailureInd, /* WDI_HAL_MIC_FAILURE_IND */ |
| 514 | WDI_ProcessFatalErrorInd, /* WDI_HAL_FATAL_ERROR_IND */ |
| 515 | WDI_ProcessDelSTAInd, /* WDI_HAL_DEL_STA_IND */ |
| 516 | |
| 517 | WDI_ProcessCoexInd, /* WDI_HAL_COEX_IND */ |
| 518 | |
| 519 | WDI_ProcessTxCompleteInd, /* WDI_HAL_TX_COMPLETE_IND */ |
| 520 | |
| 521 | #ifdef WLAN_FEATURE_P2P |
| 522 | WDI_ProcessP2pNoaAttrInd, /*WDI_HOST_NOA_ATTR_IND*/ |
| 523 | #else |
| 524 | NULL, |
| 525 | #endif |
| 526 | |
| 527 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 528 | WDI_ProcessPrefNetworkFoundInd, /* WDI_HAL_PREF_NETWORK_FOUND_IND */ |
| 529 | #else |
| 530 | NULL, |
| 531 | #endif // FEATURE_WLAN_SCAN_PNO |
| 532 | |
| 533 | #ifdef WLAN_WAKEUP_EVENTS |
| 534 | WDI_ProcessWakeReasonInd, /* WDI_WAKE_REASON_IND */ |
| 535 | #else // WLAN_WAKEUP_EVENTS |
| 536 | NULL, |
| 537 | #endif // WLAN_WAKEUP_EVENTS |
| 538 | |
| 539 | WDI_ProcessTxPerHitInd, /* WDI_HAL_TX_PER_HIT_IND */ |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 540 | |
| 541 | #ifdef WLAN_FEATURE_P2P |
| 542 | WDI_ProcessP2pNoaStartInd, /* WDI_NOA_START_IND */ |
| 543 | #else |
| 544 | NULL, |
| 545 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 546 | }; |
| 547 | |
| 548 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 549 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 550 | WLAN DAL Global Control Block |
| 551 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 552 | WDI_ControlBlockType gWDICb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 553 | static wpt_uint8 gWDIInitialized = eWLAN_PAL_FALSE; |
| 554 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 555 | const wpt_uint8 szTransportChName[] = "WLAN_CTRL"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 556 | |
| 557 | /*Helper routine for retrieving the PAL Context from WDI*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 558 | WPT_INLINE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 559 | void* WDI_GET_PAL_CTX( void ) |
| 560 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 561 | return gWDICb.pPALContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 562 | }/*WDI_GET_PAL_CTX*/ |
| 563 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 564 | /*============================================================================ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 565 | Helper inline converters |
| 566 | ============================================================================*/ |
| 567 | /*Convert WDI driver type into HAL driver type*/ |
| 568 | WPT_STATIC WPT_INLINE WDI_Status |
| 569 | WDI_HAL_2_WDI_STATUS |
| 570 | ( |
| 571 | eHalStatus halStatus |
| 572 | ); |
| 573 | |
| 574 | /*Convert WDI request type into HAL request type*/ |
| 575 | WPT_STATIC WPT_INLINE tHalHostMsgType |
| 576 | WDI_2_HAL_REQ_TYPE |
| 577 | ( |
| 578 | WDI_RequestEnumType wdiReqType |
| 579 | ); |
| 580 | |
| 581 | /*Convert WDI response type into HAL response type*/ |
| 582 | WPT_STATIC WPT_INLINE WDI_ResponseEnumType |
| 583 | HAL_2_WDI_RSP_TYPE |
| 584 | ( |
| 585 | tHalHostMsgType halMsg |
| 586 | ); |
| 587 | |
| 588 | /*Convert WDI driver type into HAL driver type*/ |
| 589 | WPT_STATIC WPT_INLINE tDriverType |
| 590 | WDI_2_HAL_DRV_TYPE |
| 591 | ( |
| 592 | WDI_DriverType wdiDriverType |
| 593 | ); |
| 594 | |
| 595 | /*Convert WDI stop reason into HAL stop reason*/ |
| 596 | WPT_STATIC WPT_INLINE tHalStopType |
| 597 | WDI_2_HAL_STOP_REASON |
| 598 | ( |
| 599 | WDI_StopType wdiStopType |
| 600 | ); |
| 601 | |
| 602 | /*Convert WDI scan mode type into HAL scan mode type*/ |
| 603 | WPT_STATIC WPT_INLINE eHalSysMode |
| 604 | WDI_2_HAL_SCAN_MODE |
| 605 | ( |
| 606 | WDI_ScanMode wdiScanMode |
| 607 | ); |
| 608 | |
| 609 | /*Convert WDI sec ch offset into HAL sec ch offset type*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 610 | WPT_STATIC WPT_INLINE ePhyChanBondState |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 611 | WDI_2_HAL_SEC_CH_OFFSET |
| 612 | ( |
| 613 | WDI_HTSecondaryChannelOffset wdiSecChOffset |
| 614 | ); |
| 615 | |
| 616 | /*Convert WDI BSS type into HAL BSS type*/ |
| 617 | WPT_STATIC WPT_INLINE tSirBssType |
| 618 | WDI_2_HAL_BSS_TYPE |
| 619 | ( |
| 620 | WDI_BssType wdiBSSType |
| 621 | ); |
| 622 | |
| 623 | /*Convert WDI NW type into HAL NW type*/ |
| 624 | WPT_STATIC WPT_INLINE tSirNwType |
| 625 | WDI_2_HAL_NW_TYPE |
| 626 | ( |
| 627 | WDI_NwType wdiNWType |
| 628 | ); |
| 629 | |
| 630 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 631 | WPT_STATIC WPT_INLINE ePhyChanBondState |
| 632 | WDI_2_HAL_CB_STATE |
| 633 | ( |
| 634 | WDI_PhyChanBondState wdiCbState |
| 635 | ); |
| 636 | |
| 637 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 638 | WPT_STATIC WPT_INLINE tSirMacHTOperatingMode |
| 639 | WDI_2_HAL_HT_OPER_MODE |
| 640 | ( |
| 641 | WDI_HTOperatingMode wdiHTOperMode |
| 642 | ); |
| 643 | |
| 644 | /*Convert WDI mimo PS type into HAL mimo PS type*/ |
| 645 | WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState |
| 646 | WDI_2_HAL_MIMO_PS |
| 647 | ( |
| 648 | WDI_HTMIMOPowerSaveState wdiHTOperMode |
| 649 | ); |
| 650 | |
| 651 | /*Convert WDI ENC type into HAL ENC type*/ |
| 652 | WPT_STATIC WPT_INLINE tAniEdType |
| 653 | WDI_2_HAL_ENC_TYPE |
| 654 | ( |
| 655 | WDI_EncryptType wdiEncType |
| 656 | ); |
| 657 | |
| 658 | /*Convert WDI WEP type into HAL WEP type*/ |
| 659 | WPT_STATIC WPT_INLINE tAniWepType |
| 660 | WDI_2_HAL_WEP_TYPE |
| 661 | ( |
| 662 | WDI_WepType wdiWEPType |
| 663 | ); |
| 664 | |
| 665 | /*Convert WDI Link State into HAL Link State*/ |
| 666 | WPT_STATIC WPT_INLINE tSirLinkState |
| 667 | WDI_2_HAL_LINK_STATE |
| 668 | ( |
| 669 | WDI_LinkStateType wdiLinkState |
| 670 | ); |
| 671 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 672 | /*Translate a STA Context from WDI into HAL*/ |
| 673 | WPT_STATIC WPT_INLINE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 674 | void |
| 675 | WDI_CopyWDIStaCtxToHALStaCtx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 676 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 677 | tConfigStaParams* phalConfigSta, |
| 678 | WDI_ConfigStaReqInfoType* pwdiConfigSta |
| 679 | ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 680 | |
| 681 | /*Translate a Rate set info from WDI into HAL*/ |
| 682 | WPT_STATIC WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 683 | WDI_CopyWDIRateSetToHALRateSet |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 684 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 685 | tSirMacRateSet* pHalRateSet, |
| 686 | WDI_RateSet* pwdiRateSet |
| 687 | ); |
| 688 | |
| 689 | /*Translate an EDCA Parameter Record from WDI into HAL*/ |
| 690 | WPT_STATIC WPT_INLINE void |
| 691 | WDI_CopyWDIEDCAParamsToHALEDCAParams |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 692 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 693 | tSirMacEdcaParamRecord* phalEdcaParam, |
| 694 | WDI_EdcaParamRecord* pWDIEdcaParam |
| 695 | ); |
| 696 | |
| 697 | /*Copy a management frame header from WDI fmt into HAL fmt*/ |
| 698 | WPT_STATIC WPT_INLINE void |
| 699 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr |
| 700 | ( |
| 701 | tSirMacMgmtHdr* pmacMgmtHdr, |
| 702 | WDI_MacMgmtHdr* pwdiMacMgmtHdr |
| 703 | ); |
| 704 | |
| 705 | /*Copy config bss parameters from WDI fmt into HAL fmt*/ |
| 706 | WPT_STATIC WPT_INLINE void |
| 707 | WDI_CopyWDIConfigBSSToHALConfigBSS |
| 708 | ( |
| 709 | tConfigBssParams* phalConfigBSS, |
| 710 | WDI_ConfigBSSReqInfoType* pwdiConfigBSS |
| 711 | ); |
| 712 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 713 | /*Extract the request CB function and user data from a request structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 714 | pointed to by user data */ |
| 715 | WPT_STATIC WPT_INLINE void |
| 716 | WDI_ExtractRequestCBFromEvent |
| 717 | ( |
| 718 | WDI_EventInfoType* pEvent, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 719 | WDI_ReqStatusCb* ppfnReqCB, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 720 | void** ppUserData |
| 721 | ); |
| 722 | |
| 723 | wpt_uint8 |
| 724 | WDI_FindEmptySession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 725 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 726 | WDI_ControlBlockType* pWDICtx, |
| 727 | WDI_BSSSessionType** ppSession |
| 728 | ); |
| 729 | |
| 730 | void |
| 731 | WDI_AddBcastSTAtoSTATable |
| 732 | ( |
| 733 | WDI_ControlBlockType* pWDICtx, |
| 734 | WDI_AddStaParams * staParams, |
| 735 | wpt_uint16 usBcastStaIdx |
| 736 | ); |
| 737 | |
| 738 | WDI_Status WDI_SendNvBlobReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 739 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 740 | WDI_ControlBlockType* pWDICtx, |
| 741 | WDI_EventInfoType* pEventData |
| 742 | ); |
| 743 | |
| 744 | void |
| 745 | WDI_SetPowerStateCb |
| 746 | ( |
| 747 | wpt_status status, |
| 748 | unsigned int dxePhyAddr, |
| 749 | void *pContext |
| 750 | ); |
| 751 | |
| 752 | #define CASE_RETURN_STRING( str ) \ |
| 753 | case ( ( str ) ): return( #str ); break \ |
| 754 | |
| 755 | /** |
| 756 | @brief WDI_getReqMsgString prints the WDI request message in string. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 757 | |
| 758 | @param wdiReqMsgId: WDI Message request Id |
| 759 | |
| 760 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 761 | @return Result of the function call |
| 762 | */ |
| 763 | static char *WDI_getReqMsgString(wpt_uint16 wdiReqMsgId) |
| 764 | { |
| 765 | switch (wdiReqMsgId) |
| 766 | { |
| 767 | CASE_RETURN_STRING( WDI_START_REQ ); |
| 768 | CASE_RETURN_STRING( WDI_STOP_REQ ); |
| 769 | CASE_RETURN_STRING( WDI_CLOSE_REQ ); |
| 770 | CASE_RETURN_STRING( WDI_INIT_SCAN_REQ ); |
| 771 | CASE_RETURN_STRING( WDI_START_SCAN_REQ ); |
| 772 | CASE_RETURN_STRING( WDI_END_SCAN_REQ ); |
| 773 | CASE_RETURN_STRING( WDI_FINISH_SCAN_REQ ); |
| 774 | CASE_RETURN_STRING( WDI_JOIN_REQ ); |
| 775 | CASE_RETURN_STRING( WDI_CONFIG_BSS_REQ ); |
| 776 | CASE_RETURN_STRING( WDI_DEL_BSS_REQ ); |
| 777 | CASE_RETURN_STRING( WDI_POST_ASSOC_REQ ); |
| 778 | CASE_RETURN_STRING( WDI_DEL_STA_REQ ); |
| 779 | CASE_RETURN_STRING( WDI_SET_BSS_KEY_REQ ); |
| 780 | CASE_RETURN_STRING( WDI_RMV_BSS_KEY_REQ ); |
| 781 | CASE_RETURN_STRING( WDI_SET_STA_KEY_REQ ); |
| 782 | CASE_RETURN_STRING( WDI_RMV_STA_KEY_REQ ); |
| 783 | CASE_RETURN_STRING( WDI_ADD_TS_REQ ); |
| 784 | CASE_RETURN_STRING( WDI_DEL_TS_REQ ); |
| 785 | CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_REQ ); |
| 786 | CASE_RETURN_STRING( WDI_ADD_BA_SESSION_REQ ); |
| 787 | CASE_RETURN_STRING( WDI_DEL_BA_REQ ); |
| 788 | CASE_RETURN_STRING( WDI_CH_SWITCH_REQ ); |
| 789 | CASE_RETURN_STRING( WDI_CONFIG_STA_REQ ); |
| 790 | CASE_RETURN_STRING( WDI_SET_LINK_ST_REQ ); |
| 791 | CASE_RETURN_STRING( WDI_GET_STATS_REQ ); |
| 792 | CASE_RETURN_STRING( WDI_UPDATE_CFG_REQ ); |
| 793 | CASE_RETURN_STRING( WDI_ADD_BA_REQ ); |
| 794 | CASE_RETURN_STRING( WDI_TRIGGER_BA_REQ ); |
| 795 | CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_REQ ); |
| 796 | CASE_RETURN_STRING( WDI_SND_BCON_REQ ); |
| 797 | CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_REQ ); |
| 798 | CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_REQ ); |
| 799 | CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_REQ ); |
| 800 | CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_REQ ); |
| 801 | CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ ); |
| 802 | CASE_RETURN_STRING( WDI_ENTER_IMPS_REQ ); |
| 803 | CASE_RETURN_STRING( WDI_EXIT_IMPS_REQ ); |
| 804 | CASE_RETURN_STRING( WDI_ENTER_BMPS_REQ ); |
| 805 | CASE_RETURN_STRING( WDI_EXIT_BMPS_REQ ); |
| 806 | CASE_RETURN_STRING( WDI_ENTER_UAPSD_REQ ); |
| 807 | CASE_RETURN_STRING( WDI_EXIT_UAPSD_REQ ); |
| 808 | CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_REQ ); |
| 809 | CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_REQ ); |
| 810 | CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_REQ ); |
| 811 | CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_REQ); |
| 812 | CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_REQ ); |
| 813 | CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_REQ ); |
| 814 | CASE_RETURN_STRING( WDI_HOST_OFFLOAD_REQ ); |
| 815 | CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_REQ ); |
| 816 | CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_REQ ); |
| 817 | CASE_RETURN_STRING( WDI_WOWL_ENTER_REQ ); |
| 818 | CASE_RETURN_STRING( WDI_WOWL_EXIT_REQ ); |
| 819 | CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ ); |
| 820 | CASE_RETURN_STRING( WDI_NV_DOWNLOAD_REQ ); |
| 821 | CASE_RETURN_STRING( WDI_FLUSH_AC_REQ ); |
| 822 | CASE_RETURN_STRING( WDI_BTAMP_EVENT_REQ ); |
| 823 | CASE_RETURN_STRING( WDI_AGGR_ADD_TS_REQ ); |
| 824 | CASE_RETURN_STRING( WDI_ADD_STA_SELF_REQ ); |
| 825 | CASE_RETURN_STRING( WDI_DEL_STA_SELF_REQ ); |
| 826 | CASE_RETURN_STRING( WDI_FTM_CMD_REQ ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 827 | CASE_RETURN_STRING( WDI_START_OEM_DATA_REQ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 828 | CASE_RETURN_STRING( WDI_HOST_RESUME_REQ ); |
| 829 | CASE_RETURN_STRING( WDI_KEEP_ALIVE_REQ); |
| 830 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 831 | CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_REQ ); |
| 832 | CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_REQ ); |
| 833 | CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_REQ ); |
| 834 | #endif |
| 835 | CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_REQ ); |
| 836 | CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_REQ ); |
| 837 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_REQ ); |
| 838 | CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ ); |
| 839 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ ); |
| 840 | CASE_RETURN_STRING( WDI_INIT_SCAN_CON_REQ ); |
| 841 | CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_REQ ); |
| 842 | CASE_RETURN_STRING( WDI_SHUTDOWN_REQ ); |
| 843 | CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_REQ ); |
| 844 | default: |
| 845 | return "Unknown WDI MessageId"; |
| 846 | } |
| 847 | } |
| 848 | |
| 849 | |
| 850 | |
| 851 | /** |
| 852 | @brief WDI_getRespMsgString prints the WDI resonse message in string. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 853 | |
| 854 | @param wdiRespMsgId: WDI Message response Id |
| 855 | |
| 856 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 857 | @return Result of the function call |
| 858 | */ |
| 859 | static char *WDI_getRespMsgString(wpt_uint16 wdiRespMsgId) |
| 860 | { |
| 861 | switch (wdiRespMsgId) |
| 862 | { |
| 863 | CASE_RETURN_STRING( WDI_START_RESP ); |
| 864 | CASE_RETURN_STRING( WDI_STOP_RESP ); |
| 865 | CASE_RETURN_STRING( WDI_CLOSE_RESP ); |
| 866 | CASE_RETURN_STRING( WDI_INIT_SCAN_RESP ); |
| 867 | CASE_RETURN_STRING( WDI_START_SCAN_RESP ); |
| 868 | CASE_RETURN_STRING( WDI_END_SCAN_RESP ); |
| 869 | CASE_RETURN_STRING( WDI_FINISH_SCAN_RESP ); |
| 870 | CASE_RETURN_STRING( WDI_JOIN_RESP ); |
| 871 | CASE_RETURN_STRING( WDI_CONFIG_BSS_RESP ); |
| 872 | CASE_RETURN_STRING( WDI_DEL_BSS_RESP ); |
| 873 | CASE_RETURN_STRING( WDI_POST_ASSOC_RESP ); |
| 874 | CASE_RETURN_STRING( WDI_DEL_STA_RESP ); |
| 875 | CASE_RETURN_STRING( WDI_SET_BSS_KEY_RESP ); |
| 876 | CASE_RETURN_STRING( WDI_RMV_BSS_KEY_RESP ); |
| 877 | CASE_RETURN_STRING( WDI_SET_STA_KEY_RESP ); |
| 878 | CASE_RETURN_STRING( WDI_RMV_STA_KEY_RESP ); |
| 879 | CASE_RETURN_STRING( WDI_ADD_TS_RESP ); |
| 880 | CASE_RETURN_STRING( WDI_DEL_TS_RESP ); |
| 881 | CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_RESP ); |
| 882 | CASE_RETURN_STRING( WDI_ADD_BA_SESSION_RESP ); |
| 883 | CASE_RETURN_STRING( WDI_DEL_BA_RESP ); |
| 884 | CASE_RETURN_STRING( WDI_CH_SWITCH_RESP ); |
| 885 | CASE_RETURN_STRING( WDI_CONFIG_STA_RESP ); |
| 886 | CASE_RETURN_STRING( WDI_SET_LINK_ST_RESP ); |
| 887 | CASE_RETURN_STRING( WDI_GET_STATS_RESP ); |
| 888 | CASE_RETURN_STRING( WDI_UPDATE_CFG_RESP ); |
| 889 | CASE_RETURN_STRING( WDI_ADD_BA_RESP ); |
| 890 | CASE_RETURN_STRING( WDI_TRIGGER_BA_RESP ); |
| 891 | CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_RESP ); |
| 892 | CASE_RETURN_STRING( WDI_SND_BCON_RESP ); |
| 893 | CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_RESP ); |
| 894 | CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_RESP ); |
| 895 | CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_RESP ); |
| 896 | CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_RESP ); |
| 897 | CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP ); |
| 898 | CASE_RETURN_STRING( WDI_ENTER_IMPS_RESP ); |
| 899 | CASE_RETURN_STRING( WDI_EXIT_IMPS_RESP ); |
| 900 | CASE_RETURN_STRING( WDI_ENTER_BMPS_RESP ); |
| 901 | CASE_RETURN_STRING( WDI_EXIT_BMPS_RESP ); |
| 902 | CASE_RETURN_STRING( WDI_ENTER_UAPSD_RESP ); |
| 903 | CASE_RETURN_STRING( WDI_EXIT_UAPSD_RESP ); |
| 904 | CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_RESP ); |
| 905 | CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_RESP ); |
| 906 | CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_RESP ); |
| 907 | CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_RESP); |
| 908 | CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_RESP ); |
| 909 | CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_RESP ); |
| 910 | CASE_RETURN_STRING( WDI_HOST_OFFLOAD_RESP ); |
| 911 | CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_RESP ); |
| 912 | CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_RESP ); |
| 913 | CASE_RETURN_STRING( WDI_WOWL_ENTER_RESP ); |
| 914 | CASE_RETURN_STRING( WDI_WOWL_EXIT_RESP ); |
| 915 | CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP ); |
| 916 | CASE_RETURN_STRING( WDI_NV_DOWNLOAD_RESP ); |
| 917 | CASE_RETURN_STRING( WDI_FLUSH_AC_RESP ); |
| 918 | CASE_RETURN_STRING( WDI_BTAMP_EVENT_RESP ); |
| 919 | CASE_RETURN_STRING( WDI_AGGR_ADD_TS_RESP ); |
| 920 | CASE_RETURN_STRING( WDI_ADD_STA_SELF_RESP ); |
| 921 | CASE_RETURN_STRING( WDI_DEL_STA_SELF_RESP ); |
| 922 | CASE_RETURN_STRING( WDI_FTM_CMD_RESP ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 923 | CASE_RETURN_STRING( WDI_START_OEM_DATA_RESP ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 924 | CASE_RETURN_STRING( WDI_HOST_RESUME_RESP ); |
| 925 | CASE_RETURN_STRING( WDI_KEEP_ALIVE_RESP); |
| 926 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 927 | CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_RESP ); |
| 928 | CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_RESP ); |
| 929 | CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_RESP ); |
| 930 | #endif |
| 931 | CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_RESP ); |
| 932 | CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_RESP ); |
| 933 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_RESP ); |
| 934 | CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP ); |
| 935 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP ); |
| 936 | CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_RESP ); |
| 937 | CASE_RETURN_STRING( WDI_SHUTDOWN_RESP ); |
| 938 | CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_RESP ); |
| 939 | default: |
| 940 | return "Unknown WDI MessageId"; |
| 941 | } |
| 942 | } |
| 943 | |
| 944 | /** |
| 945 | @brief WDI_getHALStatusMsgString prints the HAL status in string. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 946 | |
| 947 | @param halStatusId: HAL status Id |
| 948 | |
| 949 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 950 | @return Result of the function call |
| 951 | */ |
| 952 | static char *WDI_getHALStatusMsgString(wpt_uint16 halStatusId) |
| 953 | { |
| 954 | switch (halStatusId) |
| 955 | { |
| 956 | CASE_RETURN_STRING( eHAL_STATUS_SUCCESS ); |
| 957 | CASE_RETURN_STRING( PAL_STATUS_INVAL ); |
| 958 | CASE_RETURN_STRING( PAL_STATUS_ALREADY ); |
| 959 | CASE_RETURN_STRING( PAL_STATUS_EMPTY ); |
| 960 | CASE_RETURN_STRING( PAL_STATUS_FAILURE ); |
| 961 | CASE_RETURN_STRING( eHAL_STATUS_FAILURE ); |
| 962 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_PARAMETER ); |
| 963 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_STAIDX ); |
| 964 | CASE_RETURN_STRING( eHAL_STATUS_DPU_DESCRIPTOR_TABLE_FULL ); |
| 965 | CASE_RETURN_STRING( eHAL_STATUS_NO_INTERRUPTS ); |
| 966 | CASE_RETURN_STRING( eHAL_STATUS_INTERRUPT_PRESENT ); |
| 967 | CASE_RETURN_STRING( eHAL_STATUS_STA_TABLE_FULL ); |
| 968 | CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_STA ); |
| 969 | CASE_RETURN_STRING( eHAL_STATUS_BSSID_INVALID ); |
| 970 | CASE_RETURN_STRING( eHAL_STATUS_STA_INVALID ); |
| 971 | CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_BSSID ); |
| 972 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_BSSIDX ); |
| 973 | CASE_RETURN_STRING( eHAL_STATUS_BSSID_TABLE_FULL ); |
| 974 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_SIGNATURE ); |
| 975 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_KEYID ); |
| 976 | CASE_RETURN_STRING( eHAL_STATUS_SET_CHAN_ALREADY_ON_REQUESTED_CHAN ); |
| 977 | CASE_RETURN_STRING( eHAL_STATUS_UMA_DESCRIPTOR_TABLE_FULL ); |
| 978 | CASE_RETURN_STRING( eHAL_STATUS_DPU_MICKEY_TABLE_FULL ); |
| 979 | CASE_RETURN_STRING( eHAL_STATUS_BA_RX_BUFFERS_FULL ); |
| 980 | CASE_RETURN_STRING( eHAL_STATUS_BA_RX_MAX_SESSIONS_REACHED ); |
| 981 | CASE_RETURN_STRING( eHAL_STATUS_BA_RX_INVALID_SESSION_ID ); |
| 982 | CASE_RETURN_STRING( eHAL_STATUS_TIMER_START_FAILED ); |
| 983 | CASE_RETURN_STRING( eHAL_STATUS_TIMER_STOP_FAILED ); |
| 984 | CASE_RETURN_STRING( eHAL_STATUS_FAILED_ALLOC ); |
| 985 | CASE_RETURN_STRING( eHAL_STATUS_NOTIFY_BSS_FAIL ); |
| 986 | CASE_RETURN_STRING( eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO ); |
| 987 | CASE_RETURN_STRING( eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO ); |
| 988 | CASE_RETURN_STRING( eHAL_STATUS_FW_SEND_MSG_FAILED ); |
| 989 | default: |
| 990 | return "Unknown HAL status"; |
| 991 | } |
| 992 | } |
| 993 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 994 | /*======================================================================== |
| 995 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 996 | INITIALIZATION APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 997 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 998 | ==========================================================================*/ |
| 999 | |
| 1000 | /** |
| 1001 | @brief WDI_Init is used to initialize the DAL. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1002 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1003 | DAL will allocate all the resources it needs. It will open PAL, it will also |
| 1004 | 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] | 1005 | DXE/SMD or any other drivers that they need. |
| 1006 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1007 | @param pOSContext: pointer to the OS context provided by the UMAC |
| 1008 | will be passed on to PAL on Open |
| 1009 | ppWDIGlobalCtx: output pointer of Global Context |
| 1010 | pWdiDevCapability: output pointer of device capability |
| 1011 | |
| 1012 | @return Result of the function call |
| 1013 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1014 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1015 | WDI_Init |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1016 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1017 | void* pOSContext, |
| 1018 | void** ppWDIGlobalCtx, |
| 1019 | WDI_DeviceCapabilityType* pWdiDevCapability, |
| 1020 | unsigned int driverType |
| 1021 | ) |
| 1022 | { |
| 1023 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1024 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1025 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1026 | WCTS_TransportCBsType wctsCBs; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1027 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 1028 | |
| 1029 | /*--------------------------------------------------------------------- |
| 1030 | Sanity check |
| 1031 | ---------------------------------------------------------------------*/ |
| 1032 | if (( NULL == ppWDIGlobalCtx ) || ( NULL == pWdiDevCapability )) |
| 1033 | { |
| 1034 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1035 | "Invalid input parameters in WDI_Init"); |
| 1036 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1037 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1038 | } |
| 1039 | |
| 1040 | /*--------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1041 | Check to see if the module has already been initialized or not |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1042 | ---------------------------------------------------------------------*/ |
| 1043 | if ( eWLAN_PAL_FALSE != gWDIInitialized ) |
| 1044 | { |
| 1045 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1046 | "WDI module already initialized - return"); |
| 1047 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1048 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1049 | } |
| 1050 | |
| 1051 | /*Module is now initialized - this flag is to ensure the fact that multiple |
| 1052 | init will not happen on WDI |
| 1053 | !! - potential race does exist because read and set are not atomic, |
| 1054 | however an atomic operation would be closely here - reanalyze if necessary*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1055 | gWDIInitialized = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1056 | |
| 1057 | /*Setup the control block */ |
| 1058 | WDI_CleanCB(&gWDICb); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1059 | gWDICb.pOSContext = pOSContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1060 | |
| 1061 | /*Setup the STA Table*/ |
| 1062 | wdiStatus = WDI_STATableInit(&gWDICb); |
| 1063 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 1064 | { |
| 1065 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1066 | "%s: Failure while initializing STA Table, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1067 | __func__, wdiStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1068 | goto fail_STATableInit; |
| 1069 | } |
| 1070 | |
| 1071 | /*------------------------------------------------------------------------ |
| 1072 | Open the PAL |
| 1073 | ------------------------------------------------------------------------*/ |
| 1074 | wptStatus = wpalOpen(&gWDICb.pPALContext, pOSContext); |
| 1075 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1076 | { |
| 1077 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1078 | "%s: Failed to open PAL, 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_wpalOpen; |
| 1081 | } |
| 1082 | |
| 1083 | /*Initialize main synchro mutex - it will be used to ensure integrity of |
| 1084 | the main WDI Control Block*/ |
| 1085 | wptStatus = wpalMutexInit(&gWDICb.wptMutex); |
| 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 mutex, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1090 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1091 | goto fail_mutex; |
| 1092 | } |
| 1093 | |
| 1094 | /*Initialize the response timer - it will be used to time all messages |
| 1095 | expected as response from device*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1096 | wptStatus = wpalTimerInit( &gWDICb.wptResponseTimer, |
| 1097 | WDI_ResponseTimerCB, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1098 | &gWDICb); |
| 1099 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1100 | { |
| 1101 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1102 | "%s: Failed to init response timer, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1103 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1104 | goto fail_timer; |
| 1105 | } |
| 1106 | |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1107 | wptStatus = wpalTimerInit( &gWDICb.ssrTimer, |
| 1108 | WDI_SsrTimerCB, |
| 1109 | &gWDICb); |
| 1110 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1111 | { |
| 1112 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1113 | "%s: Failed to init SSR timer, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1114 | __func__, wptStatus); |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1115 | goto fail_timer2; |
| 1116 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1117 | /* Initialize the WDI Pending Request Queue*/ |
| 1118 | wptStatus = wpal_list_init(&(gWDICb.wptPendingQueue)); |
| 1119 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1120 | { |
| 1121 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1122 | "%s: Failed to init pending request queue, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1123 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1124 | goto fail_pend_queue; |
| 1125 | } |
| 1126 | |
| 1127 | /*Init WDI Pending Assoc Id Queue */ |
| 1128 | wptStatus = wpal_list_init(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1129 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1130 | { |
| 1131 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1132 | "%s: Failed to init assoc session queue, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1133 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1134 | goto fail_assoc_queue; |
| 1135 | } |
| 1136 | |
| 1137 | /*Initialize the BSS sessions pending Queue */ |
| 1138 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1139 | { |
| 1140 | wptStatus = wpal_list_init(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1141 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1142 | { |
| 1143 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1144 | "%s: Failed to init BSS %d pending queue, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1145 | __func__, i, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1146 | goto fail_bss_queue; |
| 1147 | } |
| 1148 | } |
| 1149 | |
| 1150 | /*Indicate the control block is sufficiently initialized for callbacks*/ |
| 1151 | gWDICb.magic = WDI_CONTROL_BLOCK_MAGIC; |
| 1152 | |
| 1153 | /*------------------------------------------------------------------------ |
| 1154 | Initialize the Data Path Utility Module |
| 1155 | ------------------------------------------------------------------------*/ |
| 1156 | wdiStatus = WDI_DP_UtilsInit(&gWDICb); |
| 1157 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 1158 | { |
| 1159 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1160 | "%s: Failed to initialize the DP Util Module, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1161 | __func__, wdiStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1162 | goto fail_dp_util_init; |
| 1163 | } |
| 1164 | |
| 1165 | /* Init Set power state event */ |
| 1166 | wptStatus = wpalEventInit(&gWDICb.setPowerStateEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1167 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1168 | { |
| 1169 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1170 | "%s: Failed to initialize power state event, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1171 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1172 | goto fail_power_event; |
| 1173 | } |
| 1174 | |
| 1175 | /* Init WCTS action event */ |
| 1176 | wptStatus = wpalEventInit(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1177 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1178 | { |
| 1179 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1180 | "%s: Failed to initialize WCTS action event, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1181 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1182 | goto fail_wcts_event; |
| 1183 | } |
| 1184 | |
| 1185 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1186 | Open the Transport Services for Control and Data |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1187 | ------------------------------------------------------------------------*/ |
| 1188 | wctsCBs.wctsNotifyCB = WDI_NotifyMsgCTSCB; |
| 1189 | wctsCBs.wctsNotifyCBData = &gWDICb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1190 | wctsCBs.wctsRxMsgCB = WDI_RXMsgCTSCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1191 | wctsCBs.wctsRxMsgCBData = &gWDICb; |
| 1192 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1193 | gWDICb.bCTOpened = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1194 | gWDICb.wctsHandle = WCTS_OpenTransport( szTransportChName , |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1195 | WDI_CT_CHANNEL_SIZE, |
| 1196 | &wctsCBs ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1197 | |
| 1198 | if ( NULL == gWDICb.wctsHandle ) |
| 1199 | { |
| 1200 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1201 | "%s: Failed to open WCTS transport", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1202 | goto fail_wcts_open; |
| 1203 | } |
| 1204 | |
| 1205 | gWDICb.driverMode = (tDriverType)driverType; |
| 1206 | /* FTM mode not need to open Transport Driver */ |
| 1207 | if(eDRIVER_TYPE_MFG != (tDriverType)driverType) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1208 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1209 | /*------------------------------------------------------------------------ |
| 1210 | Open the Data Transport |
| 1211 | ------------------------------------------------------------------------*/ |
| 1212 | if(eWLAN_PAL_STATUS_SUCCESS != WDTS_openTransport(&gWDICb)) |
| 1213 | { |
| 1214 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1215 | "%s: Failed to open the DT Transport", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1216 | goto fail_wdts_open; |
| 1217 | } |
| 1218 | } |
| 1219 | |
| 1220 | /*The WDI is initialized - set state to init */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1221 | gWDICb.uGlobalState = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1222 | |
| 1223 | /*Send the context as a ptr to the global WDI Control Block*/ |
| 1224 | *ppWDIGlobalCtx = &gWDICb; |
| 1225 | |
| 1226 | /*Fill in the device capabilities*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1227 | pWdiDevCapability->bFrameXtlSupported = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1228 | pWdiDevCapability->ucMaxSTASupported = gWDICb.ucMaxStations; |
| 1229 | pWdiDevCapability->ucMaxBSSSupported = gWDICb.ucMaxBssids; |
| 1230 | return WDI_STATUS_SUCCESS; |
| 1231 | |
| 1232 | /* ERROR handlers |
| 1233 | Undo everything that completed successfully */ |
| 1234 | |
| 1235 | fail_wdts_open: |
| 1236 | { |
| 1237 | wpt_status eventStatus; |
| 1238 | |
| 1239 | /* Closing WCTS in this scenario is tricky since it has to close |
| 1240 | the SMD channel and then we get notified asynchronously when |
| 1241 | the channel has been closed. So we take some of the logic from |
| 1242 | the "normal" close procedure in WDI_Close() |
| 1243 | */ |
| 1244 | |
| 1245 | eventStatus = wpalEventReset(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1246 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1247 | { |
| 1248 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1249 | "%s: Failed to reset WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1250 | } |
| 1251 | |
| 1252 | WCTS_CloseTransport(gWDICb.wctsHandle); |
| 1253 | |
| 1254 | /* Wait for WCTS to close the control transport. If we were able |
| 1255 | to reset the event flag, then we'll wait for the event, |
| 1256 | otherwise we'll wait for a maximum amount of time required for |
| 1257 | the channel to be closed */ |
| 1258 | if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus ) |
| 1259 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1260 | eventStatus = wpalEventWait(&gWDICb.wctsActionEvent, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1261 | WDI_WCTS_ACTION_TIMEOUT); |
| 1262 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
| 1263 | { |
| 1264 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1265 | "%s: Failed to wait on WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1266 | } |
| 1267 | } |
| 1268 | else |
| 1269 | { |
| 1270 | wpalSleep(WDI_WCTS_ACTION_TIMEOUT); |
| 1271 | } |
| 1272 | } |
| 1273 | fail_wcts_open: |
| 1274 | wpalEventDelete(&gWDICb.wctsActionEvent); |
| 1275 | fail_wcts_event: |
| 1276 | wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1277 | fail_power_event: |
| 1278 | WDI_DP_UtilsExit(&gWDICb); |
| 1279 | fail_dp_util_init: |
| 1280 | gWDICb.magic = 0; |
| 1281 | fail_bss_queue: |
| 1282 | /* entries 0 thru i-1 were successfully initialized */ |
| 1283 | while (0 < i) |
| 1284 | { |
| 1285 | i--; |
| 1286 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1287 | } |
| 1288 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1289 | fail_assoc_queue: |
| 1290 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
| 1291 | fail_pend_queue: |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1292 | wpalTimerDelete(&gWDICb.ssrTimer); |
| 1293 | fail_timer2: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1294 | wpalTimerDelete(&gWDICb.wptResponseTimer); |
| 1295 | fail_timer: |
| 1296 | wpalMutexDelete(&gWDICb.wptMutex); |
| 1297 | fail_mutex: |
| 1298 | wpalClose(gWDICb.pPALContext); |
| 1299 | fail_wpalOpen: |
| 1300 | WDI_STATableClose(&gWDICb); |
| 1301 | fail_STATableInit: |
| 1302 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 1303 | |
| 1304 | return WDI_STATUS_E_FAILURE; |
| 1305 | |
| 1306 | }/*WDI_Init*/; |
| 1307 | |
| 1308 | /** |
| 1309 | @brief WDI_Start will be called when the upper MAC is ready to |
| 1310 | commence operation with the WLAN Device. Upon the call |
| 1311 | of this API the WLAN DAL will pack and send a HAL Start |
| 1312 | message to the lower RIVA sub-system if the SMD channel |
| 1313 | has been fully opened and the RIVA subsystem is up. |
| 1314 | |
| 1315 | If the RIVA sub-system is not yet up and running DAL |
| 1316 | will queue the request for Open and will wait for the |
| 1317 | SMD notification before attempting to send down the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1318 | message to HAL. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1319 | |
| 1320 | WDI_Init must have been called. |
| 1321 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1322 | @param wdiStartParams: the start parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1323 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1324 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1325 | wdiStartRspCb: callback for passing back the response of |
| 1326 | the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1327 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1328 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1329 | callback |
| 1330 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1331 | @see WDI_Start |
| 1332 | @return Result of the function call |
| 1333 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1334 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1335 | WDI_Start |
| 1336 | ( |
| 1337 | WDI_StartReqParamsType* pwdiStartParams, |
| 1338 | WDI_StartRspCb wdiStartRspCb, |
| 1339 | void* pUserData |
| 1340 | ) |
| 1341 | { |
| 1342 | WDI_EventInfoType wdiEventData; |
| 1343 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1344 | |
| 1345 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1346 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1347 | ------------------------------------------------------------------------*/ |
| 1348 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1349 | { |
| 1350 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1351 | "WDI API call before module is initialized - Fail request"); |
| 1352 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1353 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1354 | } |
| 1355 | |
| 1356 | /*------------------------------------------------------------------------ |
| 1357 | Fill in Event data and post to the Main FSM |
| 1358 | ------------------------------------------------------------------------*/ |
| 1359 | wdiEventData.wdiRequest = WDI_START_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1360 | wdiEventData.pEventData = pwdiStartParams; |
| 1361 | wdiEventData.uEventDataSize = sizeof(*pwdiStartParams); |
| 1362 | wdiEventData.pCBfnc = wdiStartRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1363 | wdiEventData.pUserData = pUserData; |
| 1364 | |
| 1365 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1366 | |
| 1367 | }/*WDI_Start*/ |
| 1368 | |
| 1369 | /** |
| 1370 | @brief WDI_Stop will be called when the upper MAC is ready to |
| 1371 | stop any operation with the WLAN Device. Upon the call |
| 1372 | of this API the WLAN DAL will pack and send a HAL Stop |
| 1373 | message to the lower RIVA sub-system if the DAL Core is |
| 1374 | in started state. |
| 1375 | |
| 1376 | In state BUSY this request will be queued. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1377 | |
| 1378 | Request will not be accepted in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1379 | |
| 1380 | WDI_Start must have been called. |
| 1381 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1382 | @param wdiStopParams: the stop parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1383 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1384 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1385 | wdiStopRspCb: callback for passing back the response of |
| 1386 | the stop operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1387 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1388 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1389 | callback |
| 1390 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1391 | @see WDI_Start |
| 1392 | @return Result of the function call |
| 1393 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1394 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1395 | WDI_Stop |
| 1396 | ( |
| 1397 | WDI_StopReqParamsType* pwdiStopParams, |
| 1398 | WDI_StopRspCb wdiStopRspCb, |
| 1399 | void* pUserData |
| 1400 | ) |
| 1401 | { |
| 1402 | WDI_EventInfoType wdiEventData; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1403 | WDI_ControlBlockType* pWDICtx = &gWDICb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1404 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1405 | |
| 1406 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1407 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1408 | ------------------------------------------------------------------------*/ |
| 1409 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1410 | { |
| 1411 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1412 | "WDI API call before module is initialized - Fail request"); |
| 1413 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1414 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1415 | } |
| 1416 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1417 | /*Access to the global state must be locked before cleaning */ |
| 1418 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 1419 | |
| 1420 | /*Clear all pending request*/ |
| 1421 | WDI_ClearPendingRequests(pWDICtx); |
| 1422 | |
| 1423 | /*We have completed cleaning unlock now*/ |
| 1424 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 1425 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1426 | /* Free the global variables */ |
| 1427 | wpalMemoryFree(gpHostWlanFeatCaps); |
| 1428 | wpalMemoryFree(gpFwWlanFeatCaps); |
Madan Mohan Koyyalamudi | 3352adb | 2012-09-28 14:57:24 -0700 | [diff] [blame] | 1429 | gpHostWlanFeatCaps = NULL; |
| 1430 | gpFwWlanFeatCaps = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1431 | |
| 1432 | /*------------------------------------------------------------------------ |
| 1433 | Fill in Event data and post to the Main FSM |
| 1434 | ------------------------------------------------------------------------*/ |
| 1435 | wdiEventData.wdiRequest = WDI_STOP_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1436 | wdiEventData.pEventData = pwdiStopParams; |
| 1437 | wdiEventData.uEventDataSize = sizeof(*pwdiStopParams); |
| 1438 | wdiEventData.pCBfnc = wdiStopRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1439 | wdiEventData.pUserData = pUserData; |
| 1440 | |
| 1441 | return WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, &wdiEventData); |
| 1442 | |
| 1443 | }/*WDI_Stop*/ |
| 1444 | |
| 1445 | |
| 1446 | |
| 1447 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1448 | @brief WDI_Close will be called when the upper MAC no longer |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1449 | needs to interact with DAL. DAL will free its control |
| 1450 | block. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1451 | |
| 1452 | It is only accepted in state STOPPED. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1453 | |
| 1454 | WDI_Stop must have been called. |
| 1455 | |
| 1456 | @param none |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1457 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1458 | @see WDI_Stop |
| 1459 | @return Result of the function call |
| 1460 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1461 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1462 | WDI_Close |
| 1463 | ( |
| 1464 | void |
| 1465 | ) |
| 1466 | { |
| 1467 | wpt_uint8 i; |
| 1468 | WDI_EventInfoType wdiEventData; |
| 1469 | wpt_status wptStatus; |
| 1470 | wpt_status eventStatus; |
| 1471 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1472 | |
| 1473 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1474 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1475 | ------------------------------------------------------------------------*/ |
| 1476 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1477 | { |
| 1478 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1479 | "WDI API call before module is initialized - Fail request"); |
| 1480 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1481 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1482 | } |
| 1483 | |
| 1484 | /*Reset WCTS action event prior to posting the WDI_CLOSE_REQ |
| 1485 | (the control transport will be closed by the FSM and we'll want |
| 1486 | to wait until that completes)*/ |
| 1487 | eventStatus = wpalEventReset(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1488 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1489 | { |
| 1490 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1491 | "%s: Failed to reset WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1492 | /* fall through and try to finish closing via the FSM */ |
| 1493 | } |
| 1494 | |
| 1495 | /*------------------------------------------------------------------------ |
| 1496 | Fill in Event data and post to the Main FSM |
| 1497 | ------------------------------------------------------------------------*/ |
| 1498 | wdiEventData.wdiRequest = WDI_CLOSE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1499 | wdiEventData.pEventData = NULL; |
| 1500 | wdiEventData.uEventDataSize = 0; |
| 1501 | wdiEventData.pCBfnc = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1502 | wdiEventData.pUserData = NULL; |
| 1503 | |
| 1504 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 1505 | |
| 1506 | wptStatus = WDI_PostMainEvent(&gWDICb, WDI_CLOSE_EVENT, &wdiEventData); |
| 1507 | |
| 1508 | /*Wait for WCTS to close the control transport |
| 1509 | (but only if we were able to reset the event flag*/ |
| 1510 | if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus ) |
| 1511 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1512 | eventStatus = wpalEventWait(&gWDICb.wctsActionEvent, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1513 | WDI_WCTS_ACTION_TIMEOUT); |
| 1514 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
| 1515 | { |
| 1516 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1517 | "%s: Failed to wait on WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1518 | } |
| 1519 | } |
| 1520 | |
| 1521 | /* Destroy the WCTS action event */ |
| 1522 | wptStatus = wpalEventDelete(&gWDICb.wctsActionEvent); |
| 1523 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1524 | { |
| 1525 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1526 | "WDI Close failed to destroy an event"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1527 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1528 | } |
| 1529 | |
| 1530 | /* Destroy the Set Power State event */ |
| 1531 | wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1532 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1533 | { |
| 1534 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1535 | "WDI Close failed to destroy an event"); |
| 1536 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1537 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1538 | } |
| 1539 | |
| 1540 | /*------------------------------------------------------------------------ |
| 1541 | Closes the Data Path Utility Module |
| 1542 | ------------------------------------------------------------------------*/ |
| 1543 | if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb)) |
| 1544 | { |
| 1545 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1546 | "WDI Init failed to close the DP Util Module"); |
| 1547 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1548 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1549 | } |
| 1550 | |
| 1551 | /*destroy the BSS sessions pending Queue */ |
| 1552 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1553 | { |
| 1554 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1555 | } |
| 1556 | |
| 1557 | /* destroy the WDI Pending Assoc Id Request Queue*/ |
| 1558 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1559 | |
| 1560 | /* destroy the WDI Pending Request Queue*/ |
| 1561 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1562 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1563 | /*destroy the response timer */ |
| 1564 | wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer); |
| 1565 | |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1566 | /*destroy the SSR timer */ |
| 1567 | wptStatus = wpalTimerDelete( &gWDICb.ssrTimer); |
| 1568 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1569 | /*invalidate the main synchro mutex */ |
| 1570 | wptStatus = wpalMutexDelete(&gWDICb.wptMutex); |
| 1571 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1572 | { |
| 1573 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1574 | "Failed to delete mutex %d", wptStatus); |
| 1575 | WDI_ASSERT(0); |
| 1576 | } |
| 1577 | |
| 1578 | /*Clear control block. note that this will clear the "magic" |
| 1579 | which will inhibit all asynchronous callbacks*/ |
| 1580 | WDI_CleanCB(&gWDICb); |
| 1581 | |
| 1582 | return wptStatus; |
| 1583 | |
| 1584 | }/*WDI_Close*/ |
| 1585 | |
| 1586 | /** |
| 1587 | @brief WDI_Shutdown will be called during 'SSR shutdown' operation. |
| 1588 | This will do most of the WDI stop & close |
| 1589 | operations without doing any handshake with Riva |
| 1590 | |
| 1591 | This will also make sure that the control transport |
| 1592 | will NOT be closed. |
| 1593 | |
| 1594 | This request will not be queued. |
| 1595 | |
| 1596 | |
| 1597 | WDI_Start must have been called. |
| 1598 | |
| 1599 | @param closeTransport: Close control channel if this is set |
| 1600 | |
| 1601 | @return Result of the function call |
| 1602 | */ |
| 1603 | WDI_Status |
| 1604 | WDI_Shutdown |
| 1605 | ( |
| 1606 | wpt_boolean closeTransport |
| 1607 | ) |
| 1608 | { |
| 1609 | WDI_EventInfoType wdiEventData; |
| 1610 | wpt_status wptStatus; |
| 1611 | int i = 0; |
| 1612 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1613 | |
| 1614 | /*------------------------------------------------------------------------ |
| 1615 | Sanity Check |
| 1616 | ------------------------------------------------------------------------*/ |
| 1617 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1618 | { |
| 1619 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1620 | "WDI API call before module is initialized - Fail request"); |
| 1621 | |
| 1622 | return WDI_STATUS_E_NOT_ALLOWED; |
| 1623 | } |
| 1624 | |
| 1625 | /*------------------------------------------------------------------------ |
| 1626 | Fill in Event data and post to the Main FSM |
| 1627 | ------------------------------------------------------------------------*/ |
| 1628 | wdiEventData.wdiRequest = WDI_SHUTDOWN_REQ; |
| 1629 | wdiEventData.pEventData = NULL; |
| 1630 | wdiEventData.uEventDataSize = 0; |
| 1631 | |
| 1632 | /* Shutdown will not be queued, if the state is busy timer will be |
| 1633 | * stopped & this message will be processed.*/ |
| 1634 | wptStatus = WDI_PostMainEvent(&gWDICb, WDI_SHUTDOWN_EVENT, &wdiEventData); |
| 1635 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1636 | { |
| 1637 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1638 | "%s: Failed to process shutdown event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1639 | } |
| 1640 | /* Destroy the Set Power State event */ |
| 1641 | wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1642 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1643 | { |
| 1644 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1645 | "WDI Close failed to destroy an event"); |
| 1646 | |
| 1647 | WDI_ASSERT(0); |
| 1648 | } |
| 1649 | /*------------------------------------------------------------------------ |
| 1650 | Closes the Data Path Utility Module |
| 1651 | ------------------------------------------------------------------------*/ |
| 1652 | if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb)) |
| 1653 | { |
| 1654 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1655 | "WDI Init failed to close the DP Util Module"); |
| 1656 | |
| 1657 | WDI_ASSERT(0); |
| 1658 | } |
| 1659 | if ( closeTransport ) |
| 1660 | { |
| 1661 | /* Close control transport, called from module unload */ |
| 1662 | WCTS_CloseTransport(gWDICb.wctsHandle); |
| 1663 | } |
Madan Mohan Koyyalamudi | fab2a7e | 2012-09-28 15:20:00 -0700 | [diff] [blame] | 1664 | else |
| 1665 | { |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 1666 | /* Riva is crashed then SMD is already closed so cleaning all |
Madan Mohan Koyyalamudi | fab2a7e | 2012-09-28 15:20:00 -0700 | [diff] [blame] | 1667 | the pending messages in the transport queue */ |
| 1668 | WCTS_ClearPendingQueue(gWDICb.wctsHandle); |
| 1669 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1670 | /*destroy the BSS sessions pending Queue */ |
| 1671 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1672 | { |
| 1673 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1674 | } |
| 1675 | |
| 1676 | /* destroy the WDI Pending Assoc Id Request Queue*/ |
| 1677 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1678 | /* destroy the WDI Pending Request Queue*/ |
| 1679 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
| 1680 | /*destroy the response timer */ |
| 1681 | wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer); |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1682 | /*destroy the SSR timer */ |
| 1683 | wptStatus = wpalTimerDelete( &gWDICb.ssrTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1684 | |
| 1685 | /*invalidate the main synchro mutex */ |
| 1686 | wptStatus = wpalMutexDelete(&gWDICb.wptMutex); |
| 1687 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1688 | { |
| 1689 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1690 | "%s: Failed to delete mutex %d", __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1691 | WDI_ASSERT(0); |
| 1692 | } |
Madan Mohan Koyyalamudi | 3513bf5 | 2012-09-18 17:35:53 -0700 | [diff] [blame] | 1693 | /* Free the global variables */ |
| 1694 | wpalMemoryFree(gpHostWlanFeatCaps); |
| 1695 | wpalMemoryFree(gpFwWlanFeatCaps); |
Madan Mohan Koyyalamudi | 3352adb | 2012-09-28 14:57:24 -0700 | [diff] [blame] | 1696 | gpHostWlanFeatCaps = NULL; |
| 1697 | gpFwWlanFeatCaps = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1698 | /*Clear control block. note that this will clear the "magic" |
| 1699 | which will inhibit all asynchronous callbacks*/ |
| 1700 | WDI_CleanCB(&gWDICb); |
| 1701 | return wptStatus; |
| 1702 | |
| 1703 | }/*WDI_Shutdown*/ |
| 1704 | |
| 1705 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1706 | /*======================================================================== |
| 1707 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1708 | SCAN APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1709 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1710 | ==========================================================================*/ |
| 1711 | |
| 1712 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1713 | @brief WDI_InitScanReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1714 | the WLAN Device to get ready for a scan procedure. Upon |
| 1715 | the call of this API the WLAN DAL will pack and send a |
| 1716 | HAL Init Scan request message to the lower RIVA |
| 1717 | sub-system if DAL is in state STARTED. |
| 1718 | |
| 1719 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1720 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1721 | |
| 1722 | WDI_Start must have been called. |
| 1723 | |
| 1724 | @param wdiInitScanParams: the init scan parameters as specified |
| 1725 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1726 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1727 | wdiInitScanRspCb: callback for passing back the response |
| 1728 | of the init scan operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1729 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1730 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1731 | callback |
| 1732 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1733 | @see WDI_Start |
| 1734 | @return Result of the function call |
| 1735 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1736 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1737 | WDI_InitScanReq |
| 1738 | ( |
| 1739 | WDI_InitScanReqParamsType* pwdiInitScanParams, |
| 1740 | WDI_InitScanRspCb wdiInitScanRspCb, |
| 1741 | void* pUserData |
| 1742 | ) |
| 1743 | { |
| 1744 | WDI_EventInfoType wdiEventData; |
| 1745 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1746 | |
| 1747 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1748 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1749 | ------------------------------------------------------------------------*/ |
| 1750 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1751 | { |
| 1752 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1753 | "WDI API call before module is initialized - Fail request"); |
| 1754 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1755 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1756 | } |
| 1757 | |
| 1758 | /*------------------------------------------------------------------------ |
| 1759 | Fill in Event data and post to the Main FSM |
| 1760 | ------------------------------------------------------------------------*/ |
| 1761 | wdiEventData.wdiRequest = WDI_INIT_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1762 | wdiEventData.pEventData = pwdiInitScanParams; |
| 1763 | wdiEventData.uEventDataSize = sizeof(*pwdiInitScanParams); |
| 1764 | wdiEventData.pCBfnc = wdiInitScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1765 | wdiEventData.pUserData = pUserData; |
| 1766 | |
| 1767 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1768 | |
| 1769 | }/*WDI_InitScanReq*/ |
| 1770 | |
| 1771 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1772 | @brief WDI_StartScanReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1773 | wishes to change the Scan channel on the WLAN Device. |
| 1774 | Upon the call of this API the WLAN DAL will pack and |
| 1775 | send a HAL Start Scan request message to the lower RIVA |
| 1776 | sub-system if DAL is in state STARTED. |
| 1777 | |
| 1778 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1779 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1780 | |
| 1781 | WDI_InitScanReq must have been called. |
| 1782 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1783 | @param wdiStartScanParams: the start scan parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1784 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1785 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1786 | wdiStartScanRspCb: callback for passing back the |
| 1787 | response of the start scan operation received from the |
| 1788 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1789 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1790 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1791 | callback |
| 1792 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1793 | @see WDI_InitScanReq |
| 1794 | @return Result of the function call |
| 1795 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1796 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1797 | WDI_StartScanReq |
| 1798 | ( |
| 1799 | WDI_StartScanReqParamsType* pwdiStartScanParams, |
| 1800 | WDI_StartScanRspCb wdiStartScanRspCb, |
| 1801 | void* pUserData |
| 1802 | ) |
| 1803 | { |
| 1804 | WDI_EventInfoType wdiEventData; |
| 1805 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1806 | |
| 1807 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1808 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1809 | ------------------------------------------------------------------------*/ |
| 1810 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1811 | { |
| 1812 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1813 | "WDI API call before module is initialized - Fail request"); |
| 1814 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1815 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1816 | } |
| 1817 | |
| 1818 | /*------------------------------------------------------------------------ |
| 1819 | Fill in Event data and post to the Main FSM |
| 1820 | ------------------------------------------------------------------------*/ |
| 1821 | wdiEventData.wdiRequest = WDI_START_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1822 | wdiEventData.pEventData = pwdiStartScanParams; |
| 1823 | wdiEventData.uEventDataSize = sizeof(*pwdiStartScanParams); |
| 1824 | wdiEventData.pCBfnc = wdiStartScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1825 | wdiEventData.pUserData = pUserData; |
| 1826 | |
| 1827 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1828 | |
| 1829 | }/*WDI_StartScanReq*/ |
| 1830 | |
| 1831 | |
| 1832 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1833 | @brief WDI_EndScanReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1834 | wants to end scanning for a particular channel that it |
| 1835 | had set before by calling Scan Start on the WLAN Device. |
| 1836 | Upon the call of this API the WLAN DAL will pack and |
| 1837 | send a HAL End Scan request message to the lower RIVA |
| 1838 | sub-system if DAL is in state STARTED. |
| 1839 | |
| 1840 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1841 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1842 | |
| 1843 | WDI_StartScanReq must have been called. |
| 1844 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1845 | @param wdiEndScanParams: the end scan parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1846 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1847 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1848 | wdiEndScanRspCb: callback for passing back the response |
| 1849 | of the end scan operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1850 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1851 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1852 | callback |
| 1853 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1854 | @see WDI_StartScanReq |
| 1855 | @return Result of the function call |
| 1856 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1857 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1858 | WDI_EndScanReq |
| 1859 | ( |
| 1860 | WDI_EndScanReqParamsType* pwdiEndScanParams, |
| 1861 | WDI_EndScanRspCb wdiEndScanRspCb, |
| 1862 | void* pUserData |
| 1863 | ) |
| 1864 | { |
| 1865 | WDI_EventInfoType wdiEventData; |
| 1866 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1867 | |
| 1868 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1869 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1870 | ------------------------------------------------------------------------*/ |
| 1871 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1872 | { |
| 1873 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1874 | "WDI API call before module is initialized - Fail request"); |
| 1875 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1876 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1877 | } |
| 1878 | |
| 1879 | /*------------------------------------------------------------------------ |
| 1880 | Fill in Event data and post to the Main FSM |
| 1881 | ------------------------------------------------------------------------*/ |
| 1882 | wdiEventData.wdiRequest = WDI_END_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1883 | wdiEventData.pEventData = pwdiEndScanParams; |
| 1884 | wdiEventData.uEventDataSize = sizeof(*pwdiEndScanParams); |
| 1885 | wdiEventData.pCBfnc = wdiEndScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1886 | wdiEventData.pUserData = pUserData; |
| 1887 | |
| 1888 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1889 | |
| 1890 | }/*WDI_EndScanReq*/ |
| 1891 | |
| 1892 | |
| 1893 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1894 | @brief WDI_FinishScanReq will be called when the upper MAC has |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1895 | completed the scan process on the WLAN Device. Upon the |
| 1896 | call of this API the WLAN DAL will pack and send a HAL |
| 1897 | Finish Scan Request request message to the lower RIVA |
| 1898 | sub-system if DAL is in state STARTED. |
| 1899 | |
| 1900 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1901 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1902 | |
| 1903 | WDI_InitScanReq must have been called. |
| 1904 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1905 | @param wdiFinishScanParams: the finish scan parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1906 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1907 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1908 | wdiFinishScanRspCb: callback for passing back the |
| 1909 | response of the finish scan operation received from the |
| 1910 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1911 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1912 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1913 | callback |
| 1914 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1915 | @see WDI_InitScanReq |
| 1916 | @return Result of the function call |
| 1917 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1918 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1919 | WDI_FinishScanReq |
| 1920 | ( |
| 1921 | WDI_FinishScanReqParamsType* pwdiFinishScanParams, |
| 1922 | WDI_FinishScanRspCb wdiFinishScanRspCb, |
| 1923 | void* pUserData |
| 1924 | ) |
| 1925 | { |
| 1926 | WDI_EventInfoType wdiEventData; |
| 1927 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1928 | |
| 1929 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1930 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1931 | ------------------------------------------------------------------------*/ |
| 1932 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1933 | { |
| 1934 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1935 | "WDI API call before module is initialized - Fail request"); |
| 1936 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1937 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1938 | } |
| 1939 | |
| 1940 | /*------------------------------------------------------------------------ |
| 1941 | Fill in Event data and post to the Main FSM |
| 1942 | ------------------------------------------------------------------------*/ |
| 1943 | wdiEventData.wdiRequest = WDI_FINISH_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1944 | wdiEventData.pEventData = pwdiFinishScanParams; |
| 1945 | wdiEventData.uEventDataSize = sizeof(*pwdiFinishScanParams); |
| 1946 | wdiEventData.pCBfnc = wdiFinishScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1947 | wdiEventData.pUserData = pUserData; |
| 1948 | |
| 1949 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1950 | |
| 1951 | }/*WDI_FinishScanReq*/ |
| 1952 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1953 | /*======================================================================== |
| 1954 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1955 | ASSOCIATION APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1956 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1957 | ==========================================================================*/ |
| 1958 | |
| 1959 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1960 | @brief WDI_JoinReq will be called when the upper MAC is ready |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1961 | to start an association procedure to a BSS. Upon the |
| 1962 | call of this API the WLAN DAL will pack and send a HAL |
| 1963 | Join request message to the lower RIVA sub-system if |
| 1964 | DAL is in state STARTED. |
| 1965 | |
| 1966 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1967 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1968 | |
| 1969 | WDI_Start must have been called. |
| 1970 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1971 | @param wdiJoinParams: the join parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1972 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1973 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1974 | wdiJoinRspCb: callback for passing back the response of |
| 1975 | the join operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1976 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1977 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1978 | callback |
| 1979 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1980 | @see WDI_Start |
| 1981 | @return Result of the function call |
| 1982 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1983 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1984 | WDI_JoinReq |
| 1985 | ( |
| 1986 | WDI_JoinReqParamsType* pwdiJoinParams, |
| 1987 | WDI_JoinRspCb wdiJoinRspCb, |
| 1988 | void* pUserData |
| 1989 | ) |
| 1990 | { |
| 1991 | WDI_EventInfoType wdiEventData; |
| 1992 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1993 | |
| 1994 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1995 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1996 | ------------------------------------------------------------------------*/ |
| 1997 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1998 | { |
| 1999 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2000 | "WDI API call before module is initialized - Fail request"); |
| 2001 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2002 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2003 | } |
| 2004 | |
| 2005 | /*------------------------------------------------------------------------ |
| 2006 | Fill in Event data and post to the Main FSM |
| 2007 | ------------------------------------------------------------------------*/ |
| 2008 | wdiEventData.wdiRequest = WDI_JOIN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2009 | wdiEventData.pEventData = pwdiJoinParams; |
| 2010 | wdiEventData.uEventDataSize = sizeof(*pwdiJoinParams); |
| 2011 | wdiEventData.pCBfnc = wdiJoinRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2012 | wdiEventData.pUserData = pUserData; |
| 2013 | |
| 2014 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2015 | |
| 2016 | }/*WDI_JoinReq*/ |
| 2017 | |
| 2018 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2019 | @brief WDI_ConfigBSSReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2020 | wishes to configure the newly acquired or in process of |
| 2021 | being acquired BSS to the HW . Upon the call of this API |
| 2022 | the WLAN DAL will pack and send a HAL Config BSS request |
| 2023 | message to the lower RIVA sub-system if DAL is in state |
| 2024 | STARTED. |
| 2025 | |
| 2026 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2027 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2028 | |
| 2029 | WDI_JoinReq must have been called. |
| 2030 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2031 | @param wdiConfigBSSParams: the config BSS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2032 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2033 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2034 | wdiConfigBSSRspCb: callback for passing back the |
| 2035 | response of the config BSS operation received from the |
| 2036 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2037 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2038 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2039 | callback |
| 2040 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2041 | @see WDI_JoinReq |
| 2042 | @return Result of the function call |
| 2043 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2044 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2045 | WDI_ConfigBSSReq |
| 2046 | ( |
| 2047 | WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams, |
| 2048 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb, |
| 2049 | void* pUserData |
| 2050 | ) |
| 2051 | { |
| 2052 | WDI_EventInfoType wdiEventData; |
| 2053 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2054 | |
| 2055 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2056 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2057 | ------------------------------------------------------------------------*/ |
| 2058 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2059 | { |
| 2060 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2061 | "WDI API call before module is initialized - Fail request"); |
| 2062 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2063 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2064 | } |
| 2065 | |
| 2066 | /*------------------------------------------------------------------------ |
| 2067 | Fill in Event data and post to the Main FSM |
| 2068 | ------------------------------------------------------------------------*/ |
| 2069 | wdiEventData.wdiRequest = WDI_CONFIG_BSS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2070 | wdiEventData.pEventData = pwdiConfigBSSParams; |
| 2071 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigBSSParams); |
| 2072 | wdiEventData.pCBfnc = wdiConfigBSSRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2073 | wdiEventData.pUserData = pUserData; |
| 2074 | |
| 2075 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2076 | |
| 2077 | }/*WDI_ConfigBSSReq*/ |
| 2078 | |
| 2079 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2080 | @brief WDI_DelBSSReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2081 | disassociating from the BSS and wishes to notify HW. |
| 2082 | Upon the call of this API the WLAN DAL will pack and |
| 2083 | send a HAL Del BSS request message to the lower RIVA |
| 2084 | sub-system if DAL is in state STARTED. |
| 2085 | |
| 2086 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2087 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2088 | |
| 2089 | WDI_ConfigBSSReq or WDI_PostAssocReq must have been called. |
| 2090 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2091 | @param wdiDelBSSParams: the del BSS parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2092 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2093 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2094 | wdiDelBSSRspCb: callback for passing back the response |
| 2095 | of the del bss operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2096 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2097 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2098 | callback |
| 2099 | |
| 2100 | @see WDI_ConfigBSSReq, WDI_PostAssocReq |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2101 | @return Result of the function call |
| 2102 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2103 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2104 | WDI_DelBSSReq |
| 2105 | ( |
| 2106 | WDI_DelBSSReqParamsType* pwdiDelBSSParams, |
| 2107 | WDI_DelBSSRspCb wdiDelBSSRspCb, |
| 2108 | void* pUserData |
| 2109 | ) |
| 2110 | { |
| 2111 | WDI_EventInfoType wdiEventData; |
| 2112 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2113 | |
| 2114 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2115 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2116 | ------------------------------------------------------------------------*/ |
| 2117 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2118 | { |
| 2119 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2120 | "WDI API call before module is initialized - Fail request"); |
| 2121 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2122 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2123 | } |
| 2124 | |
| 2125 | /*------------------------------------------------------------------------ |
| 2126 | Fill in Event data and post to the Main FSM |
| 2127 | ------------------------------------------------------------------------*/ |
| 2128 | wdiEventData.wdiRequest = WDI_DEL_BSS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2129 | wdiEventData.pEventData = pwdiDelBSSParams; |
| 2130 | wdiEventData.uEventDataSize = sizeof(*pwdiDelBSSParams); |
| 2131 | wdiEventData.pCBfnc = wdiDelBSSRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2132 | wdiEventData.pUserData = pUserData; |
| 2133 | |
| 2134 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2135 | |
| 2136 | }/*WDI_DelBSSReq*/ |
| 2137 | |
| 2138 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2139 | @brief WDI_PostAssocReq will be called when the upper MAC has |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2140 | associated to a BSS and wishes to configure HW for |
| 2141 | associated state. Upon the call of this API the WLAN DAL |
| 2142 | will pack and send a HAL Post Assoc request message to |
| 2143 | the lower RIVA sub-system if DAL is in state STARTED. |
| 2144 | |
| 2145 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2146 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2147 | |
| 2148 | WDI_JoinReq must have been called. |
| 2149 | |
| 2150 | @param wdiPostAssocReqParams: the assoc parameters as specified |
| 2151 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2152 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2153 | wdiPostAssocRspCb: callback for passing back the |
| 2154 | response of the post assoc operation received from the |
| 2155 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2156 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2157 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2158 | callback |
| 2159 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2160 | @see WDI_JoinReq |
| 2161 | @return Result of the function call |
| 2162 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2163 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2164 | WDI_PostAssocReq |
| 2165 | ( |
| 2166 | WDI_PostAssocReqParamsType* pwdiPostAssocReqParams, |
| 2167 | WDI_PostAssocRspCb wdiPostAssocRspCb, |
| 2168 | void* pUserData |
| 2169 | ) |
| 2170 | { |
| 2171 | WDI_EventInfoType wdiEventData; |
| 2172 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2173 | |
| 2174 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2175 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2176 | ------------------------------------------------------------------------*/ |
| 2177 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2178 | { |
| 2179 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2180 | "WDI API call before module is initialized - Fail request"); |
| 2181 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2182 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2183 | } |
| 2184 | |
| 2185 | /*------------------------------------------------------------------------ |
| 2186 | Fill in Event data and post to the Main FSM |
| 2187 | ------------------------------------------------------------------------*/ |
| 2188 | wdiEventData.wdiRequest = WDI_POST_ASSOC_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2189 | wdiEventData.pEventData = pwdiPostAssocReqParams; |
| 2190 | wdiEventData.uEventDataSize = sizeof(*pwdiPostAssocReqParams); |
| 2191 | wdiEventData.pCBfnc = wdiPostAssocRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2192 | wdiEventData.pUserData = pUserData; |
| 2193 | |
| 2194 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2195 | |
| 2196 | }/*WDI_PostAssocReq*/ |
| 2197 | |
| 2198 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2199 | @brief WDI_DelSTAReq will be called when the upper MAC when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2200 | association with another STA has ended and the station |
| 2201 | must be deleted from HW. Upon the call of this API the |
| 2202 | WLAN DAL will pack and send a HAL Del STA request |
| 2203 | message to the lower RIVA sub-system if DAL is in state |
| 2204 | STARTED. |
| 2205 | |
| 2206 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2207 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2208 | |
| 2209 | WDI_PostAssocReq must have been called. |
| 2210 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2211 | @param wdiDelSTAParams: the Del STA parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2212 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2213 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2214 | wdiDelSTARspCb: callback for passing back the response |
| 2215 | of the del STA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2216 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2217 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2218 | callback |
| 2219 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2220 | @see WDI_PostAssocReq |
| 2221 | @return Result of the function call |
| 2222 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2223 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2224 | WDI_DelSTAReq |
| 2225 | ( |
| 2226 | WDI_DelSTAReqParamsType* pwdiDelSTAParams, |
| 2227 | WDI_DelSTARspCb wdiDelSTARspCb, |
| 2228 | void* pUserData |
| 2229 | ) |
| 2230 | { |
| 2231 | WDI_EventInfoType wdiEventData; |
| 2232 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2233 | |
| 2234 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2235 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2236 | ------------------------------------------------------------------------*/ |
| 2237 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2238 | { |
| 2239 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2240 | "WDI API call before module is initialized - Fail request"); |
| 2241 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2242 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2243 | } |
| 2244 | |
| 2245 | /*------------------------------------------------------------------------ |
| 2246 | Fill in Event data and post to the Main FSM |
| 2247 | ------------------------------------------------------------------------*/ |
| 2248 | wdiEventData.wdiRequest = WDI_DEL_STA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2249 | wdiEventData.pEventData = pwdiDelSTAParams; |
| 2250 | wdiEventData.uEventDataSize = sizeof(*pwdiDelSTAParams); |
| 2251 | wdiEventData.pCBfnc = wdiDelSTARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2252 | wdiEventData.pUserData = pUserData; |
| 2253 | |
| 2254 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2255 | |
| 2256 | }/*WDI_DelSTAReq*/ |
| 2257 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2258 | /*======================================================================== |
| 2259 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2260 | SECURITY APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2261 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2262 | ==========================================================================*/ |
| 2263 | |
| 2264 | /** |
| 2265 | @brief WDI_SetBSSKeyReq will be called when the upper MAC wants to |
| 2266 | install a BSS encryption key on the HW. Upon the call of this |
| 2267 | API the WLAN DAL will pack and send a Set BSS Key request |
| 2268 | message to the lower RIVA sub-system if DAL is in state |
| 2269 | STARTED. |
| 2270 | |
| 2271 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2272 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2273 | |
| 2274 | WDI_PostAssocReq must have been called. |
| 2275 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2276 | @param wdiSetBSSKeyParams: the BSS Key set parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2277 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2278 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2279 | wdiSetBSSKeyRspCb: callback for passing back the |
| 2280 | response of the set BSS Key operation received from the |
| 2281 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2282 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2283 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2284 | callback |
| 2285 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2286 | @see WDI_PostAssocReq |
| 2287 | @return Result of the function call |
| 2288 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2289 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2290 | WDI_SetBSSKeyReq |
| 2291 | ( |
| 2292 | WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams, |
| 2293 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb, |
| 2294 | void* pUserData |
| 2295 | ) |
| 2296 | { |
| 2297 | WDI_EventInfoType wdiEventData; |
| 2298 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2299 | |
| 2300 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2301 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2302 | ------------------------------------------------------------------------*/ |
| 2303 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2304 | { |
| 2305 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2306 | "WDI API call before module is initialized - Fail request"); |
| 2307 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2308 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2309 | } |
| 2310 | |
| 2311 | /*------------------------------------------------------------------------ |
| 2312 | Fill in Event data and post to the Main FSM |
| 2313 | ------------------------------------------------------------------------*/ |
| 2314 | wdiEventData.wdiRequest = WDI_SET_BSS_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2315 | wdiEventData.pEventData = pwdiSetBSSKeyParams; |
| 2316 | wdiEventData.uEventDataSize = sizeof(*pwdiSetBSSKeyParams); |
| 2317 | wdiEventData.pCBfnc = wdiSetBSSKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2318 | wdiEventData.pUserData = pUserData; |
| 2319 | |
| 2320 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2321 | |
| 2322 | }/*WDI_SetBSSKeyReq*/ |
| 2323 | |
| 2324 | /** |
| 2325 | @brief WDI_RemoveBSSKeyReq will be called when the upper MAC wants to |
| 2326 | uninstall a BSS key from HW. Upon the call of this API the |
| 2327 | WLAN DAL will pack and send a HAL Remove BSS Key request |
| 2328 | message to the lower RIVA sub-system if DAL is in state |
| 2329 | STARTED. |
| 2330 | |
| 2331 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2332 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2333 | |
| 2334 | WDI_SetBSSKeyReq must have been called. |
| 2335 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2336 | @param wdiRemoveBSSKeyParams: the remove BSS key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2337 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2338 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2339 | wdiRemoveBSSKeyRspCb: callback for passing back the |
| 2340 | response of the remove BSS key operation received from |
| 2341 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2342 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2343 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2344 | callback |
| 2345 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2346 | @see WDI_SetBSSKeyReq |
| 2347 | @return Result of the function call |
| 2348 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2349 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2350 | WDI_RemoveBSSKeyReq |
| 2351 | ( |
| 2352 | WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams, |
| 2353 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb, |
| 2354 | void* pUserData |
| 2355 | ) |
| 2356 | { |
| 2357 | WDI_EventInfoType wdiEventData; |
| 2358 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2359 | |
| 2360 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2361 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2362 | ------------------------------------------------------------------------*/ |
| 2363 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2364 | { |
| 2365 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2366 | "WDI API call before module is initialized - Fail request"); |
| 2367 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2368 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2369 | } |
| 2370 | |
| 2371 | /*------------------------------------------------------------------------ |
| 2372 | Fill in Event data and post to the Main FSM |
| 2373 | ------------------------------------------------------------------------*/ |
| 2374 | wdiEventData.wdiRequest = WDI_RMV_BSS_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2375 | wdiEventData.pEventData = pwdiRemoveBSSKeyParams; |
| 2376 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveBSSKeyParams); |
| 2377 | wdiEventData.pCBfnc = wdiRemoveBSSKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2378 | wdiEventData.pUserData = pUserData; |
| 2379 | |
| 2380 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2381 | |
| 2382 | }/*WDI_RemoveBSSKeyReq*/ |
| 2383 | |
| 2384 | |
| 2385 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2386 | @brief WDI_SetSTAKeyReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2387 | ready to install a STA(ast) encryption key in HW. Upon |
| 2388 | the call of this API the WLAN DAL will pack and send a |
| 2389 | HAL Set STA Key request message to the lower RIVA |
| 2390 | sub-system if DAL is in state STARTED. |
| 2391 | |
| 2392 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2393 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2394 | |
| 2395 | WDI_PostAssocReq must have been called. |
| 2396 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2397 | @param wdiSetSTAKeyParams: the set STA key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2398 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2399 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2400 | wdiSetSTAKeyRspCb: callback for passing back the |
| 2401 | response of the set STA key operation received from the |
| 2402 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2403 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2404 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2405 | callback |
| 2406 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2407 | @see WDI_PostAssocReq |
| 2408 | @return Result of the function call |
| 2409 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2410 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2411 | WDI_SetSTAKeyReq |
| 2412 | ( |
| 2413 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams, |
| 2414 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb, |
| 2415 | void* pUserData |
| 2416 | ) |
| 2417 | { |
| 2418 | WDI_EventInfoType wdiEventData; |
| 2419 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2420 | |
| 2421 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2422 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2423 | ------------------------------------------------------------------------*/ |
| 2424 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2425 | { |
| 2426 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2427 | "WDI API call before module is initialized - Fail request"); |
| 2428 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2429 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2430 | } |
| 2431 | |
| 2432 | /*------------------------------------------------------------------------ |
| 2433 | Fill in Event data and post to the Main FSM |
| 2434 | ------------------------------------------------------------------------*/ |
| 2435 | wdiEventData.wdiRequest = WDI_SET_STA_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2436 | wdiEventData.pEventData = pwdiSetSTAKeyParams; |
| 2437 | wdiEventData.uEventDataSize = sizeof(*pwdiSetSTAKeyParams); |
| 2438 | wdiEventData.pCBfnc = wdiSetSTAKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2439 | wdiEventData.pUserData = pUserData; |
| 2440 | |
| 2441 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2442 | |
| 2443 | }/*WDI_SetSTAKeyReq*/ |
| 2444 | |
| 2445 | |
| 2446 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2447 | @brief WDI_RemoveSTAKeyReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2448 | wants to uninstall a previously set STA key in HW. Upon |
| 2449 | the call of this API the WLAN DAL will pack and send a |
| 2450 | HAL Remove STA Key request message to the lower RIVA |
| 2451 | sub-system if DAL is in state STARTED. |
| 2452 | |
| 2453 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2454 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2455 | |
| 2456 | WDI_SetSTAKeyReq must have been called. |
| 2457 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2458 | @param wdiRemoveSTAKeyParams: the remove STA key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2459 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2460 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2461 | wdiRemoveSTAKeyRspCb: callback for passing back the |
| 2462 | response of the remove STA key operation received from |
| 2463 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2464 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2465 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2466 | callback |
| 2467 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2468 | @see WDI_SetSTAKeyReq |
| 2469 | @return Result of the function call |
| 2470 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2471 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2472 | WDI_RemoveSTAKeyReq |
| 2473 | ( |
| 2474 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams, |
| 2475 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb, |
| 2476 | void* pUserData |
| 2477 | ) |
| 2478 | { |
| 2479 | WDI_EventInfoType wdiEventData; |
| 2480 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2481 | |
| 2482 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2483 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2484 | ------------------------------------------------------------------------*/ |
| 2485 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2486 | { |
| 2487 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2488 | "WDI API call before module is initialized - Fail request"); |
| 2489 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2490 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2491 | } |
| 2492 | |
| 2493 | /*------------------------------------------------------------------------ |
| 2494 | Fill in Event data and post to the Main FSM |
| 2495 | ------------------------------------------------------------------------*/ |
| 2496 | wdiEventData.wdiRequest = WDI_RMV_STA_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2497 | wdiEventData.pEventData = pwdiRemoveSTAKeyParams; |
| 2498 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTAKeyParams); |
| 2499 | wdiEventData.pCBfnc = wdiRemoveSTAKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2500 | wdiEventData.pUserData = pUserData; |
| 2501 | |
| 2502 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2503 | |
| 2504 | }/*WDI_RemoveSTAKeyReq*/ |
| 2505 | |
| 2506 | |
| 2507 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2508 | @brief WDI_SetSTABcastKeyReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2509 | wants to install a STA Bcast encryption key on the HW. |
| 2510 | Upon the call of this API the WLAN DAL will pack and |
| 2511 | send a HAL Start request message to the lower RIVA |
| 2512 | sub-system if DAL is in state STARTED. |
| 2513 | |
| 2514 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2515 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2516 | |
| 2517 | WDI_PostAssocReq must have been called. |
| 2518 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2519 | @param pwdiSetSTABcastKeyParams: the BSS Key set parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2520 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2521 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2522 | wdiSetSTABcastKeyRspCb: callback for passing back the |
| 2523 | response of the set BSS Key operation received from the |
| 2524 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2525 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2526 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2527 | callback |
| 2528 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2529 | @see WDI_PostAssocReq |
| 2530 | @return Result of the function call |
| 2531 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2532 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2533 | WDI_SetSTABcastKeyReq |
| 2534 | ( |
| 2535 | WDI_SetSTAKeyReqParamsType* pwdiSetSTABcastKeyParams, |
| 2536 | WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb, |
| 2537 | void* pUserData |
| 2538 | ) |
| 2539 | |
| 2540 | { |
| 2541 | WDI_EventInfoType wdiEventData; |
| 2542 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2543 | |
| 2544 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2545 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2546 | ------------------------------------------------------------------------*/ |
| 2547 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2548 | { |
| 2549 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2550 | "WDI API call before module is initialized - Fail request"); |
| 2551 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2552 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2553 | } |
| 2554 | |
| 2555 | /*------------------------------------------------------------------------ |
| 2556 | Fill in Event data and post to the Main FSM |
| 2557 | ------------------------------------------------------------------------*/ |
| 2558 | wdiEventData.wdiRequest = WDI_SET_STA_BCAST_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2559 | wdiEventData.pEventData = pwdiSetSTABcastKeyParams; |
| 2560 | wdiEventData.uEventDataSize = sizeof(*pwdiSetSTABcastKeyParams); |
| 2561 | wdiEventData.pCBfnc = wdiSetSTABcastKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2562 | wdiEventData.pUserData = pUserData; |
| 2563 | |
| 2564 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2565 | |
| 2566 | }/*WDI_SetSTABcastKeyReq*/ |
| 2567 | |
| 2568 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2569 | @brief WDI_RemoveSTABcastKeyReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2570 | MAC wants to uninstall a STA Bcast key from HW. Upon the |
| 2571 | call of this API the WLAN DAL will pack and send a HAL |
| 2572 | Remove STA Bcast Key request message to the lower RIVA |
| 2573 | sub-system if DAL is in state STARTED. |
| 2574 | |
| 2575 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2576 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2577 | |
| 2578 | WDI_SetSTABcastKeyReq must have been called. |
| 2579 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2580 | @param pwdiRemoveSTABcastKeyParams: the remove BSS key |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2581 | parameters as specified by the Device |
| 2582 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2583 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2584 | wdiRemoveSTABcastKeyRspCb: callback for passing back the |
| 2585 | response of the remove STA Bcast key operation received |
| 2586 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2587 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2588 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2589 | callback |
| 2590 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2591 | @see WDI_SetSTABcastKeyReq |
| 2592 | @return Result of the function call |
| 2593 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2594 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2595 | WDI_RemoveSTABcastKeyReq |
| 2596 | ( |
| 2597 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams, |
| 2598 | WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb, |
| 2599 | void* pUserData |
| 2600 | ) |
| 2601 | { |
| 2602 | WDI_EventInfoType wdiEventData; |
| 2603 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2604 | |
| 2605 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2606 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2607 | ------------------------------------------------------------------------*/ |
| 2608 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2609 | { |
| 2610 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2611 | "WDI API call before module is initialized - Fail request"); |
| 2612 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2613 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2614 | } |
| 2615 | |
| 2616 | /*------------------------------------------------------------------------ |
| 2617 | Fill in Event data and post to the Main FSM |
| 2618 | ------------------------------------------------------------------------*/ |
| 2619 | wdiEventData.wdiRequest = WDI_RMV_STA_BCAST_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2620 | wdiEventData.pEventData = pwdiRemoveSTABcastKeyParams; |
| 2621 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTABcastKeyParams); |
| 2622 | wdiEventData.pCBfnc = wdiRemoveSTABcastKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2623 | wdiEventData.pUserData = pUserData; |
| 2624 | |
| 2625 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2626 | |
| 2627 | }/*WDI_RemoveSTABcastKeyReq*/ |
| 2628 | |
| 2629 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2630 | @brief WDI_SetMaxTxPowerReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2631 | MAC wants to set Max Tx Power to HW. Upon the |
| 2632 | call of this API the WLAN DAL will pack and send a HAL |
| 2633 | Remove STA Bcast Key request message to the lower RIVA |
| 2634 | sub-system if DAL is in state STARTED. |
| 2635 | |
| 2636 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2637 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2638 | |
| 2639 | WDI_SetSTABcastKeyReq must have been called. |
| 2640 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2641 | @param pwdiRemoveSTABcastKeyParams: the remove BSS key |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2642 | parameters as specified by the Device |
| 2643 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2644 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2645 | wdiRemoveSTABcastKeyRspCb: callback for passing back the |
| 2646 | response of the remove STA Bcast key operation received |
| 2647 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2648 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2649 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2650 | callback |
| 2651 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2652 | @see WDI_SetMaxTxPowerReq |
| 2653 | @return Result of the function call |
| 2654 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2655 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2656 | WDI_SetMaxTxPowerReq |
| 2657 | ( |
| 2658 | WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams, |
| 2659 | WDA_SetMaxTxPowerRspCb wdiReqStatusCb, |
| 2660 | void* pUserData |
| 2661 | ) |
| 2662 | { |
| 2663 | WDI_EventInfoType wdiEventData; |
| 2664 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2665 | |
| 2666 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2667 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2668 | ------------------------------------------------------------------------*/ |
| 2669 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2670 | { |
| 2671 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2672 | "WDI API call before module is initialized - Fail request"); |
| 2673 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2674 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2675 | } |
| 2676 | |
| 2677 | /*------------------------------------------------------------------------ |
| 2678 | Fill in Event data and post to the Main FSM |
| 2679 | ------------------------------------------------------------------------*/ |
| 2680 | wdiEventData.wdiRequest = WDI_SET_MAX_TX_POWER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2681 | wdiEventData.pEventData = pwdiSetMaxTxPowerParams; |
| 2682 | wdiEventData.uEventDataSize = sizeof(*pwdiSetMaxTxPowerParams); |
| 2683 | wdiEventData.pCBfnc = wdiReqStatusCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2684 | wdiEventData.pUserData = pUserData; |
| 2685 | |
| 2686 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2687 | } |
| 2688 | |
| 2689 | #ifdef FEATURE_WLAN_CCX |
| 2690 | WDI_Status |
| 2691 | WDI_TSMStatsReq |
| 2692 | ( |
| 2693 | WDI_TSMStatsReqParamsType* pwdiTsmReqParams, |
| 2694 | WDI_TsmRspCb wdiReqStatusCb, |
| 2695 | void* pUserData |
| 2696 | ) |
| 2697 | { |
| 2698 | WDI_EventInfoType wdiEventData; |
| 2699 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2700 | /*------------------------------------------------------------------------ |
| 2701 | Sanity Check |
| 2702 | ------------------------------------------------------------------------*/ |
| 2703 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2704 | { |
| 2705 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2706 | "WDI API call before module is initialized - Fail request"); |
| 2707 | |
| 2708 | return WDI_STATUS_E_NOT_ALLOWED; |
| 2709 | } |
| 2710 | |
| 2711 | /*------------------------------------------------------------------------ |
| 2712 | Fill in Event data and post to the Main FSM |
| 2713 | ------------------------------------------------------------------------*/ |
| 2714 | wdiEventData.wdiRequest = WDI_TSM_STATS_REQ; |
| 2715 | wdiEventData.pEventData = pwdiTsmReqParams; |
| 2716 | wdiEventData.uEventDataSize = sizeof(*pwdiTsmReqParams); |
| 2717 | wdiEventData.pCBfnc = wdiReqStatusCb; |
| 2718 | wdiEventData.pUserData = pUserData; |
| 2719 | |
| 2720 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2721 | |
| 2722 | } |
| 2723 | #endif |
| 2724 | |
| 2725 | /*======================================================================== |
| 2726 | |
| 2727 | QoS and BA APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2728 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2729 | ==========================================================================*/ |
| 2730 | |
| 2731 | /** |
| 2732 | @brief WDI_AddTSReq will be called when the upper MAC to inform |
| 2733 | the device of a successful add TSpec negotiation. HW |
| 2734 | needs to receive the TSpec Info from the UMAC in order |
| 2735 | to configure properly the QoS data traffic. Upon the |
| 2736 | call of this API the WLAN DAL will pack and send a HAL |
| 2737 | Add TS request message to the lower RIVA sub-system if |
| 2738 | DAL is in state STARTED. |
| 2739 | |
| 2740 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2741 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2742 | |
| 2743 | WDI_PostAssocReq must have been called. |
| 2744 | |
| 2745 | @param wdiAddTsReqParams: the add TS parameters as specified by |
| 2746 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2747 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2748 | wdiAddTsRspCb: callback for passing back the response of |
| 2749 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2750 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2751 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2752 | callback |
| 2753 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2754 | @see WDI_PostAssocReq |
| 2755 | @return Result of the function call |
| 2756 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2757 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2758 | WDI_AddTSReq |
| 2759 | ( |
| 2760 | WDI_AddTSReqParamsType* pwdiAddTsReqParams, |
| 2761 | WDI_AddTsRspCb wdiAddTsRspCb, |
| 2762 | void* pUserData |
| 2763 | ) |
| 2764 | { |
| 2765 | WDI_EventInfoType wdiEventData; |
| 2766 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2767 | |
| 2768 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2769 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2770 | ------------------------------------------------------------------------*/ |
| 2771 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2772 | { |
| 2773 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2774 | "WDI API call before module is initialized - Fail request"); |
| 2775 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2776 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2777 | } |
| 2778 | |
| 2779 | /*------------------------------------------------------------------------ |
| 2780 | Fill in Event data and post to the Main FSM |
| 2781 | ------------------------------------------------------------------------*/ |
| 2782 | wdiEventData.wdiRequest = WDI_ADD_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2783 | wdiEventData.pEventData = pwdiAddTsReqParams; |
| 2784 | wdiEventData.uEventDataSize = sizeof(*pwdiAddTsReqParams); |
| 2785 | wdiEventData.pCBfnc = wdiAddTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2786 | wdiEventData.pUserData = pUserData; |
| 2787 | |
| 2788 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2789 | |
| 2790 | }/*WDI_AddTSReq*/ |
| 2791 | |
| 2792 | |
| 2793 | |
| 2794 | /** |
| 2795 | @brief WDI_DelTSReq will be called when the upper MAC has ended |
| 2796 | admission on a specific AC. This is to inform HW that |
| 2797 | QoS traffic parameters must be rest. Upon the call of |
| 2798 | this API the WLAN DAL will pack and send a HAL Del TS |
| 2799 | request message to the lower RIVA sub-system if DAL is |
| 2800 | in state STARTED. |
| 2801 | |
| 2802 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2803 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2804 | |
| 2805 | WDI_AddTSReq must have been called. |
| 2806 | |
| 2807 | @param wdiDelTsReqParams: the del TS parameters as specified by |
| 2808 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2809 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2810 | wdiDelTsRspCb: callback for passing back the response of |
| 2811 | the del TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2812 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2813 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2814 | callback |
| 2815 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2816 | @see WDI_AddTSReq |
| 2817 | @return Result of the function call |
| 2818 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2819 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2820 | WDI_DelTSReq |
| 2821 | ( |
| 2822 | WDI_DelTSReqParamsType* pwdiDelTsReqParams, |
| 2823 | WDI_DelTsRspCb wdiDelTsRspCb, |
| 2824 | void* pUserData |
| 2825 | ) |
| 2826 | { |
| 2827 | WDI_EventInfoType wdiEventData; |
| 2828 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2829 | |
| 2830 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2831 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2832 | ------------------------------------------------------------------------*/ |
| 2833 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2834 | { |
| 2835 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2836 | "WDI API call before module is initialized - Fail request"); |
| 2837 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2838 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2839 | } |
| 2840 | |
| 2841 | /*------------------------------------------------------------------------ |
| 2842 | Fill in Event data and post to the Main FSM |
| 2843 | ------------------------------------------------------------------------*/ |
| 2844 | wdiEventData.wdiRequest = WDI_DEL_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2845 | wdiEventData.pEventData = pwdiDelTsReqParams; |
| 2846 | wdiEventData.uEventDataSize = sizeof(*pwdiDelTsReqParams); |
| 2847 | wdiEventData.pCBfnc = wdiDelTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2848 | wdiEventData.pUserData = pUserData; |
| 2849 | |
| 2850 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2851 | |
| 2852 | }/*WDI_DelTSReq*/ |
| 2853 | |
| 2854 | |
| 2855 | |
| 2856 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2857 | @brief WDI_UpdateEDCAParams will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2858 | wishes to update the EDCA parameters used by HW for QoS |
| 2859 | data traffic. Upon the call of this API the WLAN DAL |
| 2860 | will pack and send a HAL Update EDCA Params request |
| 2861 | message to the lower RIVA sub-system if DAL is in state |
| 2862 | STARTED. |
| 2863 | |
| 2864 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2865 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2866 | |
| 2867 | WDI_PostAssocReq must have been called. |
| 2868 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2869 | @param wdiUpdateEDCAParams: the start parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2870 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2871 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2872 | wdiUpdateEDCAParamsRspCb: callback for passing back the |
| 2873 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2874 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2875 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2876 | callback |
| 2877 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2878 | @see WDI_PostAssocReq |
| 2879 | @return Result of the function call |
| 2880 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2881 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2882 | WDI_UpdateEDCAParams |
| 2883 | ( |
| 2884 | WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams, |
| 2885 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb, |
| 2886 | void* pUserData |
| 2887 | ) |
| 2888 | { |
| 2889 | WDI_EventInfoType wdiEventData; |
| 2890 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2891 | |
| 2892 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2893 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2894 | ------------------------------------------------------------------------*/ |
| 2895 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2896 | { |
| 2897 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2898 | "WDI API call before module is initialized - Fail request"); |
| 2899 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2900 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2901 | } |
| 2902 | |
| 2903 | /*------------------------------------------------------------------------ |
| 2904 | Fill in Event data and post to the Main FSM |
| 2905 | ------------------------------------------------------------------------*/ |
| 2906 | wdiEventData.wdiRequest = WDI_UPD_EDCA_PRMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2907 | wdiEventData.pEventData = pwdiUpdateEDCAParams; |
| 2908 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateEDCAParams); |
| 2909 | wdiEventData.pCBfnc = wdiUpdateEDCAParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2910 | wdiEventData.pUserData = pUserData; |
| 2911 | |
| 2912 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2913 | |
| 2914 | }/*WDI_UpdateEDCAParams*/ |
| 2915 | |
| 2916 | |
| 2917 | /** |
| 2918 | @brief WDI_AddBASessionReq will be called when the upper MAC has setup |
| 2919 | successfully a BA session and needs to notify the HW for |
| 2920 | the appropriate settings to take place. Upon the call of |
| 2921 | this API the WLAN DAL will pack and send a HAL Add BA |
| 2922 | request message to the lower RIVA sub-system if DAL is |
| 2923 | in state STARTED. |
| 2924 | |
| 2925 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2926 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2927 | |
| 2928 | WDI_PostAssocReq must have been called. |
| 2929 | |
| 2930 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 2931 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2932 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2933 | wdiAddBARspCb: callback for passing back the response of |
| 2934 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2935 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2936 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2937 | callback |
| 2938 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2939 | @see WDI_PostAssocReq |
| 2940 | @return Result of the function call |
| 2941 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2942 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2943 | WDI_AddBASessionReq |
| 2944 | ( |
| 2945 | WDI_AddBASessionReqParamsType* pwdiAddBASessionReqParams, |
| 2946 | WDI_AddBASessionRspCb wdiAddBASessionRspCb, |
| 2947 | void* pUserData |
| 2948 | ) |
| 2949 | { |
| 2950 | WDI_EventInfoType wdiEventData; |
| 2951 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2952 | |
| 2953 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2954 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2955 | ------------------------------------------------------------------------*/ |
| 2956 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2957 | { |
| 2958 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2959 | "WDI API call before module is initialized - Fail request"); |
| 2960 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2961 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2962 | } |
| 2963 | |
| 2964 | /*------------------------------------------------------------------------ |
| 2965 | Fill in Event data and post to the Main FSM |
| 2966 | ------------------------------------------------------------------------*/ |
| 2967 | wdiEventData.wdiRequest = WDI_ADD_BA_SESSION_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2968 | wdiEventData.pEventData = pwdiAddBASessionReqParams; |
| 2969 | wdiEventData.uEventDataSize = sizeof(*pwdiAddBASessionReqParams); |
| 2970 | wdiEventData.pCBfnc = wdiAddBASessionRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2971 | wdiEventData.pUserData = pUserData; |
| 2972 | |
| 2973 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2974 | |
| 2975 | }/*WDI_AddBASessionReq*/ |
| 2976 | |
| 2977 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2978 | @brief WDI_DelBAReq will be called when the upper MAC wants to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2979 | inform HW that it has deleted a previously created BA |
| 2980 | session. Upon the call of this API the WLAN DAL will |
| 2981 | pack and send a HAL Del BA request message to the lower |
| 2982 | RIVA sub-system if DAL is in state STARTED. |
| 2983 | |
| 2984 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2985 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2986 | |
| 2987 | WDI_AddBAReq must have been called. |
| 2988 | |
| 2989 | @param wdiDelBAReqParams: the del BA parameters as specified by |
| 2990 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2991 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2992 | wdiDelBARspCb: callback for passing back the response of |
| 2993 | the del BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2994 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2995 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2996 | callback |
| 2997 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2998 | @see WDI_AddBAReq |
| 2999 | @return Result of the function call |
| 3000 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3001 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3002 | WDI_DelBAReq |
| 3003 | ( |
| 3004 | WDI_DelBAReqParamsType* pwdiDelBAReqParams, |
| 3005 | WDI_DelBARspCb wdiDelBARspCb, |
| 3006 | void* pUserData |
| 3007 | ) |
| 3008 | { |
| 3009 | WDI_EventInfoType wdiEventData; |
| 3010 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3011 | |
| 3012 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3013 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3014 | ------------------------------------------------------------------------*/ |
| 3015 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3016 | { |
| 3017 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3018 | "WDI API call before module is initialized - Fail request"); |
| 3019 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3020 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3021 | } |
| 3022 | |
| 3023 | /*------------------------------------------------------------------------ |
| 3024 | Fill in Event data and post to the Main FSM |
| 3025 | ------------------------------------------------------------------------*/ |
| 3026 | wdiEventData.wdiRequest = WDI_DEL_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3027 | wdiEventData.pEventData = pwdiDelBAReqParams; |
| 3028 | wdiEventData.uEventDataSize = sizeof(*pwdiDelBAReqParams); |
| 3029 | wdiEventData.pCBfnc = wdiDelBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3030 | wdiEventData.pUserData = pUserData; |
| 3031 | |
| 3032 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3033 | |
| 3034 | }/*WDI_DelBAReq*/ |
| 3035 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3036 | /*======================================================================== |
| 3037 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3038 | Power Save APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3039 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3040 | ==========================================================================*/ |
| 3041 | |
| 3042 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3043 | @brief WDI_SetPwrSaveCfgReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3044 | wants to set the power save related configurations of |
| 3045 | the WLAN Device. Upon the call of this API the WLAN DAL |
| 3046 | will pack and send a HAL Update CFG request message to |
| 3047 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3048 | |
| 3049 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3050 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3051 | |
| 3052 | WDI_Start must have been called. |
| 3053 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3054 | @param pwdiPowerSaveCfg: the power save cfg parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3055 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3056 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3057 | wdiSetPwrSaveCfgCb: callback for passing back the |
| 3058 | response of the set power save cfg operation received |
| 3059 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3060 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3061 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3062 | callback |
| 3063 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3064 | @see WDI_Start |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3065 | @return Result of the function call |
| 3066 | */ |
| 3067 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3068 | WDI_SetPwrSaveCfgReq |
| 3069 | ( |
| 3070 | WDI_UpdateCfgReqParamsType* pwdiPowerSaveCfg, |
| 3071 | WDI_SetPwrSaveCfgCb wdiSetPwrSaveCfgCb, |
| 3072 | void* pUserData |
| 3073 | ) |
| 3074 | { |
| 3075 | WDI_EventInfoType wdiEventData; |
| 3076 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3077 | |
| 3078 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3079 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3080 | ------------------------------------------------------------------------*/ |
| 3081 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3082 | { |
| 3083 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3084 | "WDI API call before module is initialized - Fail request"); |
| 3085 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3086 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3087 | } |
| 3088 | |
| 3089 | /*------------------------------------------------------------------------ |
| 3090 | Fill in Event data and post to the Main FSM |
| 3091 | ------------------------------------------------------------------------*/ |
| 3092 | wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3093 | wdiEventData.pEventData = pwdiPowerSaveCfg; |
| 3094 | wdiEventData.uEventDataSize = sizeof(*pwdiPowerSaveCfg); |
| 3095 | wdiEventData.pCBfnc = wdiSetPwrSaveCfgCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3096 | wdiEventData.pUserData = pUserData; |
| 3097 | |
| 3098 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3099 | |
| 3100 | }/*WDI_SetPwrSaveCfgReq*/ |
| 3101 | |
| 3102 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3103 | @brief WDI_EnterImpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3104 | request the device to get into IMPS power state. Upon |
| 3105 | the call of this API the WLAN DAL will send a HAL Enter |
| 3106 | IMPS request message to the lower RIVA sub-system if DAL |
| 3107 | is in state STARTED. |
| 3108 | |
| 3109 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3110 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3111 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3112 | |
| 3113 | @param wdiEnterImpsRspCb: callback for passing back the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3114 | response of the Enter IMPS operation received from the |
| 3115 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3116 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3117 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3118 | callback |
| 3119 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3120 | @see WDI_Start |
| 3121 | @return Result of the function call |
| 3122 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3123 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3124 | WDI_EnterImpsReq |
| 3125 | ( |
| 3126 | WDI_EnterImpsRspCb wdiEnterImpsRspCb, |
| 3127 | void* pUserData |
| 3128 | ) |
| 3129 | { |
| 3130 | WDI_EventInfoType wdiEventData; |
| 3131 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3132 | |
| 3133 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3134 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3135 | ------------------------------------------------------------------------*/ |
| 3136 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3137 | { |
| 3138 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3139 | "WDI API call before module is initialized - Fail request"); |
| 3140 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3141 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3142 | } |
| 3143 | |
| 3144 | /*------------------------------------------------------------------------ |
| 3145 | Fill in Event data and post to the Main FSM |
| 3146 | ------------------------------------------------------------------------*/ |
| 3147 | wdiEventData.wdiRequest = WDI_ENTER_IMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3148 | wdiEventData.pEventData = NULL; |
| 3149 | wdiEventData.uEventDataSize = 0; |
| 3150 | wdiEventData.pCBfnc = wdiEnterImpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3151 | wdiEventData.pUserData = pUserData; |
| 3152 | |
| 3153 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3154 | |
| 3155 | }/*WDI_EnterImpsReq*/ |
| 3156 | |
| 3157 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3158 | @brief WDI_ExitImpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3159 | request the device to get out of IMPS power state. Upon |
| 3160 | the call of this API the WLAN DAL will send a HAL Exit |
| 3161 | IMPS request message to the lower RIVA sub-system if DAL |
| 3162 | is in state STARTED. |
| 3163 | |
| 3164 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3165 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3166 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3167 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3168 | |
| 3169 | @param wdiExitImpsRspCb: callback for passing back the response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3170 | of the Exit IMPS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3171 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3172 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3173 | callback |
| 3174 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3175 | @see WDI_Start |
| 3176 | @return Result of the function call |
| 3177 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3178 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3179 | WDI_ExitImpsReq |
| 3180 | ( |
| 3181 | WDI_ExitImpsRspCb wdiExitImpsRspCb, |
| 3182 | void* pUserData |
| 3183 | ) |
| 3184 | { |
| 3185 | WDI_EventInfoType wdiEventData; |
| 3186 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3187 | |
| 3188 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3189 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3190 | ------------------------------------------------------------------------*/ |
| 3191 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3192 | { |
| 3193 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3194 | "WDI API call before module is initialized - Fail request"); |
| 3195 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3196 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3197 | } |
| 3198 | |
| 3199 | /*------------------------------------------------------------------------ |
| 3200 | Fill in Event data and post to the Main FSM |
| 3201 | ------------------------------------------------------------------------*/ |
| 3202 | wdiEventData.wdiRequest = WDI_EXIT_IMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3203 | wdiEventData.pEventData = NULL; |
| 3204 | wdiEventData.uEventDataSize = 0; |
| 3205 | wdiEventData.pCBfnc = wdiExitImpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3206 | wdiEventData.pUserData = pUserData; |
| 3207 | |
| 3208 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3209 | |
| 3210 | }/*WDI_ExitImpsReq*/ |
| 3211 | |
| 3212 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3213 | @brief WDI_EnterBmpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3214 | request the device to get into BMPS power state. Upon |
| 3215 | the call of this API the WLAN DAL will pack and send a |
| 3216 | HAL Enter BMPS request message to the lower RIVA |
| 3217 | sub-system if DAL is in state STARTED. |
| 3218 | |
| 3219 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3220 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3221 | |
| 3222 | WDI_PostAssocReq must have been called. |
| 3223 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3224 | @param pwdiEnterBmpsReqParams: the Enter BMPS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3225 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3226 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3227 | wdiEnterBmpsRspCb: callback for passing back the |
| 3228 | response of the Enter BMPS operation received from the |
| 3229 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3230 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3231 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3232 | callback |
| 3233 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3234 | @see WDI_PostAssocReq |
| 3235 | @return Result of the function call |
| 3236 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3237 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3238 | WDI_EnterBmpsReq |
| 3239 | ( |
| 3240 | WDI_EnterBmpsReqParamsType *pwdiEnterBmpsReqParams, |
| 3241 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb, |
| 3242 | void* pUserData |
| 3243 | ) |
| 3244 | { |
| 3245 | WDI_EventInfoType wdiEventData; |
| 3246 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3247 | |
| 3248 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3249 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3250 | ------------------------------------------------------------------------*/ |
| 3251 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3252 | { |
| 3253 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3254 | "WDI API call before module is initialized - Fail request"); |
| 3255 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3256 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3257 | } |
| 3258 | |
| 3259 | /*------------------------------------------------------------------------ |
| 3260 | Fill in Event data and post to the Main FSM |
| 3261 | ------------------------------------------------------------------------*/ |
| 3262 | wdiEventData.wdiRequest = WDI_ENTER_BMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3263 | wdiEventData.pEventData = pwdiEnterBmpsReqParams; |
| 3264 | wdiEventData.uEventDataSize = sizeof(*pwdiEnterBmpsReqParams); |
| 3265 | wdiEventData.pCBfnc = wdiEnterBmpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3266 | wdiEventData.pUserData = pUserData; |
| 3267 | |
| 3268 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3269 | |
| 3270 | }/*WDI_EnterBmpsReq*/ |
| 3271 | |
| 3272 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3273 | @brief WDI_ExitBmpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3274 | request the device to get out of BMPS power state. Upon |
| 3275 | the call of this API the WLAN DAL will pack and send a |
| 3276 | HAL Exit BMPS request message to the lower RIVA |
| 3277 | sub-system if DAL is in state STARTED. |
| 3278 | |
| 3279 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3280 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3281 | |
| 3282 | WDI_PostAssocReq must have been called. |
| 3283 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3284 | @param pwdiExitBmpsReqParams: the Exit BMPS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3285 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3286 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3287 | wdiExitBmpsRspCb: callback for passing back the response |
| 3288 | of the Exit BMPS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3289 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3290 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3291 | callback |
| 3292 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3293 | @see WDI_PostAssocReq |
| 3294 | @return Result of the function call |
| 3295 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3296 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3297 | WDI_ExitBmpsReq |
| 3298 | ( |
| 3299 | WDI_ExitBmpsReqParamsType *pwdiExitBmpsReqParams, |
| 3300 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb, |
| 3301 | void* pUserData |
| 3302 | ) |
| 3303 | { |
| 3304 | WDI_EventInfoType wdiEventData; |
| 3305 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3306 | |
| 3307 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3308 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3309 | ------------------------------------------------------------------------*/ |
| 3310 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3311 | { |
| 3312 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3313 | "WDI API call before module is initialized - Fail request"); |
| 3314 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3315 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3316 | } |
| 3317 | |
| 3318 | /*------------------------------------------------------------------------ |
| 3319 | Fill in Event data and post to the Main FSM |
| 3320 | ------------------------------------------------------------------------*/ |
| 3321 | wdiEventData.wdiRequest = WDI_EXIT_BMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3322 | wdiEventData.pEventData = pwdiExitBmpsReqParams; |
| 3323 | wdiEventData.uEventDataSize = sizeof(*pwdiExitBmpsReqParams); |
| 3324 | wdiEventData.pCBfnc = wdiExitBmpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3325 | wdiEventData.pUserData = pUserData; |
| 3326 | |
| 3327 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3328 | |
| 3329 | }/*WDI_ExitBmpsReq*/ |
| 3330 | |
| 3331 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3332 | @brief WDI_EnterUapsdReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3333 | request the device to get into UAPSD power state. Upon |
| 3334 | the call of this API the WLAN DAL will pack and send a |
| 3335 | HAL Enter UAPSD request message to the lower RIVA |
| 3336 | sub-system if DAL is in state STARTED. |
| 3337 | |
| 3338 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3339 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3340 | |
| 3341 | WDI_PostAssocReq must have been called. |
| 3342 | WDI_SetUapsdAcParamsReq must have been called. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3343 | |
| 3344 | @param pwdiEnterUapsdReqParams: the Enter UAPSD parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3345 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3346 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3347 | wdiEnterUapsdRspCb: callback for passing back the |
| 3348 | response of the Enter UAPSD operation received from the |
| 3349 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3350 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3351 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3352 | callback |
| 3353 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3354 | @see WDI_PostAssocReq, WDI_SetUapsdAcParamsReq |
| 3355 | @return Result of the function call |
| 3356 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3357 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3358 | WDI_EnterUapsdReq |
| 3359 | ( |
| 3360 | WDI_EnterUapsdReqParamsType *pwdiEnterUapsdReqParams, |
| 3361 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb, |
| 3362 | void* pUserData |
| 3363 | ) |
| 3364 | { |
| 3365 | WDI_EventInfoType wdiEventData; |
| 3366 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3367 | |
| 3368 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3369 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3370 | ------------------------------------------------------------------------*/ |
| 3371 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3372 | { |
| 3373 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3374 | "WDI API call before module is initialized - Fail request"); |
| 3375 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3376 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3377 | } |
| 3378 | |
| 3379 | /*------------------------------------------------------------------------ |
| 3380 | Fill in Event data and post to the Main FSM |
| 3381 | ------------------------------------------------------------------------*/ |
| 3382 | wdiEventData.wdiRequest = WDI_ENTER_UAPSD_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3383 | wdiEventData.pEventData = pwdiEnterUapsdReqParams; |
| 3384 | wdiEventData.uEventDataSize = sizeof(*pwdiEnterUapsdReqParams); |
| 3385 | wdiEventData.pCBfnc = wdiEnterUapsdRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3386 | wdiEventData.pUserData = pUserData; |
| 3387 | |
| 3388 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3389 | |
| 3390 | }/*WDI_EnterUapsdReq*/ |
| 3391 | |
| 3392 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3393 | @brief WDI_ExitUapsdReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3394 | request the device to get out of UAPSD power state. Upon |
| 3395 | the call of this API the WLAN DAL will send a HAL Exit |
| 3396 | UAPSD request message to the lower RIVA sub-system if |
| 3397 | DAL is in state STARTED. |
| 3398 | |
| 3399 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3400 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3401 | |
| 3402 | WDI_PostAssocReq must have been called. |
| 3403 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3404 | @param wdiExitUapsdRspCb: callback for passing back the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3405 | response of the Exit UAPSD operation received from the |
| 3406 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3407 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3408 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3409 | callback |
| 3410 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3411 | @see WDI_PostAssocReq |
| 3412 | @return Result of the function call |
| 3413 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3414 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3415 | WDI_ExitUapsdReq |
| 3416 | ( |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 3417 | WDI_ExitUapsdReqParamsType *pwdiExitUapsdReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3418 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb, |
| 3419 | void* pUserData |
| 3420 | ) |
| 3421 | { |
| 3422 | WDI_EventInfoType wdiEventData; |
| 3423 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3424 | |
| 3425 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3426 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3427 | ------------------------------------------------------------------------*/ |
| 3428 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3429 | { |
| 3430 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3431 | "WDI API call before module is initialized - Fail request"); |
| 3432 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3433 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3434 | } |
| 3435 | |
| 3436 | /*------------------------------------------------------------------------ |
| 3437 | Fill in Event data and post to the Main FSM |
| 3438 | ------------------------------------------------------------------------*/ |
| 3439 | wdiEventData.wdiRequest = WDI_EXIT_UAPSD_REQ; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 3440 | wdiEventData.pEventData = pwdiExitUapsdReqParams; |
| 3441 | wdiEventData.uEventDataSize = sizeof(*pwdiExitUapsdReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3442 | wdiEventData.pCBfnc = wdiExitUapsdRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3443 | wdiEventData.pUserData = pUserData; |
| 3444 | |
| 3445 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3446 | |
| 3447 | }/*WDI_ExitUapsdReq*/ |
| 3448 | |
| 3449 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3450 | @brief WDI_UpdateUapsdParamsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3451 | MAC wants to set the UAPSD related configurations |
| 3452 | of an associated STA (while acting as an AP) to the WLAN |
| 3453 | Device. Upon the call of this API the WLAN DAL will pack |
| 3454 | and send a HAL Update UAPSD params request message to |
| 3455 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3456 | |
| 3457 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3458 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3459 | |
| 3460 | WDI_ConfigBSSReq must have been called. |
| 3461 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3462 | @param pwdiUpdateUapsdReqParams: the UAPSD parameters |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3463 | as specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3464 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3465 | wdiUpdateUapsdParamsCb: callback for passing back the |
| 3466 | response of the update UAPSD params operation received |
| 3467 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3468 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3469 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3470 | callback |
| 3471 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3472 | @see WDI_ConfigBSSReq |
| 3473 | @return Result of the function call |
| 3474 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3475 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3476 | WDI_UpdateUapsdParamsReq |
| 3477 | ( |
| 3478 | WDI_UpdateUapsdReqParamsType *pwdiUpdateUapsdReqParams, |
| 3479 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb, |
| 3480 | void* pUserData |
| 3481 | ) |
| 3482 | { |
| 3483 | WDI_EventInfoType wdiEventData; |
| 3484 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3485 | |
| 3486 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3487 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3488 | ------------------------------------------------------------------------*/ |
| 3489 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3490 | { |
| 3491 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3492 | "WDI API call before module is initialized - Fail request"); |
| 3493 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3494 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3495 | } |
| 3496 | |
| 3497 | /*------------------------------------------------------------------------ |
| 3498 | Fill in Event data and post to the Main FSM |
| 3499 | ------------------------------------------------------------------------*/ |
| 3500 | wdiEventData.wdiRequest = WDI_UPDATE_UAPSD_PARAM_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3501 | wdiEventData.pEventData = pwdiUpdateUapsdReqParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3502 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateUapsdReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3503 | wdiEventData.pCBfnc = wdiUpdateUapsdParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3504 | wdiEventData.pUserData = pUserData; |
| 3505 | |
| 3506 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3507 | |
| 3508 | }/*WDI_UpdateUapsdParamsReq*/ |
| 3509 | |
| 3510 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3511 | @brief WDI_SetUapsdAcParamsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3512 | MAC wants to set the UAPSD related configurations before |
| 3513 | requesting for enter UAPSD power state to the WLAN |
| 3514 | Device. Upon the call of this API the WLAN DAL will pack |
| 3515 | and send a HAL Set UAPSD params request message to |
| 3516 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3517 | |
| 3518 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3519 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3520 | |
| 3521 | WDI_PostAssocReq must have been called. |
| 3522 | |
| 3523 | @param pwdiUapsdInfo: the UAPSD parameters as specified by |
| 3524 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3525 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3526 | wdiSetUapsdAcParamsCb: callback for passing back the |
| 3527 | response of the set UAPSD params operation received from |
| 3528 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3529 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3530 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3531 | callback |
| 3532 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3533 | @see WDI_PostAssocReq |
| 3534 | @return Result of the function call |
| 3535 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3536 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3537 | WDI_SetUapsdAcParamsReq |
| 3538 | ( |
| 3539 | WDI_SetUapsdAcParamsReqParamsType* pwdiUapsdInfo, |
| 3540 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb, |
| 3541 | void* pUserData |
| 3542 | ) |
| 3543 | { |
| 3544 | WDI_EventInfoType wdiEventData; |
| 3545 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3546 | |
| 3547 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3548 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3549 | ------------------------------------------------------------------------*/ |
| 3550 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3551 | { |
| 3552 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3553 | "WDI API call before module is initialized - Fail request"); |
| 3554 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3555 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3556 | } |
| 3557 | |
| 3558 | /*------------------------------------------------------------------------ |
| 3559 | Fill in Event data and post to the Main FSM |
| 3560 | ------------------------------------------------------------------------*/ |
| 3561 | wdiEventData.wdiRequest = WDI_SET_UAPSD_PARAM_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3562 | wdiEventData.pEventData = pwdiUapsdInfo; |
| 3563 | wdiEventData.uEventDataSize = sizeof(*pwdiUapsdInfo); |
| 3564 | wdiEventData.pCBfnc = wdiSetUapsdAcParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3565 | wdiEventData.pUserData = pUserData; |
| 3566 | |
| 3567 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3568 | |
| 3569 | }/*WDI_SetUapsdAcParamsReq*/ |
| 3570 | |
| 3571 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3572 | @brief WDI_ConfigureRxpFilterReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3573 | MAC wants to set/reset the RXP filters for received pkts |
| 3574 | (MC, BC etc.). Upon the call of this API the WLAN DAL will pack |
| 3575 | and send a HAL configure RXP filter request message to |
| 3576 | the lower RIVA sub-system. |
| 3577 | |
| 3578 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3579 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3580 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3581 | |
| 3582 | @param pwdiConfigureRxpFilterReqParams: the RXP |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3583 | filter as specified by the Device |
| 3584 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3585 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3586 | wdiConfigureRxpFilterCb: callback for passing back the |
| 3587 | response of the configure RXP filter operation received |
| 3588 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3589 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3590 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3591 | callback |
| 3592 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3593 | @return Result of the function call |
| 3594 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3595 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3596 | WDI_ConfigureRxpFilterReq |
| 3597 | ( |
| 3598 | WDI_ConfigureRxpFilterReqParamsType *pwdiConfigureRxpFilterReqParams, |
| 3599 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb, |
| 3600 | void* pUserData |
| 3601 | ) |
| 3602 | { |
| 3603 | WDI_EventInfoType wdiEventData; |
| 3604 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3605 | |
| 3606 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3607 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3608 | ------------------------------------------------------------------------*/ |
| 3609 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3610 | { |
| 3611 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3612 | "WDI API call before module is initialized - Fail request"); |
| 3613 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3614 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3615 | } |
| 3616 | |
| 3617 | /*------------------------------------------------------------------------ |
| 3618 | Fill in Event data and post to the Main FSM |
| 3619 | ------------------------------------------------------------------------*/ |
| 3620 | wdiEventData.wdiRequest = WDI_CONFIGURE_RXP_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3621 | wdiEventData.pEventData = pwdiConfigureRxpFilterReqParams; |
| 3622 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigureRxpFilterReqParams); |
| 3623 | wdiEventData.pCBfnc = wdiConfigureRxpFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3624 | wdiEventData.pUserData = pUserData; |
| 3625 | |
| 3626 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3627 | }/*WDI_ConfigureRxpFilterReq*/ |
| 3628 | |
| 3629 | /** |
| 3630 | @brief WDI_SetBeaconFilterReq will be called when the upper MAC |
| 3631 | wants to set the beacon filters while in power save. |
| 3632 | Upon the call of this API the WLAN DAL will pack and |
| 3633 | send a Beacon filter request message to the |
| 3634 | lower RIVA sub-system. |
| 3635 | |
| 3636 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3637 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3638 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3639 | |
| 3640 | @param pwdiBeaconFilterReqParams: the beacon |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3641 | filter as specified by the Device |
| 3642 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3643 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3644 | wdiBeaconFilterCb: callback for passing back the |
| 3645 | response of the set beacon filter operation received |
| 3646 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3647 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3648 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3649 | callback |
| 3650 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3651 | @return Result of the function call |
| 3652 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3653 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3654 | WDI_SetBeaconFilterReq |
| 3655 | ( |
| 3656 | WDI_BeaconFilterReqParamsType *pwdiBeaconFilterReqParams, |
| 3657 | WDI_SetBeaconFilterCb wdiBeaconFilterCb, |
| 3658 | void* pUserData |
| 3659 | ) |
| 3660 | { |
| 3661 | WDI_EventInfoType wdiEventData; |
| 3662 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3663 | |
| 3664 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3665 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3666 | ------------------------------------------------------------------------*/ |
| 3667 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3668 | { |
| 3669 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3670 | "WDI API call before module is initialized - Fail request"); |
| 3671 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3672 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3673 | } |
| 3674 | |
| 3675 | /*------------------------------------------------------------------------ |
| 3676 | Fill in Event data and post to the Main FSM |
| 3677 | ------------------------------------------------------------------------*/ |
| 3678 | wdiEventData.wdiRequest = WDI_SET_BEACON_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3679 | wdiEventData.pEventData = pwdiBeaconFilterReqParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3680 | wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3681 | wdiEventData.pCBfnc = wdiBeaconFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3682 | wdiEventData.pUserData = pUserData; |
| 3683 | |
| 3684 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3685 | }/*WDI_SetBeaconFilterReq*/ |
| 3686 | |
| 3687 | /** |
| 3688 | @brief WDI_RemBeaconFilterReq will be called when the upper MAC |
| 3689 | wants to remove the beacon filter for particular IE |
| 3690 | while in power save. Upon the call of this API the WLAN |
| 3691 | DAL will pack and send a remove Beacon filter request |
| 3692 | message to the lower RIVA sub-system. |
| 3693 | |
| 3694 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3695 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3696 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3697 | |
| 3698 | @param pwdiBeaconFilterReqParams: the beacon |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3699 | filter as specified by the Device |
| 3700 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3701 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3702 | wdiBeaconFilterCb: callback for passing back the |
| 3703 | response of the remove beacon filter operation received |
| 3704 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3705 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3706 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3707 | callback |
| 3708 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3709 | @return Result of the function call |
| 3710 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3711 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3712 | WDI_RemBeaconFilterReq |
| 3713 | ( |
| 3714 | WDI_RemBeaconFilterReqParamsType *pwdiBeaconFilterReqParams, |
| 3715 | WDI_RemBeaconFilterCb wdiBeaconFilterCb, |
| 3716 | void* pUserData |
| 3717 | ) |
| 3718 | { |
| 3719 | WDI_EventInfoType wdiEventData; |
| 3720 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3721 | |
| 3722 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3723 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3724 | ------------------------------------------------------------------------*/ |
| 3725 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3726 | { |
| 3727 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3728 | "WDI API call before module is initialized - Fail request"); |
| 3729 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3730 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3731 | } |
| 3732 | |
| 3733 | /*------------------------------------------------------------------------ |
| 3734 | Fill in Event data and post to the Main FSM |
| 3735 | ------------------------------------------------------------------------*/ |
| 3736 | wdiEventData.wdiRequest = WDI_REM_BEACON_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3737 | wdiEventData.pEventData = pwdiBeaconFilterReqParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3738 | wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3739 | wdiEventData.pCBfnc = wdiBeaconFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3740 | wdiEventData.pUserData = pUserData; |
| 3741 | |
| 3742 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3743 | }/*WDI_RemBeaconFilterReq*/ |
| 3744 | |
| 3745 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3746 | @brief WDI_SetRSSIThresholdsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3747 | MAC wants to set the RSSI thresholds related |
| 3748 | configurations while in power save. Upon the call of |
| 3749 | this API the WLAN DAL will pack and send a HAL Set RSSI |
| 3750 | thresholds request message to the lower RIVA |
| 3751 | sub-system if DAL is in state STARTED. |
| 3752 | |
| 3753 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3754 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3755 | |
| 3756 | WDI_PostAssocReq must have been called. |
| 3757 | |
| 3758 | @param pwdiUapsdInfo: the UAPSD parameters as specified by |
| 3759 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3760 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3761 | wdiSetUapsdAcParamsCb: callback for passing back the |
| 3762 | response of the set UAPSD params operation received from |
| 3763 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3764 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3765 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3766 | callback |
| 3767 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3768 | @see WDI_PostAssocReq |
| 3769 | @return Result of the function call |
| 3770 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3771 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3772 | WDI_SetRSSIThresholdsReq |
| 3773 | ( |
| 3774 | WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams, |
| 3775 | WDI_SetRSSIThresholdsCb wdiSetRSSIThresholdsCb, |
| 3776 | void* pUserData |
| 3777 | ) |
| 3778 | { |
| 3779 | WDI_EventInfoType wdiEventData; |
| 3780 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3781 | |
| 3782 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3783 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3784 | ------------------------------------------------------------------------*/ |
| 3785 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3786 | { |
| 3787 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3788 | "WDI API call before module is initialized - Fail request"); |
| 3789 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3790 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3791 | } |
| 3792 | |
| 3793 | /*------------------------------------------------------------------------ |
| 3794 | Fill in Event data and post to the Main FSM |
| 3795 | ------------------------------------------------------------------------*/ |
| 3796 | wdiEventData.wdiRequest = WDI_SET_RSSI_THRESHOLDS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3797 | wdiEventData.pEventData = pwdiRSSIThresholdsParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3798 | wdiEventData.uEventDataSize = sizeof(*pwdiRSSIThresholdsParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3799 | wdiEventData.pCBfnc = wdiSetRSSIThresholdsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3800 | wdiEventData.pUserData = pUserData; |
| 3801 | |
| 3802 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3803 | }/* WDI_SetRSSIThresholdsReq*/ |
| 3804 | |
| 3805 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3806 | @brief WDI_HostOffloadReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3807 | wants to set the filter to minimize unnecessary host |
| 3808 | wakeup due to broadcast traffic while in power save. |
| 3809 | Upon the call of this API the WLAN DAL will pack and |
| 3810 | send a HAL host offload request message to the |
| 3811 | lower RIVA sub-system if DAL is in state STARTED. |
| 3812 | |
| 3813 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3814 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3815 | |
| 3816 | WDI_PostAssocReq must have been called. |
| 3817 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3818 | @param pwdiHostOffloadParams: the host offload as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3819 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3820 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3821 | wdiHostOffloadCb: callback for passing back the response |
| 3822 | of the host offload operation received from the |
| 3823 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3824 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3825 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3826 | callback |
| 3827 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3828 | @see WDI_PostAssocReq |
| 3829 | @return Result of the function call |
| 3830 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3831 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3832 | WDI_HostOffloadReq |
| 3833 | ( |
| 3834 | WDI_HostOffloadReqParamsType* pwdiHostOffloadParams, |
| 3835 | WDI_HostOffloadCb wdiHostOffloadCb, |
| 3836 | void* pUserData |
| 3837 | ) |
| 3838 | { |
| 3839 | WDI_EventInfoType wdiEventData; |
| 3840 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3841 | |
| 3842 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3843 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3844 | ------------------------------------------------------------------------*/ |
| 3845 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3846 | { |
| 3847 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3848 | "WDI API call before module is initialized - Fail request"); |
| 3849 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3850 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3851 | } |
| 3852 | |
| 3853 | /*------------------------------------------------------------------------ |
| 3854 | Fill in Event data and post to the Main FSM |
| 3855 | ------------------------------------------------------------------------*/ |
| 3856 | wdiEventData.wdiRequest = WDI_HOST_OFFLOAD_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3857 | wdiEventData.pEventData = pwdiHostOffloadParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3858 | wdiEventData.uEventDataSize = sizeof(*pwdiHostOffloadParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3859 | wdiEventData.pCBfnc = wdiHostOffloadCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3860 | wdiEventData.pUserData = pUserData; |
| 3861 | |
| 3862 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3863 | }/*WDI_HostOffloadReq*/ |
| 3864 | |
| 3865 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3866 | @brief WDI_KeepAliveReq will be called when the upper MAC |
| 3867 | wants to set the filter to send NULL or unsolicited ARP responses |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3868 | and minimize unnecessary host wakeups due to while in power save. |
| 3869 | Upon the call of this API the WLAN DAL will pack and |
| 3870 | send a HAL Keep Alive request message to the |
| 3871 | lower RIVA sub-system if DAL is in state STARTED. |
| 3872 | |
| 3873 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3874 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3875 | |
| 3876 | WDI_PostAssocReq must have been called. |
| 3877 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3878 | @param pwdiKeepAliveParams: the Keep Alive as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3879 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3880 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3881 | wdiKeepAliveCb: callback for passing back the response |
| 3882 | of the Keep Alive operation received from the |
| 3883 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3884 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3885 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3886 | callback |
| 3887 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3888 | @see WDI_PostAssocReq |
| 3889 | @return Result of the function call |
| 3890 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3891 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3892 | WDI_KeepAliveReq |
| 3893 | ( |
| 3894 | WDI_KeepAliveReqParamsType* pwdiKeepAliveParams, |
| 3895 | WDI_KeepAliveCb wdiKeepAliveCb, |
| 3896 | void* pUserData |
| 3897 | ) |
| 3898 | { |
| 3899 | WDI_EventInfoType wdiEventData; |
| 3900 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3901 | |
| 3902 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3903 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3904 | ------------------------------------------------------------------------*/ |
| 3905 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3906 | { |
| 3907 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3908 | "WDI_KeepAliveReq: WDI API call before module " |
| 3909 | "is initialized - Fail request"); |
| 3910 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3911 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3912 | } |
| 3913 | |
| 3914 | /*------------------------------------------------------------------------ |
| 3915 | Fill in Event data and post to the Main FSM |
| 3916 | ------------------------------------------------------------------------*/ |
| 3917 | wdiEventData.wdiRequest = WDI_KEEP_ALIVE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3918 | wdiEventData.pEventData = pwdiKeepAliveParams; |
| 3919 | wdiEventData.uEventDataSize = sizeof(*pwdiKeepAliveParams); |
| 3920 | wdiEventData.pCBfnc = wdiKeepAliveCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3921 | wdiEventData.pUserData = pUserData; |
| 3922 | |
| 3923 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3924 | }/*WDI_KeepAliveReq*/ |
| 3925 | |
| 3926 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3927 | @brief WDI_WowlAddBcPtrnReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3928 | wants to set the Wowl Bcast ptrn to minimize unnecessary |
| 3929 | host wakeup due to broadcast traffic while in power |
| 3930 | save. Upon the call of this API the WLAN DAL will pack |
| 3931 | and send a HAL Wowl Bcast ptrn request message to the |
| 3932 | lower RIVA sub-system if DAL is in state STARTED. |
| 3933 | |
| 3934 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3935 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3936 | |
| 3937 | WDI_PostAssocReq must have been called. |
| 3938 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3939 | @param pwdiWowlAddBcPtrnParams: the Wowl bcast ptrn as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3940 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3941 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3942 | wdiWowlAddBcPtrnCb: callback for passing back the |
| 3943 | response of the add Wowl bcast ptrn operation received |
| 3944 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3945 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3946 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3947 | callback |
| 3948 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3949 | @see WDI_PostAssocReq |
| 3950 | @return Result of the function call |
| 3951 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3952 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3953 | WDI_WowlAddBcPtrnReq |
| 3954 | ( |
| 3955 | WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams, |
| 3956 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb, |
| 3957 | void* pUserData |
| 3958 | ) |
| 3959 | { |
| 3960 | WDI_EventInfoType wdiEventData; |
| 3961 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3962 | |
| 3963 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3964 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3965 | ------------------------------------------------------------------------*/ |
| 3966 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3967 | { |
| 3968 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3969 | "WDI API call before module is initialized - Fail request"); |
| 3970 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3971 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3972 | } |
| 3973 | |
| 3974 | /*------------------------------------------------------------------------ |
| 3975 | Fill in Event data and post to the Main FSM |
| 3976 | ------------------------------------------------------------------------*/ |
| 3977 | wdiEventData.wdiRequest = WDI_WOWL_ADD_BC_PTRN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3978 | wdiEventData.pEventData = pwdiWowlAddBcPtrnParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3979 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlAddBcPtrnParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3980 | wdiEventData.pCBfnc = wdiWowlAddBcPtrnCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3981 | wdiEventData.pUserData = pUserData; |
| 3982 | |
| 3983 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3984 | }/*WDI_WowlAddBcPtrnReq*/ |
| 3985 | |
| 3986 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3987 | @brief WDI_WowlDelBcPtrnReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3988 | wants to clear the Wowl Bcast ptrn. Upon the call of |
| 3989 | this API the WLAN DAL will pack and send a HAL delete |
| 3990 | Wowl Bcast ptrn request message to the lower RIVA |
| 3991 | sub-system if DAL is in state STARTED. |
| 3992 | |
| 3993 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3994 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3995 | |
| 3996 | WDI_WowlAddBcPtrnReq must have been called. |
| 3997 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3998 | @param pwdiWowlDelBcPtrnParams: the Wowl bcast ptrn as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3999 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4000 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4001 | wdiWowlDelBcPtrnCb: callback for passing back the |
| 4002 | response of the del Wowl bcast ptrn operation received |
| 4003 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4004 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4005 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4006 | callback |
| 4007 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4008 | @see WDI_WowlAddBcPtrnReq |
| 4009 | @return Result of the function call |
| 4010 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4011 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4012 | WDI_WowlDelBcPtrnReq |
| 4013 | ( |
| 4014 | WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams, |
| 4015 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb, |
| 4016 | void* pUserData |
| 4017 | ) |
| 4018 | { |
| 4019 | WDI_EventInfoType wdiEventData; |
| 4020 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4021 | |
| 4022 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4023 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4024 | ------------------------------------------------------------------------*/ |
| 4025 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4026 | { |
| 4027 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4028 | "WDI API call before module is initialized - Fail request"); |
| 4029 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4030 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4031 | } |
| 4032 | |
| 4033 | /*------------------------------------------------------------------------ |
| 4034 | Fill in Event data and post to the Main FSM |
| 4035 | ------------------------------------------------------------------------*/ |
| 4036 | wdiEventData.wdiRequest = WDI_WOWL_DEL_BC_PTRN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4037 | wdiEventData.pEventData = pwdiWowlDelBcPtrnParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 4038 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlDelBcPtrnParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4039 | wdiEventData.pCBfnc = wdiWowlDelBcPtrnCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4040 | wdiEventData.pUserData = pUserData; |
| 4041 | |
| 4042 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4043 | }/*WDI_WowlDelBcPtrnReq*/ |
| 4044 | |
| 4045 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4046 | @brief WDI_WowlEnterReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4047 | wants to enter the Wowl state to minimize unnecessary |
| 4048 | host wakeup while in power save. Upon the call of this |
| 4049 | API the WLAN DAL will pack and send a HAL Wowl enter |
| 4050 | request message to the lower RIVA sub-system if DAL is |
| 4051 | in state STARTED. |
| 4052 | |
| 4053 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4054 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4055 | |
| 4056 | WDI_PostAssocReq must have been called. |
| 4057 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4058 | @param pwdiWowlEnterReqParams: the Wowl enter info as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4059 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4060 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4061 | wdiWowlEnterReqCb: callback for passing back the |
| 4062 | response of the enter Wowl operation received from the |
| 4063 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4064 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4065 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4066 | callback |
| 4067 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4068 | @see WDI_PostAssocReq |
| 4069 | @return Result of the function call |
| 4070 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4071 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4072 | WDI_WowlEnterReq |
| 4073 | ( |
| 4074 | WDI_WowlEnterReqParamsType* pwdiWowlEnterParams, |
| 4075 | WDI_WowlEnterReqCb wdiWowlEnterCb, |
| 4076 | void* pUserData |
| 4077 | ) |
| 4078 | { |
| 4079 | WDI_EventInfoType wdiEventData; |
| 4080 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4081 | |
| 4082 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4083 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4084 | ------------------------------------------------------------------------*/ |
| 4085 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4086 | { |
| 4087 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4088 | "WDI API call before module is initialized - Fail request"); |
| 4089 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4090 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4091 | } |
| 4092 | |
| 4093 | /*------------------------------------------------------------------------ |
| 4094 | Fill in Event data and post to the Main FSM |
| 4095 | ------------------------------------------------------------------------*/ |
| 4096 | wdiEventData.wdiRequest = WDI_WOWL_ENTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4097 | wdiEventData.pEventData = pwdiWowlEnterParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 4098 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlEnterParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4099 | wdiEventData.pCBfnc = wdiWowlEnterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4100 | wdiEventData.pUserData = pUserData; |
| 4101 | |
| 4102 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4103 | }/*WDI_WowlEnterReq*/ |
| 4104 | |
| 4105 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4106 | @brief WDI_WowlExitReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4107 | wants to exit the Wowl state. Upon the call of this API |
| 4108 | the WLAN DAL will pack and send a HAL Wowl exit request |
| 4109 | message to the lower RIVA sub-system if DAL is in state |
| 4110 | STARTED. |
| 4111 | |
| 4112 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4113 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4114 | |
| 4115 | WDI_WowlEnterReq must have been called. |
| 4116 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4117 | @param pwdiWowlExitReqParams: the Wowl exit info as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4118 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4119 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4120 | wdiWowlExitReqCb: callback for passing back the response |
| 4121 | of the exit Wowl operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4122 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4123 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4124 | callback |
| 4125 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4126 | @see WDI_WowlEnterReq |
| 4127 | @return Result of the function call |
| 4128 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4129 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4130 | WDI_WowlExitReq |
| 4131 | ( |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4132 | WDI_WowlExitReqParamsType* pwdiWowlExitParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4133 | WDI_WowlExitReqCb wdiWowlExitCb, |
| 4134 | void* pUserData |
| 4135 | ) |
| 4136 | { |
| 4137 | WDI_EventInfoType wdiEventData; |
| 4138 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4139 | |
| 4140 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4141 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4142 | ------------------------------------------------------------------------*/ |
| 4143 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4144 | { |
| 4145 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4146 | "WDI API call before module is initialized - Fail request"); |
| 4147 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4148 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4149 | } |
| 4150 | |
| 4151 | /*------------------------------------------------------------------------ |
| 4152 | Fill in Event data and post to the Main FSM |
| 4153 | ------------------------------------------------------------------------*/ |
| 4154 | wdiEventData.wdiRequest = WDI_WOWL_EXIT_REQ; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4155 | wdiEventData.pEventData = pwdiWowlExitParams; |
| 4156 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlExitParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4157 | wdiEventData.pCBfnc = wdiWowlExitCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4158 | wdiEventData.pUserData = pUserData; |
| 4159 | |
| 4160 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4161 | }/*WDI_WowlExitReq*/ |
| 4162 | |
| 4163 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4164 | @brief WDI_ConfigureAppsCpuWakeupStateReq will be called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4165 | the upper MAC wants to dynamically adjusts the listen |
| 4166 | interval based on the WLAN/MSM activity. Upon the call |
| 4167 | of this API the WLAN DAL will pack and send a HAL |
| 4168 | configure Apps Cpu Wakeup State request message to the |
| 4169 | lower RIVA sub-system. |
| 4170 | |
| 4171 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4172 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4173 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4174 | |
| 4175 | @param pwdiConfigureAppsCpuWakeupStateReqParams: the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4176 | Apps Cpu Wakeup State as specified by the |
| 4177 | Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4178 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4179 | wdiConfigureAppsCpuWakeupStateCb: callback for passing |
| 4180 | back the response of the configure Apps Cpu Wakeup State |
| 4181 | operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4182 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4183 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4184 | callback |
| 4185 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4186 | @return Result of the function call |
| 4187 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4188 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4189 | WDI_ConfigureAppsCpuWakeupStateReq |
| 4190 | ( |
| 4191 | WDI_ConfigureAppsCpuWakeupStateReqParamsType *pwdiConfigureAppsCpuWakeupStateReqParams, |
| 4192 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb, |
| 4193 | void* pUserData |
| 4194 | ) |
| 4195 | { |
| 4196 | WDI_EventInfoType wdiEventData; |
| 4197 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4198 | |
| 4199 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4200 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4201 | ------------------------------------------------------------------------*/ |
| 4202 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4203 | { |
| 4204 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4205 | "WDI API call before module is initialized - Fail request"); |
| 4206 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4207 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4208 | } |
| 4209 | |
| 4210 | /*------------------------------------------------------------------------ |
| 4211 | Fill in Event data and post to the Main FSM |
| 4212 | ------------------------------------------------------------------------*/ |
| 4213 | wdiEventData.wdiRequest = WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4214 | wdiEventData.pEventData = pwdiConfigureAppsCpuWakeupStateReqParams; |
| 4215 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigureAppsCpuWakeupStateReqParams); |
| 4216 | wdiEventData.pCBfnc = wdiConfigureAppsCpuWakeupStateCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4217 | wdiEventData.pUserData = pUserData; |
| 4218 | |
| 4219 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4220 | }/*WDI_ConfigureAppsCpuWakeupStateReq*/ |
| 4221 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4222 | @brief WDI_FlushAcReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4223 | to to perform a flush operation on a given AC. Upon the |
| 4224 | call of this API the WLAN DAL will pack and send a HAL |
| 4225 | Flush AC request message to the lower RIVA sub-system if |
| 4226 | DAL is in state STARTED. |
| 4227 | |
| 4228 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4229 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4230 | |
| 4231 | WDI_AddBAReq must have been called. |
| 4232 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4233 | @param pwdiFlushAcReqParams: the Flush AC parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4234 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4235 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4236 | wdiFlushAcRspCb: callback for passing back the response |
| 4237 | of the Flush AC operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4238 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4239 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4240 | callback |
| 4241 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4242 | @see WDI_AddBAReq |
| 4243 | @return Result of the function call |
| 4244 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4245 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4246 | WDI_FlushAcReq |
| 4247 | ( |
| 4248 | WDI_FlushAcReqParamsType* pwdiFlushAcReqParams, |
| 4249 | WDI_FlushAcRspCb wdiFlushAcRspCb, |
| 4250 | void* pUserData |
| 4251 | ) |
| 4252 | { |
| 4253 | WDI_EventInfoType wdiEventData; |
| 4254 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4255 | |
| 4256 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4257 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4258 | ------------------------------------------------------------------------*/ |
| 4259 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4260 | { |
| 4261 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4262 | "WDI API call before module is initialized - Fail request"); |
| 4263 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4264 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4265 | } |
| 4266 | |
| 4267 | /*------------------------------------------------------------------------ |
| 4268 | Fill in Event data and post to the Main FSM |
| 4269 | ------------------------------------------------------------------------*/ |
| 4270 | wdiEventData.wdiRequest = WDI_FLUSH_AC_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4271 | wdiEventData.pEventData = pwdiFlushAcReqParams; |
| 4272 | wdiEventData.uEventDataSize = sizeof(*pwdiFlushAcReqParams); |
| 4273 | wdiEventData.pCBfnc = wdiFlushAcRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4274 | wdiEventData.pUserData = pUserData; |
| 4275 | |
| 4276 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4277 | |
| 4278 | }/*WDI_FlushAcReq*/ |
| 4279 | |
| 4280 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4281 | @brief WDI_BtAmpEventReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4282 | wants to notify the lower mac on a BT AMP event. This is |
| 4283 | to inform BTC-SLM that some BT AMP event occurred. Upon |
| 4284 | the call of this API the WLAN DAL will pack and send a |
| 4285 | HAL BT AMP event request message to the lower RIVA |
| 4286 | sub-system if DAL is in state STARTED. |
| 4287 | |
| 4288 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4289 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4290 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4291 | |
| 4292 | @param wdiBtAmpEventReqParams: the BT AMP event parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4293 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4294 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4295 | wdiBtAmpEventRspCb: callback for passing back the |
| 4296 | response of the BT AMP event operation received from the |
| 4297 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4298 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4299 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4300 | callback |
| 4301 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4302 | @return Result of the function call |
| 4303 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4304 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4305 | WDI_BtAmpEventReq |
| 4306 | ( |
| 4307 | WDI_BtAmpEventParamsType* pwdiBtAmpEventReqParams, |
| 4308 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb, |
| 4309 | void* pUserData |
| 4310 | ) |
| 4311 | { |
| 4312 | WDI_EventInfoType wdiEventData; |
| 4313 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4314 | |
| 4315 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4316 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4317 | ------------------------------------------------------------------------*/ |
| 4318 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4319 | { |
| 4320 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4321 | "WDI API call before module is initialized - Fail request"); |
| 4322 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4323 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4324 | } |
| 4325 | |
| 4326 | /*------------------------------------------------------------------------ |
| 4327 | Fill in Event data and post to the Main FSM |
| 4328 | ------------------------------------------------------------------------*/ |
| 4329 | wdiEventData.wdiRequest = WDI_BTAMP_EVENT_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4330 | wdiEventData.pEventData = pwdiBtAmpEventReqParams; |
| 4331 | wdiEventData.uEventDataSize = sizeof(*pwdiBtAmpEventReqParams); |
| 4332 | wdiEventData.pCBfnc = wdiBtAmpEventRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4333 | wdiEventData.pUserData = pUserData; |
| 4334 | |
| 4335 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4336 | |
| 4337 | }/*WDI_BtAmpEventReq*/ |
| 4338 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4339 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 4340 | /** |
| 4341 | @brief WDI_Start Oem Data Req will be called when the upper MAC |
| 4342 | wants to notify the lower mac on a oem data Req event.Upon |
| 4343 | the call of this API the WLAN DAL will pack and send a |
| 4344 | HAL OEM Data Req event request message to the lower RIVA |
| 4345 | sub-system if DAL is in state STARTED. |
| 4346 | |
| 4347 | In state BUSY this request will be queued. Request won't |
| 4348 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4349 | |
| 4350 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4351 | |
| 4352 | @param pwdiOemDataReqParams: the Oem Data Req as |
| 4353 | specified by the Device Interface |
| 4354 | |
| 4355 | wdiStartOemDataRspCb: callback for passing back the |
| 4356 | response of the Oem Data Req received from the |
| 4357 | device |
| 4358 | |
| 4359 | pUserData: user data will be passed back with the |
| 4360 | callback |
| 4361 | |
| 4362 | @return Result of the function call |
| 4363 | */ |
| 4364 | WDI_Status |
| 4365 | WDI_StartOemDataReq |
| 4366 | ( |
| 4367 | WDI_oemDataReqParamsType* pwdiOemDataReqParams, |
| 4368 | WDI_oemDataRspCb wdiOemDataRspCb, |
| 4369 | void* pUserData |
| 4370 | ) |
| 4371 | { |
| 4372 | WDI_EventInfoType wdiEventData; |
| 4373 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4374 | |
| 4375 | /*------------------------------------------------------------------------ |
| 4376 | Sanity Check |
| 4377 | ------------------------------------------------------------------------*/ |
| 4378 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4379 | { |
| 4380 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4381 | "WDI API call before module is initialized - Fail request"); |
| 4382 | |
| 4383 | return WDI_STATUS_E_NOT_ALLOWED; |
| 4384 | } |
| 4385 | |
| 4386 | /*------------------------------------------------------------------------ |
| 4387 | Fill in Event data and post to the Main FSM |
| 4388 | ------------------------------------------------------------------------*/ |
| 4389 | wdiEventData.wdiRequest = WDI_START_OEM_DATA_REQ; |
| 4390 | wdiEventData.pEventData = pwdiOemDataReqParams; |
| 4391 | wdiEventData.uEventDataSize = sizeof(*pwdiOemDataReqParams); |
| 4392 | wdiEventData.pCBfnc = wdiOemDataRspCb; |
| 4393 | wdiEventData.pUserData = pUserData; |
| 4394 | |
| 4395 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4396 | |
| 4397 | |
| 4398 | } |
| 4399 | |
| 4400 | #endif |
| 4401 | |
| 4402 | |
| 4403 | /*======================================================================== |
| 4404 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4405 | CONTROL APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4406 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4407 | ==========================================================================*/ |
| 4408 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4409 | @brief WDI_SwitchChReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4410 | the WLAN HW to change the current channel of operation. |
| 4411 | Upon the call of this API the WLAN DAL will pack and |
| 4412 | send a HAL Start request message to the lower RIVA |
| 4413 | sub-system if DAL is in state STARTED. |
| 4414 | |
| 4415 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4416 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4417 | |
| 4418 | WDI_Start must have been called. |
| 4419 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4420 | @param wdiSwitchChReqParams: the switch ch parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4421 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4422 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4423 | wdiSwitchChRspCb: callback for passing back the response |
| 4424 | of the switch ch operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4425 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4426 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4427 | callback |
| 4428 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4429 | @see WDI_Start |
| 4430 | @return Result of the function call |
| 4431 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4432 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4433 | WDI_SwitchChReq |
| 4434 | ( |
| 4435 | WDI_SwitchChReqParamsType* pwdiSwitchChReqParams, |
| 4436 | WDI_SwitchChRspCb wdiSwitchChRspCb, |
| 4437 | void* pUserData |
| 4438 | ) |
| 4439 | { |
| 4440 | WDI_EventInfoType wdiEventData; |
| 4441 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4442 | |
| 4443 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4444 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4445 | ------------------------------------------------------------------------*/ |
| 4446 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4447 | { |
| 4448 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4449 | "WDI API call before module is initialized - Fail request"); |
| 4450 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4451 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4452 | } |
| 4453 | |
| 4454 | /*------------------------------------------------------------------------ |
| 4455 | Fill in Event data and post to the Main FSM |
| 4456 | ------------------------------------------------------------------------*/ |
| 4457 | wdiEventData.wdiRequest = WDI_CH_SWITCH_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4458 | wdiEventData.pEventData = pwdiSwitchChReqParams; |
| 4459 | wdiEventData.uEventDataSize = sizeof(*pwdiSwitchChReqParams); |
| 4460 | wdiEventData.pCBfnc = wdiSwitchChRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4461 | wdiEventData.pUserData = pUserData; |
| 4462 | |
| 4463 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4464 | |
| 4465 | }/*WDI_SwitchChReq*/ |
| 4466 | |
| 4467 | |
| 4468 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4469 | @brief WDI_ConfigSTAReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4470 | wishes to add or update a STA in HW. Upon the call of |
| 4471 | this API the WLAN DAL will pack and send a HAL Start |
| 4472 | message request message to the lower RIVA sub-system if |
| 4473 | DAL is in state STARTED. |
| 4474 | |
| 4475 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4476 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4477 | |
| 4478 | WDI_Start must have been called. |
| 4479 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4480 | @param wdiConfigSTAReqParams: the config STA parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4481 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4482 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4483 | wdiConfigSTARspCb: callback for passing back the |
| 4484 | response of the config STA operation received from the |
| 4485 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4486 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4487 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4488 | callback |
| 4489 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4490 | @see WDI_Start |
| 4491 | @return Result of the function call |
| 4492 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4493 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4494 | WDI_ConfigSTAReq |
| 4495 | ( |
| 4496 | WDI_ConfigSTAReqParamsType* pwdiConfigSTAReqParams, |
| 4497 | WDI_ConfigSTARspCb wdiConfigSTARspCb, |
| 4498 | void* pUserData |
| 4499 | ) |
| 4500 | { |
| 4501 | WDI_EventInfoType wdiEventData; |
| 4502 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4503 | |
| 4504 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4505 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4506 | ------------------------------------------------------------------------*/ |
| 4507 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4508 | { |
| 4509 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4510 | "WDI API call before module is initialized - Fail request"); |
| 4511 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4512 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4513 | } |
| 4514 | |
| 4515 | /*------------------------------------------------------------------------ |
| 4516 | Fill in Event data and post to the Main FSM |
| 4517 | ------------------------------------------------------------------------*/ |
| 4518 | wdiEventData.wdiRequest = WDI_CONFIG_STA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4519 | wdiEventData.pEventData = pwdiConfigSTAReqParams; |
| 4520 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigSTAReqParams); |
| 4521 | wdiEventData.pCBfnc = wdiConfigSTARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4522 | wdiEventData.pUserData = pUserData; |
| 4523 | |
| 4524 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4525 | |
| 4526 | }/*WDI_ConfigSTAReq*/ |
| 4527 | |
| 4528 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4529 | @brief WDI_SetLinkStateReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4530 | wants to change the state of an ongoing link. Upon the |
| 4531 | call of this API the WLAN DAL will pack and send a HAL |
| 4532 | Start message request message to the lower RIVA |
| 4533 | sub-system if DAL is in state STARTED. |
| 4534 | |
| 4535 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4536 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4537 | |
| 4538 | WDI_JoinStartReq must have been called. |
| 4539 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4540 | @param wdiSetLinkStateReqParams: the set link state parameters |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4541 | as specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4542 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4543 | wdiSetLinkStateRspCb: callback for passing back the |
| 4544 | response of the set link state operation received from |
| 4545 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4546 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4547 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4548 | callback |
| 4549 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4550 | @see WDI_JoinStartReq |
| 4551 | @return Result of the function call |
| 4552 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4553 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4554 | WDI_SetLinkStateReq |
| 4555 | ( |
| 4556 | WDI_SetLinkReqParamsType* pwdiSetLinkStateReqParams, |
| 4557 | WDI_SetLinkStateRspCb wdiSetLinkStateRspCb, |
| 4558 | void* pUserData |
| 4559 | ) |
| 4560 | { |
| 4561 | WDI_EventInfoType wdiEventData; |
| 4562 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4563 | |
| 4564 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4565 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4566 | ------------------------------------------------------------------------*/ |
| 4567 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4568 | { |
| 4569 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4570 | "WDI API call before module is initialized - Fail request"); |
| 4571 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4572 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4573 | } |
| 4574 | |
| 4575 | /*------------------------------------------------------------------------ |
| 4576 | Fill in Event data and post to the Main FSM |
| 4577 | ------------------------------------------------------------------------*/ |
| 4578 | wdiEventData.wdiRequest = WDI_SET_LINK_ST_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4579 | wdiEventData.pEventData = pwdiSetLinkStateReqParams; |
| 4580 | wdiEventData.uEventDataSize = sizeof(*pwdiSetLinkStateReqParams); |
| 4581 | wdiEventData.pCBfnc = wdiSetLinkStateRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4582 | wdiEventData.pUserData = pUserData; |
| 4583 | |
| 4584 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4585 | |
| 4586 | }/*WDI_SetLinkStateReq*/ |
| 4587 | |
| 4588 | |
| 4589 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4590 | @brief WDI_GetStatsReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4591 | to get statistics (MIB counters) from the device. Upon |
| 4592 | the call of this API the WLAN DAL will pack and send a |
| 4593 | HAL Start request message to the lower RIVA sub-system |
| 4594 | if DAL is in state STARTED. |
| 4595 | |
| 4596 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4597 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4598 | |
| 4599 | WDI_Start must have been called. |
| 4600 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4601 | @param wdiGetStatsReqParams: the stats parameters to get as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4602 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4603 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4604 | wdiGetStatsRspCb: callback for passing back the response |
| 4605 | of the get stats operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4606 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4607 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4608 | callback |
| 4609 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4610 | @see WDI_Start |
| 4611 | @return Result of the function call |
| 4612 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4613 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4614 | WDI_GetStatsReq |
| 4615 | ( |
| 4616 | WDI_GetStatsReqParamsType* pwdiGetStatsReqParams, |
| 4617 | WDI_GetStatsRspCb wdiGetStatsRspCb, |
| 4618 | void* pUserData |
| 4619 | ) |
| 4620 | { |
| 4621 | WDI_EventInfoType wdiEventData; |
| 4622 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4623 | |
| 4624 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4625 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4626 | ------------------------------------------------------------------------*/ |
| 4627 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4628 | { |
| 4629 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4630 | "WDI API call before module is initialized - Fail request"); |
| 4631 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4632 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4633 | } |
| 4634 | |
| 4635 | /*------------------------------------------------------------------------ |
| 4636 | Fill in Event data and post to the Main FSM |
| 4637 | ------------------------------------------------------------------------*/ |
| 4638 | wdiEventData.wdiRequest = WDI_GET_STATS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4639 | wdiEventData.pEventData = pwdiGetStatsReqParams; |
| 4640 | wdiEventData.uEventDataSize = sizeof(*pwdiGetStatsReqParams); |
| 4641 | wdiEventData.pCBfnc = wdiGetStatsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4642 | wdiEventData.pUserData = pUserData; |
| 4643 | |
| 4644 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4645 | |
| 4646 | }/*WDI_GetStatsReq*/ |
| 4647 | |
| 4648 | |
| 4649 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4650 | @brief WDI_UpdateCfgReq will be called when the upper MAC when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4651 | it wishes to change the configuration of the WLAN |
| 4652 | Device. Upon the call of this API the WLAN DAL will pack |
| 4653 | and send a HAL Update CFG request message to the lower |
| 4654 | RIVA sub-system if DAL is in state STARTED. |
| 4655 | |
| 4656 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4657 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4658 | |
| 4659 | WDI_Start must have been called. |
| 4660 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4661 | @param wdiUpdateCfgReqParams: the update cfg parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4662 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4663 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4664 | wdiUpdateCfgsRspCb: callback for passing back the |
| 4665 | response of the update cfg operation received from the |
| 4666 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4667 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4668 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4669 | callback |
| 4670 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4671 | @see WDI_Start |
| 4672 | @return Result of the function call |
| 4673 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4674 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4675 | WDI_UpdateCfgReq |
| 4676 | ( |
| 4677 | WDI_UpdateCfgReqParamsType* pwdiUpdateCfgReqParams, |
| 4678 | WDI_UpdateCfgRspCb wdiUpdateCfgsRspCb, |
| 4679 | void* pUserData |
| 4680 | ) |
| 4681 | { |
| 4682 | WDI_EventInfoType wdiEventData; |
| 4683 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4684 | |
| 4685 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4686 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4687 | ------------------------------------------------------------------------*/ |
| 4688 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4689 | { |
| 4690 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4691 | "WDI API call before module is initialized - Fail request"); |
| 4692 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4693 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4694 | } |
| 4695 | |
| 4696 | /*------------------------------------------------------------------------ |
| 4697 | Fill in Event data and post to the Main FSM |
| 4698 | ------------------------------------------------------------------------*/ |
| 4699 | wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4700 | wdiEventData.pEventData = pwdiUpdateCfgReqParams; |
| 4701 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateCfgReqParams); |
| 4702 | wdiEventData.pCBfnc = wdiUpdateCfgsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4703 | wdiEventData.pUserData = pUserData; |
| 4704 | |
| 4705 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4706 | |
| 4707 | }/*WDI_UpdateCfgReq*/ |
| 4708 | |
| 4709 | |
| 4710 | |
| 4711 | /** |
| 4712 | @brief WDI_AddBAReq will be called when the upper MAC has setup |
| 4713 | successfully a BA session and needs to notify the HW for |
| 4714 | the appropriate settings to take place. Upon the call of |
| 4715 | this API the WLAN DAL will pack and send a HAL Add BA |
| 4716 | request message to the lower RIVA sub-system if DAL is |
| 4717 | in state STARTED. |
| 4718 | |
| 4719 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4720 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4721 | |
| 4722 | WDI_PostAssocReq must have been called. |
| 4723 | |
| 4724 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 4725 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4726 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4727 | wdiAddBARspCb: callback for passing back the response of |
| 4728 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4729 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4730 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4731 | callback |
| 4732 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4733 | @see WDI_PostAssocReq |
| 4734 | @return Result of the function call |
| 4735 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4736 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4737 | WDI_AddBAReq |
| 4738 | ( |
| 4739 | WDI_AddBAReqParamsType* pwdiAddBAReqParams, |
| 4740 | WDI_AddBARspCb wdiAddBARspCb, |
| 4741 | void* pUserData |
| 4742 | ) |
| 4743 | { |
| 4744 | WDI_EventInfoType wdiEventData; |
| 4745 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4746 | |
| 4747 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4748 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4749 | ------------------------------------------------------------------------*/ |
| 4750 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4751 | { |
| 4752 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4753 | "WDI API call before module is initialized - Fail request"); |
| 4754 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4755 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4756 | } |
| 4757 | |
| 4758 | /*------------------------------------------------------------------------ |
| 4759 | Fill in Event data and post to the Main FSM |
| 4760 | ------------------------------------------------------------------------*/ |
| 4761 | wdiEventData.wdiRequest = WDI_ADD_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4762 | wdiEventData.pEventData = pwdiAddBAReqParams; |
| 4763 | wdiEventData.uEventDataSize = sizeof(*pwdiAddBAReqParams); |
| 4764 | wdiEventData.pCBfnc = wdiAddBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4765 | wdiEventData.pUserData = pUserData; |
| 4766 | |
| 4767 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4768 | |
| 4769 | }/*WDI_AddBAReq*/ |
| 4770 | |
| 4771 | |
| 4772 | /** |
| 4773 | @brief WDI_TriggerBAReq will be called when the upper MAC has setup |
| 4774 | successfully a BA session and needs to notify the HW for |
| 4775 | the appropriate settings to take place. Upon the call of |
| 4776 | this API the WLAN DAL will pack and send a HAL Add BA |
| 4777 | request message to the lower RIVA sub-system if DAL is |
| 4778 | in state STARTED. |
| 4779 | |
| 4780 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4781 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4782 | |
| 4783 | WDI_PostAssocReq must have been called. |
| 4784 | |
| 4785 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 4786 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4787 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4788 | wdiAddBARspCb: callback for passing back the response of |
| 4789 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4790 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4791 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4792 | callback |
| 4793 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4794 | @see WDI_PostAssocReq |
| 4795 | @return Result of the function call |
| 4796 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4797 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4798 | WDI_TriggerBAReq |
| 4799 | ( |
| 4800 | WDI_TriggerBAReqParamsType* pwdiTriggerBAReqParams, |
| 4801 | WDI_TriggerBARspCb wdiTriggerBARspCb, |
| 4802 | void* pUserData |
| 4803 | ) |
| 4804 | { |
| 4805 | WDI_EventInfoType wdiEventData; |
| 4806 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4807 | |
| 4808 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4809 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4810 | ------------------------------------------------------------------------*/ |
| 4811 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4812 | { |
| 4813 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4814 | "WDI API call before module is initialized - Fail request"); |
| 4815 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4816 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4817 | } |
| 4818 | |
| 4819 | /*------------------------------------------------------------------------ |
| 4820 | Fill in Event data and post to the Main FSM |
| 4821 | ------------------------------------------------------------------------*/ |
| 4822 | wdiEventData.wdiRequest = WDI_TRIGGER_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4823 | wdiEventData.pEventData = pwdiTriggerBAReqParams; |
| 4824 | wdiEventData.uEventDataSize = sizeof(*pwdiTriggerBAReqParams); |
| 4825 | wdiEventData.pCBfnc = wdiTriggerBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4826 | wdiEventData.pUserData = pUserData; |
| 4827 | |
| 4828 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4829 | |
| 4830 | }/*WDI_AddBAReq*/ |
| 4831 | |
| 4832 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4833 | @brief WDI_UpdateBeaconParamsReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4834 | wishes to update any of the Beacon parameters used by HW. |
| 4835 | Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon Params request |
| 4836 | message to the lower RIVA sub-system if DAL is in state |
| 4837 | STARTED. |
| 4838 | |
| 4839 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4840 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4841 | |
| 4842 | WDI_PostAssocReq must have been called. |
| 4843 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4844 | @param wdiUpdateBeaconParams: the Beacon parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4845 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4846 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4847 | wdiUpdateBeaconParamsRspCb: callback for passing back the |
| 4848 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4849 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4850 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4851 | callback |
| 4852 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4853 | @see WDI_PostAssocReq |
| 4854 | @return Result of the function call |
| 4855 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4856 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4857 | WDI_UpdateBeaconParamsReq |
| 4858 | ( |
| 4859 | WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams, |
| 4860 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb, |
| 4861 | void* pUserData |
| 4862 | ) |
| 4863 | { |
| 4864 | WDI_EventInfoType wdiEventData; |
| 4865 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4866 | |
| 4867 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4868 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4869 | ------------------------------------------------------------------------*/ |
| 4870 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4871 | { |
| 4872 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4873 | "WDI API call before module is initialized - Fail request"); |
| 4874 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4875 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4876 | } |
| 4877 | |
| 4878 | /*------------------------------------------------------------------------ |
| 4879 | Fill in Event data and post to the Main FSM |
| 4880 | ------------------------------------------------------------------------*/ |
| 4881 | wdiEventData.wdiRequest = WDI_UPD_BCON_PRMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4882 | wdiEventData.pEventData = pwdiUpdateBeaconParams; |
| 4883 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateBeaconParams); |
| 4884 | wdiEventData.pCBfnc = wdiUpdateBeaconParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4885 | wdiEventData.pUserData = pUserData; |
| 4886 | |
| 4887 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4888 | |
| 4889 | }/*WDI_UpdateBeaconParamsReq*/ |
| 4890 | |
| 4891 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4892 | @brief WDI_SendBeaconParamsReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4893 | wishes to update the Beacon template used by HW. |
| 4894 | Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon template request |
| 4895 | message to the lower RIVA sub-system if DAL is in state |
| 4896 | STARTED. |
| 4897 | |
| 4898 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4899 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4900 | |
| 4901 | WDI_PostAssocReq must have been called. |
| 4902 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4903 | @param wdiSendBeaconParams: the Beacon parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4904 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4905 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4906 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 4907 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4908 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4909 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4910 | callback |
| 4911 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4912 | @see WDI_PostAssocReq |
| 4913 | @return Result of the function call |
| 4914 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4915 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4916 | WDI_SendBeaconParamsReq |
| 4917 | ( |
| 4918 | WDI_SendBeaconParamsType* pwdiSendBeaconParams, |
| 4919 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb, |
| 4920 | void* pUserData |
| 4921 | ) |
| 4922 | { |
| 4923 | WDI_EventInfoType wdiEventData; |
| 4924 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4925 | |
| 4926 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4927 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4928 | ------------------------------------------------------------------------*/ |
| 4929 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4930 | { |
| 4931 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4932 | "WDI API call before module is initialized - Fail request"); |
| 4933 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4934 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4935 | } |
| 4936 | |
| 4937 | /*------------------------------------------------------------------------ |
| 4938 | Fill in Event data and post to the Main FSM |
| 4939 | ------------------------------------------------------------------------*/ |
| 4940 | wdiEventData.wdiRequest = WDI_SND_BCON_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4941 | wdiEventData.pEventData = pwdiSendBeaconParams; |
| 4942 | wdiEventData.uEventDataSize = sizeof(*pwdiSendBeaconParams); |
| 4943 | wdiEventData.pCBfnc = wdiSendBeaconParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4944 | wdiEventData.pUserData = pUserData; |
| 4945 | |
| 4946 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4947 | |
| 4948 | }/*WDI_SendBeaconParamsReq*/ |
| 4949 | |
| 4950 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4951 | @brief WDI_UpdateProbeRspTemplateReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4952 | upper MAC wants to update the probe response template to |
| 4953 | be transmitted as Soft AP |
| 4954 | Upon the call of this API the WLAN DAL will |
| 4955 | pack and send the probe rsp template message to the |
| 4956 | lower RIVA sub-system if DAL is in state STARTED. |
| 4957 | |
| 4958 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4959 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4960 | |
| 4961 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4962 | @param pwdiUpdateProbeRspParams: the Update Beacon parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4963 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4964 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4965 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 4966 | response of the Send Beacon Params operation received |
| 4967 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4968 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4969 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4970 | callback |
| 4971 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4972 | @see WDI_AddBAReq |
| 4973 | @return Result of the function call |
| 4974 | */ |
| 4975 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4976 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4977 | WDI_UpdateProbeRspTemplateReq |
| 4978 | ( |
| 4979 | WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRspParams, |
| 4980 | WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRspParamsRspCb, |
| 4981 | void* pUserData |
| 4982 | ) |
| 4983 | { |
| 4984 | WDI_EventInfoType wdiEventData; |
| 4985 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4986 | |
| 4987 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4988 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4989 | ------------------------------------------------------------------------*/ |
| 4990 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4991 | { |
| 4992 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4993 | "WDI API call before module is initialized - Fail request"); |
| 4994 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4995 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4996 | } |
| 4997 | |
| 4998 | /*------------------------------------------------------------------------ |
| 4999 | Fill in Event data and post to the Main FSM |
| 5000 | ------------------------------------------------------------------------*/ |
| 5001 | wdiEventData.wdiRequest = WDI_UPD_PROBE_RSP_TEMPLATE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5002 | wdiEventData.pEventData = pwdiUpdateProbeRspParams; |
| 5003 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateProbeRspParams); |
| 5004 | wdiEventData.pCBfnc = wdiUpdateProbeRspParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5005 | wdiEventData.pUserData = pUserData; |
| 5006 | |
| 5007 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5008 | |
| 5009 | }/*WDI_UpdateProbeRspTemplateReq*/ |
| 5010 | |
| 5011 | /** |
| 5012 | @brief WDI_NvDownloadReq will be called by the UMAC to download the NV blob |
| 5013 | to the NV memory. |
| 5014 | |
| 5015 | |
| 5016 | @param wdiNvDownloadReqParams: the NV Download parameters as specified by |
| 5017 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5018 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5019 | wdiNvDownloadRspCb: callback for passing back the response of |
| 5020 | the NV Download operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5021 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5022 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5023 | callback |
| 5024 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5025 | @see WDI_PostAssocReq |
| 5026 | @return Result of the function call |
| 5027 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5028 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5029 | WDI_NvDownloadReq |
| 5030 | ( |
| 5031 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams, |
| 5032 | WDI_NvDownloadRspCb wdiNvDownloadRspCb, |
| 5033 | void* pUserData |
| 5034 | ) |
| 5035 | { |
| 5036 | WDI_EventInfoType wdiEventData; |
| 5037 | |
| 5038 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5039 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5040 | ------------------------------------------------------------------------*/ |
| 5041 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5042 | { |
| 5043 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5044 | "WDI API call before module is initialized - Fail request"); |
| 5045 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5046 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5047 | } |
| 5048 | |
| 5049 | /*------------------------------------------------------------------------ |
| 5050 | Fill in Event data and post to the Main FSM |
| 5051 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5052 | wdiEventData.wdiRequest = WDI_NV_DOWNLOAD_REQ; |
| 5053 | wdiEventData.pEventData = (void *)pwdiNvDownloadReqParams; |
| 5054 | wdiEventData.uEventDataSize = sizeof(*pwdiNvDownloadReqParams); |
| 5055 | wdiEventData.pCBfnc = wdiNvDownloadRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5056 | wdiEventData.pUserData = pUserData; |
| 5057 | |
| 5058 | return WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, &wdiEventData); |
| 5059 | |
| 5060 | }/*WDI_NVDownloadReq*/ |
| 5061 | |
| 5062 | #ifdef WLAN_FEATURE_P2P |
| 5063 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5064 | @brief WDI_SetP2PGONOAReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5065 | upper MAC wants to send Notice of Absence |
| 5066 | Upon the call of this API the WLAN DAL will |
| 5067 | pack and send the probe rsp template message to the |
| 5068 | lower RIVA sub-system if DAL is in state STARTED. |
| 5069 | |
| 5070 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5071 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5072 | |
| 5073 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5074 | @param pwdiUpdateProbeRspParams: the Update Beacon parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5075 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5076 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5077 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 5078 | response of the Send Beacon Params operation received |
| 5079 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5080 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5081 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5082 | callback |
| 5083 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5084 | @see WDI_AddBAReq |
| 5085 | @return Result of the function call |
| 5086 | */ |
| 5087 | WDI_Status |
| 5088 | WDI_SetP2PGONOAReq |
| 5089 | ( |
| 5090 | WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams, |
| 5091 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb, |
| 5092 | void* pUserData |
| 5093 | ) |
| 5094 | { |
| 5095 | WDI_EventInfoType wdiEventData; |
| 5096 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5097 | |
| 5098 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5099 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5100 | ------------------------------------------------------------------------*/ |
| 5101 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5102 | { |
| 5103 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5104 | "WDI API call before module is initialized - Fail request"); |
| 5105 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5106 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5107 | } |
| 5108 | |
| 5109 | /*------------------------------------------------------------------------ |
| 5110 | Fill in Event data and post to the Main FSM |
| 5111 | ------------------------------------------------------------------------*/ |
| 5112 | wdiEventData.wdiRequest = WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5113 | wdiEventData.pEventData = pwdiP2PGONOAReqParams; |
| 5114 | wdiEventData.uEventDataSize = sizeof(*pwdiP2PGONOAReqParams); |
| 5115 | wdiEventData.pCBfnc = wdiP2PGONOAReqParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5116 | wdiEventData.pUserData = pUserData; |
| 5117 | |
| 5118 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5119 | |
| 5120 | }/*WDI_SetP2PGONOAReq*/ |
| 5121 | #endif |
| 5122 | |
| 5123 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5124 | @brief WDI_AddSTASelfReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5125 | UMAC wanted to add STA self while opening any new session |
| 5126 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5127 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5128 | |
| 5129 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5130 | @param pwdiAddSTASelfParams: the add sta self parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5131 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5132 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5133 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5134 | callback |
| 5135 | |
| 5136 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5137 | @return Result of the function call |
| 5138 | */ |
| 5139 | WDI_Status |
| 5140 | WDI_AddSTASelfReq |
| 5141 | ( |
| 5142 | WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams, |
| 5143 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb, |
| 5144 | void* pUserData |
| 5145 | ) |
| 5146 | { |
| 5147 | WDI_EventInfoType wdiEventData; |
| 5148 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5149 | |
| 5150 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5151 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5152 | ------------------------------------------------------------------------*/ |
| 5153 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5154 | { |
| 5155 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5156 | "WDI API call before module is initialized - Fail request"); |
| 5157 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5158 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5159 | } |
| 5160 | |
| 5161 | /*------------------------------------------------------------------------ |
| 5162 | Fill in Event data and post to the Main FSM |
| 5163 | ------------------------------------------------------------------------*/ |
| 5164 | wdiEventData.wdiRequest = WDI_ADD_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5165 | wdiEventData.pEventData = pwdiAddSTASelfReqParams; |
| 5166 | wdiEventData.uEventDataSize = sizeof(*pwdiAddSTASelfReqParams); |
| 5167 | wdiEventData.pCBfnc = wdiAddSTASelfReqParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5168 | wdiEventData.pUserData = pUserData; |
| 5169 | |
| 5170 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5171 | |
| 5172 | }/*WDI_AddSTASelfReq*/ |
| 5173 | |
| 5174 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5175 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5176 | /** |
| 5177 | @brief WDI_AggrAddTSReq will be called when the upper MAC to inform |
| 5178 | the device of a successful add TSpec negotiation. HW |
| 5179 | needs to receive the TSpec Info from the UMAC in order |
| 5180 | to configure properly the QoS data traffic. Upon the |
| 5181 | call of this API the WLAN DAL will pack and send a HAL |
| 5182 | Add TS request message to the lower RIVA sub-system if |
| 5183 | DAL is in state STARTED. |
| 5184 | |
| 5185 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5186 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5187 | |
| 5188 | WDI_PostAssocReq must have been called. |
| 5189 | |
| 5190 | @param wdiAddTsReqParams: the add TS parameters as specified by |
| 5191 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5192 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5193 | wdiAddTsRspCb: callback for passing back the response of |
| 5194 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5195 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5196 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5197 | callback |
| 5198 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5199 | @see WDI_PostAssocReq |
| 5200 | @return Result of the function call |
| 5201 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5202 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5203 | WDI_AggrAddTSReq |
| 5204 | ( |
| 5205 | WDI_AggrAddTSReqParamsType* pwdiAggrAddTsReqParams, |
| 5206 | WDI_AggrAddTsRspCb wdiAggrAddTsRspCb, |
| 5207 | void* pUserData |
| 5208 | ) |
| 5209 | { |
| 5210 | WDI_EventInfoType wdiEventData; |
| 5211 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5212 | |
| 5213 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5214 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5215 | ------------------------------------------------------------------------*/ |
| 5216 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5217 | { |
| 5218 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5219 | "WDI API call before module is initialized - Fail request"); |
| 5220 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5221 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5222 | } |
| 5223 | |
| 5224 | /*------------------------------------------------------------------------ |
| 5225 | Fill in Event data and post to the Main FSM |
| 5226 | ------------------------------------------------------------------------*/ |
| 5227 | wdiEventData.wdiRequest = WDI_AGGR_ADD_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5228 | wdiEventData.pEventData = pwdiAggrAddTsReqParams; |
| 5229 | wdiEventData.uEventDataSize = sizeof(*pwdiAggrAddTsReqParams); |
| 5230 | wdiEventData.pCBfnc = wdiAggrAddTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5231 | wdiEventData.pUserData = pUserData; |
| 5232 | |
| 5233 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5234 | |
| 5235 | }/*WDI_AggrAddTSReq*/ |
| 5236 | |
| 5237 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 5238 | |
| 5239 | #ifdef ANI_MANF_DIAG |
| 5240 | /** |
| 5241 | @brief WDI_FTMCommandReq |
| 5242 | Post FTM Command Event |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5243 | |
| 5244 | @param ftmCommandReq: FTM Command Body |
| 5245 | @param ftmCommandRspCb: FTM Response from HAL CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5246 | @param pUserData: Client Data |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5247 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5248 | @see |
| 5249 | @return Result of the function call |
| 5250 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5251 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5252 | WDI_FTMCommandReq |
| 5253 | ( |
| 5254 | WDI_FTMCommandReqType *ftmCommandReq, |
| 5255 | WDI_FTMCommandRspCb ftmCommandRspCb, |
| 5256 | void *pUserData |
| 5257 | ) |
| 5258 | { |
| 5259 | WDI_EventInfoType wdiEventData; |
| 5260 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5261 | |
| 5262 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5263 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5264 | ------------------------------------------------------------------------*/ |
| 5265 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5266 | { |
| 5267 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5268 | "WDI API call before module is initialized - Fail request"); |
| 5269 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5270 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5271 | } |
| 5272 | |
| 5273 | /*------------------------------------------------------------------------ |
| 5274 | Fill in Event data and post to the Main FSM |
| 5275 | ------------------------------------------------------------------------*/ |
| 5276 | wdiEventData.wdiRequest = WDI_FTM_CMD_REQ; |
| 5277 | wdiEventData.pEventData = (void *)ftmCommandReq; |
| 5278 | wdiEventData.uEventDataSize = ftmCommandReq->bodyLength + sizeof(wpt_uint32); |
| 5279 | wdiEventData.pCBfnc = ftmCommandRspCb; |
| 5280 | wdiEventData.pUserData = pUserData; |
| 5281 | |
| 5282 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5283 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5284 | #endif /* ANI_MANF_DIAG */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5285 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5286 | @brief WDI_HostResumeReq will be called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5287 | |
| 5288 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5289 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5290 | |
| 5291 | |
| 5292 | @param pwdiResumeReqParams: as specified by |
| 5293 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5294 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5295 | wdiResumeReqRspCb: callback for passing back the response of |
| 5296 | the Resume Req received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5297 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5298 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5299 | callback |
| 5300 | |
| 5301 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5302 | @return Result of the function call |
| 5303 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5304 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5305 | WDI_HostResumeReq |
| 5306 | ( |
| 5307 | WDI_ResumeParamsType* pwdiResumeReqParams, |
| 5308 | WDI_HostResumeEventRspCb wdiResumeReqRspCb, |
| 5309 | void* pUserData |
| 5310 | ) |
| 5311 | { |
| 5312 | WDI_EventInfoType wdiEventData; |
| 5313 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5314 | |
| 5315 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5316 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5317 | ------------------------------------------------------------------------*/ |
| 5318 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5319 | { |
| 5320 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5321 | "WDI API call before module is initialized - Fail request"); |
| 5322 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5323 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5324 | } |
| 5325 | |
| 5326 | /*------------------------------------------------------------------------ |
| 5327 | Fill in Event data and post to the Main FSM |
| 5328 | ------------------------------------------------------------------------*/ |
| 5329 | wdiEventData.wdiRequest = WDI_HOST_RESUME_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5330 | wdiEventData.pEventData = pwdiResumeReqParams; |
| 5331 | wdiEventData.uEventDataSize = sizeof(*pwdiResumeReqParams); |
| 5332 | wdiEventData.pCBfnc = wdiResumeReqRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5333 | wdiEventData.pUserData = pUserData; |
| 5334 | |
| 5335 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5336 | |
| 5337 | }/*WDI_HostResumeReq*/ |
| 5338 | |
| 5339 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5340 | @brief WDI_DelSTASelfReq will be called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5341 | |
| 5342 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5343 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5344 | |
| 5345 | |
| 5346 | @param pwdiDelStaSelfReqParams: as specified by |
| 5347 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5348 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5349 | wdiDelStaSelfRspCb: callback for passing back the response of |
| 5350 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5351 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5352 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5353 | callback |
| 5354 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5355 | @see WDI_PostAssocReq |
| 5356 | @return Result of the function call |
| 5357 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5358 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5359 | WDI_DelSTASelfReq |
| 5360 | ( |
| 5361 | WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams, |
| 5362 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb, |
| 5363 | void* pUserData |
| 5364 | ) |
| 5365 | { |
| 5366 | WDI_EventInfoType wdiEventData; |
| 5367 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5368 | |
| 5369 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5370 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5371 | ------------------------------------------------------------------------*/ |
| 5372 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5373 | { |
| 5374 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5375 | "WDI API call before module is initialized - Fail request"); |
| 5376 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5377 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5378 | } |
| 5379 | |
| 5380 | /*------------------------------------------------------------------------ |
| 5381 | Fill in Event data and post to the Main FSM |
| 5382 | ------------------------------------------------------------------------*/ |
| 5383 | wdiEventData.wdiRequest = WDI_DEL_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5384 | wdiEventData.pEventData = pwdiDelStaSelfReqParams; |
| 5385 | wdiEventData.uEventDataSize = sizeof(*pwdiDelStaSelfReqParams); |
| 5386 | wdiEventData.pCBfnc = wdiDelStaSelfRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5387 | wdiEventData.pUserData = pUserData; |
| 5388 | |
| 5389 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5390 | |
| 5391 | }/*WDI_AggrAddTSReq*/ |
| 5392 | |
| 5393 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5394 | @brief WDI_SetTxPerTrackingReq will be called when the upper MAC |
| 5395 | wants to set the Tx Per Tracking configurations. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5396 | Upon the call of this API the WLAN DAL will pack |
| 5397 | and send a HAL Set Tx Per Tracking request message to the |
| 5398 | lower RIVA sub-system if DAL is in state STARTED. |
| 5399 | |
| 5400 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5401 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5402 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5403 | @param pwdiSetTxPerTrackingReqParams: the Set Tx PER Tracking configurations as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5404 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5405 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5406 | pwdiSetTxPerTrackingRspCb: callback for passing back the |
| 5407 | response of the set Tx PER Tracking configurations operation received |
| 5408 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5409 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5410 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5411 | callback |
| 5412 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5413 | @return Result of the function call |
| 5414 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5415 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5416 | WDI_SetTxPerTrackingReq |
| 5417 | ( |
| 5418 | WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams, |
| 5419 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb, |
| 5420 | void* pUserData |
| 5421 | ) |
| 5422 | { |
| 5423 | WDI_EventInfoType wdiEventData; |
| 5424 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5425 | |
| 5426 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5427 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5428 | ------------------------------------------------------------------------*/ |
| 5429 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5430 | { |
| 5431 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5432 | "WDI API call before module is initialized - Fail request"); |
| 5433 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5434 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5435 | } |
| 5436 | |
| 5437 | /*------------------------------------------------------------------------ |
| 5438 | Fill in Event data and post to the Main FSM |
| 5439 | ------------------------------------------------------------------------*/ |
| 5440 | wdiEventData.wdiRequest = WDI_SET_TX_PER_TRACKING_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5441 | wdiEventData.pEventData = pwdiSetTxPerTrackingReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5442 | wdiEventData.uEventDataSize = sizeof(*pwdiSetTxPerTrackingReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5443 | wdiEventData.pCBfnc = pwdiSetTxPerTrackingRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5444 | wdiEventData.pUserData = pUserData; |
| 5445 | |
| 5446 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5447 | |
| 5448 | }/*WDI_SetTxPerTrackingReq*/ |
| 5449 | |
| 5450 | /** |
| 5451 | @brief WDI_SetTmLevelReq |
| 5452 | If HW Thermal condition changed, driver should react based on new |
| 5453 | HW thermal condition. |
| 5454 | |
| 5455 | @param pwdiSetTmLevelReq: New thermal condition information |
| 5456 | |
| 5457 | pwdiSetTmLevelRspCb: callback |
| 5458 | |
| 5459 | usrData: user data will be passed back with the |
| 5460 | callback |
| 5461 | |
| 5462 | @return Result of the function call |
| 5463 | */ |
| 5464 | WDI_Status |
| 5465 | WDI_SetTmLevelReq |
| 5466 | ( |
| 5467 | WDI_SetTmLevelReqType *pwdiSetTmLevelReq, |
| 5468 | WDI_SetTmLevelCb pwdiSetTmLevelRspCb, |
| 5469 | void *usrData |
| 5470 | ) |
| 5471 | { |
| 5472 | WDI_EventInfoType wdiEventData; |
| 5473 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5474 | |
| 5475 | /*------------------------------------------------------------------------ |
| 5476 | Sanity Check |
| 5477 | ------------------------------------------------------------------------*/ |
| 5478 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5479 | { |
| 5480 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5481 | "WDI API call before module is initialized - Fail request"); |
| 5482 | |
| 5483 | return WDI_STATUS_E_NOT_ALLOWED; |
| 5484 | } |
| 5485 | |
| 5486 | /*------------------------------------------------------------------------ |
| 5487 | Fill in Event data and post to the Main FSM |
| 5488 | ------------------------------------------------------------------------*/ |
| 5489 | wdiEventData.wdiRequest = WDI_SET_TM_LEVEL_REQ; |
| 5490 | wdiEventData.pEventData = pwdiSetTmLevelReq; |
| 5491 | wdiEventData.uEventDataSize = sizeof(*pwdiSetTmLevelReq); |
| 5492 | wdiEventData.pCBfnc = pwdiSetTmLevelRspCb; |
| 5493 | wdiEventData.pUserData = usrData; |
| 5494 | |
| 5495 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5496 | } |
| 5497 | |
| 5498 | /** |
| 5499 | @brief WDI_HostSuspendInd |
| 5500 | |
| 5501 | Suspend Indication from the upper layer will be sent |
| 5502 | down to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5503 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5504 | @param WDI_SuspendResumeIndParamsType |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5505 | |
| 5506 | @see |
| 5507 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5508 | @return Status of the request |
| 5509 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5510 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5511 | WDI_HostSuspendInd |
| 5512 | ( |
| 5513 | WDI_SuspendParamsType* pwdiSuspendIndParams |
| 5514 | ) |
| 5515 | { |
| 5516 | |
| 5517 | WDI_EventInfoType wdiEventData; |
| 5518 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5519 | |
| 5520 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5521 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5522 | ------------------------------------------------------------------------*/ |
| 5523 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5524 | { |
| 5525 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5526 | "WDI API call before module is initialized - Fail request"); |
| 5527 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5528 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5529 | } |
| 5530 | |
| 5531 | /*------------------------------------------------------------------------ |
| 5532 | Fill in Event data and post to the Main FSM |
| 5533 | ------------------------------------------------------------------------*/ |
| 5534 | wdiEventData.wdiRequest = WDI_HOST_SUSPEND_IND; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5535 | wdiEventData.pEventData = pwdiSuspendIndParams; |
| 5536 | wdiEventData.uEventDataSize = sizeof(*pwdiSuspendIndParams); |
| 5537 | wdiEventData.pCBfnc = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5538 | wdiEventData.pUserData = NULL; |
| 5539 | |
| 5540 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5541 | |
| 5542 | }/*WDI_HostSuspendInd*/ |
| 5543 | |
| 5544 | /** |
| 5545 | @brief WDI_HALDumpCmdReq |
| 5546 | Post HAL DUMP Command Event |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5547 | |
| 5548 | @param halDumpCmdReqParams: Hal Dump Command Body |
| 5549 | @param halDumpCmdRspCb: HAL DUMP Response from HAL CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5550 | @param pUserData: Client Data |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5551 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5552 | @see |
| 5553 | @return Result of the function call |
| 5554 | */ |
| 5555 | WDI_Status WDI_HALDumpCmdReq |
| 5556 | ( |
| 5557 | WDI_HALDumpCmdReqParamsType *halDumpCmdReqParams, |
| 5558 | WDI_HALDumpCmdRspCb halDumpCmdRspCb, |
| 5559 | void *pUserData |
| 5560 | ) |
| 5561 | { |
| 5562 | WDI_EventInfoType wdiEventData; |
| 5563 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5564 | |
| 5565 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5566 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5567 | ------------------------------------------------------------------------*/ |
| 5568 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5569 | { |
| 5570 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5571 | "WDI API call before module is initialized - Fail request"); |
| 5572 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5573 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5574 | } |
| 5575 | |
| 5576 | /*------------------------------------------------------------------------ |
| 5577 | Fill in Event data and post to the Main FSM |
| 5578 | ------------------------------------------------------------------------*/ |
| 5579 | wdiEventData.wdiRequest = WDI_HAL_DUMP_CMD_REQ; |
| 5580 | wdiEventData.pEventData = (void *)halDumpCmdReqParams; |
| 5581 | wdiEventData.uEventDataSize = sizeof(WDI_HALDumpCmdReqParamsType); |
| 5582 | wdiEventData.pCBfnc = halDumpCmdRspCb; |
| 5583 | wdiEventData.pUserData = pUserData; |
| 5584 | |
| 5585 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5586 | } |
| 5587 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5588 | /*============================================================================ |
| 5589 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5590 | DAL Control Path Main FSM Function Implementation |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5591 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5592 | ============================================================================*/ |
| 5593 | |
| 5594 | /** |
| 5595 | @brief Main FSM Start function for all states except BUSY |
| 5596 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5597 | |
| 5598 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5599 | wdiEV: event posted to the main DAL FSM |
| 5600 | pEventData: pointer to the event information |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5601 | structure |
| 5602 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5603 | @see |
| 5604 | @return Result of the function call |
| 5605 | */ |
| 5606 | WDI_Status |
| 5607 | WDI_PostMainEvent |
| 5608 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5609 | WDI_ControlBlockType* pWDICtx, |
| 5610 | WDI_MainEventType wdiEV, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5611 | WDI_EventInfoType* pEventData |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5612 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5613 | ) |
| 5614 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5615 | WDI_Status wdiStatus; |
| 5616 | WDI_MainFuncType pfnWDIMainEvHdlr; |
| 5617 | WDI_MainStateType wdiOldState; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5618 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5619 | |
| 5620 | /*------------------------------------------------------------------------- |
| 5621 | Sanity check |
| 5622 | -------------------------------------------------------------------------*/ |
| 5623 | if (( pWDICtx->uGlobalState >= WDI_MAX_ST ) || |
| 5624 | ( wdiEV >= WDI_MAX_EVENT )) |
| 5625 | { |
| 5626 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5627 | "Invalid state or event in Post Main Ev function ST: %d EV: %d", |
| 5628 | pWDICtx->uGlobalState, wdiEV); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5629 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5630 | } |
| 5631 | |
| 5632 | /*Access to the global state must be locked */ |
| 5633 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5634 | |
| 5635 | /*Fetch event handler for state*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5636 | pfnWDIMainEvHdlr = wdiMainFSM[pWDICtx->uGlobalState].pfnMainTbl[wdiEV]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5637 | |
| 5638 | wdiOldState = pWDICtx->uGlobalState; |
| 5639 | |
| 5640 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5641 | --Incase of WDI event is WDI_RESPONSE_EVENT and this is called when a |
| 5642 | response comes from CCPU for the request sent by host: |
| 5643 | 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] | 5644 | 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] | 5645 | --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] | 5646 | CCPU: |
| 5647 | don't change the state */ |
| 5648 | if ( WDI_RESPONSE_EVENT != wdiEV) |
| 5649 | { |
| 5650 | /*Transition to BUSY State - the request is now being processed by the FSM, |
| 5651 | if the request fails we shall transition back to the old state, if not |
| 5652 | the request will manage its own state transition*/ |
| 5653 | WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST); |
| 5654 | } |
| 5655 | /* If the state function associated with the EV is NULL it means that this |
| 5656 | event is not allowed in this state*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5657 | if ( NULL != pfnWDIMainEvHdlr ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5658 | { |
| 5659 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5660 | "Posting event %d in state: %d to the Main FSM", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5661 | wdiEV, wdiOldState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5662 | wdiStatus = pfnWDIMainEvHdlr( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5663 | } |
| 5664 | else |
| 5665 | { |
| 5666 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5667 | "Unexpected event %d in state: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5668 | wdiEV, wdiOldState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5669 | wdiStatus = WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5670 | } |
| 5671 | |
| 5672 | /* If a request handles itself well it will end up in a success or in a |
| 5673 | pending |
| 5674 | Success - means that the request was processed and the proper state |
| 5675 | transition already occurred or will occur when the resp is received |
| 5676 | - NO other state transition or dequeueing is required |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5677 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5678 | Pending - means the request could not be processed at this moment in time |
| 5679 | because the FSM was already busy so no state transition or dequeueing |
| 5680 | is necessary anymore |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5681 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5682 | Success for synchronous case means that the transition may occur and |
| 5683 | processing of pending requests may continue - so it should go through |
| 5684 | and restores the state and continue processing queued requests*/ |
| 5685 | if (( WDI_STATUS_SUCCESS != wdiStatus )&& |
| 5686 | ( WDI_STATUS_PENDING != wdiStatus )) |
| 5687 | { |
| 5688 | if ( WDI_RESPONSE_EVENT != wdiEV) |
| 5689 | { |
| 5690 | /*The request has failed or could not be processed - transition back to |
| 5691 | the old state - check to see if anything was queued and try to execute |
| 5692 | The dequeue logic should post a message to a thread and return - no |
| 5693 | actual processing can occur */ |
| 5694 | WDI_STATE_TRANSITION( pWDICtx, wdiOldState); |
| 5695 | } |
| 5696 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5697 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5698 | } |
| 5699 | |
| 5700 | /* we have completed processing the event */ |
| 5701 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5702 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5703 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5704 | |
| 5705 | }/*WDI_PostMainEvent*/ |
| 5706 | |
| 5707 | |
| 5708 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5709 | INIT State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5710 | --------------------------------------------------------------------------*/ |
| 5711 | /** |
| 5712 | @brief Main FSM Start function for all states except BUSY |
| 5713 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5714 | |
| 5715 | @param pWDICtx: pointer to the WLAN DAL context |
| 5716 | pEventData: pointer to the event information structure |
| 5717 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5718 | @see |
| 5719 | @return Result of the function call |
| 5720 | */ |
| 5721 | WDI_Status |
| 5722 | WDI_MainStart |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5723 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5724 | WDI_ControlBlockType* pWDICtx, |
| 5725 | WDI_EventInfoType* pEventData |
| 5726 | ) |
| 5727 | { |
| 5728 | |
| 5729 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5730 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5731 | ----------------------------------------------------------------------*/ |
| 5732 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5733 | { |
| 5734 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5735 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5736 | pWDICtx, pEventData); |
| 5737 | return WDI_STATUS_E_FAILURE; |
| 5738 | } |
| 5739 | |
| 5740 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5741 | |
| 5742 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5743 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5744 | ----------------------------------------------------------------------*/ |
| 5745 | if ( eWLAN_PAL_FALSE == pWDICtx->bCTOpened ) |
| 5746 | { |
| 5747 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 5748 | "Control Transport not yet Open - queueing the request"); |
| 5749 | |
| 5750 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5751 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5752 | |
| 5753 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5754 | return WDI_STATUS_PENDING; |
| 5755 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5756 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5757 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5758 | |
| 5759 | /*Return Success*/ |
| 5760 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 5761 | |
| 5762 | }/*WDI_MainStart*/ |
| 5763 | |
| 5764 | /** |
| 5765 | @brief Main FSM Response function for state INIT |
| 5766 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5767 | |
| 5768 | @param pWDICtx: pointer to the WLAN DAL context |
| 5769 | pEventData: pointer to the event information structure |
| 5770 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5771 | @see |
| 5772 | @return Result of the function call |
| 5773 | */ |
| 5774 | WDI_Status |
| 5775 | WDI_MainRspInit |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5776 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5777 | WDI_ControlBlockType* pWDICtx, |
| 5778 | WDI_EventInfoType* pEventData |
| 5779 | ) |
| 5780 | { |
| 5781 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5782 | Not expecting a response from the device before it is started |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5783 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5784 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5785 | |
| 5786 | /*Return Success*/ |
| 5787 | return WDI_STATUS_E_NOT_ALLOWED; |
| 5788 | }/* WDI_MainRspInit */ |
| 5789 | |
| 5790 | /** |
| 5791 | @brief Main FSM Close function for all states except BUSY |
| 5792 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5793 | |
| 5794 | @param pWDICtx: pointer to the WLAN DAL context |
| 5795 | pEventData: pointer to the event information structure |
| 5796 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5797 | @see |
| 5798 | @return Result of the function call |
| 5799 | */ |
| 5800 | WDI_Status |
| 5801 | WDI_MainClose |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5802 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5803 | WDI_ControlBlockType* pWDICtx, |
| 5804 | WDI_EventInfoType* pEventData |
| 5805 | ) |
| 5806 | { |
| 5807 | |
| 5808 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5809 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5810 | ----------------------------------------------------------------------*/ |
| 5811 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5812 | { |
| 5813 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5814 | "Invalid parameters on Main Close %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5815 | pWDICtx, pEventData); |
| 5816 | return WDI_STATUS_E_FAILURE; |
| 5817 | } |
| 5818 | |
| 5819 | /*Return Success*/ |
| 5820 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 5821 | |
| 5822 | }/*WDI_MainClose*/ |
| 5823 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5824 | STARTED State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5825 | --------------------------------------------------------------------------*/ |
| 5826 | /** |
| 5827 | @brief Main FSM Start function for state STARTED |
| 5828 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5829 | |
| 5830 | @param pWDICtx: pointer to the WLAN DAL context |
| 5831 | pEventData: pointer to the event information structure |
| 5832 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5833 | @see |
| 5834 | @return Result of the function call |
| 5835 | */ |
| 5836 | WDI_Status |
| 5837 | WDI_MainStartStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5838 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5839 | WDI_ControlBlockType* pWDICtx, |
| 5840 | WDI_EventInfoType* pEventData |
| 5841 | ) |
| 5842 | { |
| 5843 | WDI_StartRspCb wdiStartRspCb = NULL; |
| 5844 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5845 | |
| 5846 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5847 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5848 | ----------------------------------------------------------------------*/ |
| 5849 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5850 | { |
| 5851 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5852 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5853 | pWDICtx, pEventData); |
| 5854 | return WDI_STATUS_E_FAILURE; |
| 5855 | } |
| 5856 | |
| 5857 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5858 | Nothing to do transport was already started |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5859 | ----------------------------------------------------------------------*/ |
| 5860 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5861 | "Received start while transport was already started - nothing to do"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5862 | |
| 5863 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5864 | |
| 5865 | /*Transition back to started because the post function transitioned us to |
| 5866 | busy*/ |
| 5867 | WDI_STATE_TRANSITION( pWDICtx, WDI_STARTED_ST); |
| 5868 | |
| 5869 | /*Check to see if any request is pending*/ |
| 5870 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5871 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5872 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5873 | |
| 5874 | /*Tell UMAC Success*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5875 | wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc; |
| 5876 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5877 | /*Notify UMAC*/ |
| 5878 | wdiStartRspCb( &pWDICtx->wdiCachedStartRspParams, pWDICtx->pRspCBUserData); |
| 5879 | |
| 5880 | /*Return Success*/ |
| 5881 | return WDI_STATUS_SUCCESS; |
| 5882 | |
| 5883 | }/*WDI_MainStartStarted*/ |
| 5884 | |
| 5885 | /** |
| 5886 | @brief Main FSM Stop function for state STARTED |
| 5887 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5888 | |
| 5889 | @param pWDICtx: pointer to the WLAN DAL context |
| 5890 | pEventData: pointer to the event information structure |
| 5891 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5892 | @see |
| 5893 | @return Result of the function call |
| 5894 | */ |
| 5895 | WDI_Status |
| 5896 | WDI_MainStopStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5897 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5898 | WDI_ControlBlockType* pWDICtx, |
| 5899 | WDI_EventInfoType* pEventData |
| 5900 | ) |
| 5901 | { |
| 5902 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5903 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5904 | ----------------------------------------------------------------------*/ |
| 5905 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5906 | { |
| 5907 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5908 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5909 | pWDICtx, pEventData); |
| 5910 | return WDI_STATUS_E_FAILURE; |
| 5911 | } |
| 5912 | |
| 5913 | /*State at this point is BUSY - because we enter this state before posting |
| 5914 | an event to the FSM in order to prevent potential race conditions*/ |
| 5915 | |
| 5916 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 5917 | "Processing stop request in FSM"); |
| 5918 | |
| 5919 | /*Return Success*/ |
| 5920 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 5921 | |
| 5922 | }/*WDI_MainStopStarted*/ |
| 5923 | /** |
| 5924 | @brief Main FSM Request function for state started |
| 5925 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5926 | |
| 5927 | @param pWDICtx: pointer to the WLAN DAL context |
| 5928 | pEventData: pointer to the event information structure |
| 5929 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5930 | @see |
| 5931 | @return Result of the function call |
| 5932 | */ |
| 5933 | WDI_Status |
| 5934 | WDI_MainReqStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5935 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5936 | WDI_ControlBlockType* pWDICtx, |
| 5937 | WDI_EventInfoType* pEventData |
| 5938 | ) |
| 5939 | { |
| 5940 | |
| 5941 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5942 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5943 | ----------------------------------------------------------------------*/ |
| 5944 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5945 | { |
| 5946 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5947 | "Invalid parameters on Main Req Started %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5948 | pWDICtx, pEventData); |
| 5949 | return WDI_STATUS_E_FAILURE; |
| 5950 | } |
| 5951 | |
| 5952 | /*State at this point is BUSY - because we enter this state before posting |
| 5953 | an event to the FSM in order to prevent potential race conditions*/ |
| 5954 | |
| 5955 | /*Return Success*/ |
| 5956 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 5957 | |
| 5958 | }/*WDI_MainReqStarted*/ |
| 5959 | |
| 5960 | /** |
| 5961 | @brief Main FSM Response function for all states except INIT |
| 5962 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5963 | |
| 5964 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5965 | pEventData: pointer to the event information structure |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5966 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5967 | @see |
| 5968 | @return Result of the function call |
| 5969 | */ |
| 5970 | WDI_Status |
| 5971 | WDI_MainRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5972 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5973 | WDI_ControlBlockType* pWDICtx, |
| 5974 | WDI_EventInfoType* pEventData |
| 5975 | ) |
| 5976 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5977 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5978 | wpt_boolean expectedResponse; |
| 5979 | |
| 5980 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5981 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5982 | ----------------------------------------------------------------------*/ |
| 5983 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5984 | { |
| 5985 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5986 | "Invalid parameters on Main Response %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5987 | pWDICtx, pEventData); |
| 5988 | return WDI_STATUS_E_FAILURE; |
| 5989 | } |
| 5990 | |
| 5991 | if ( pEventData->wdiResponse == pWDICtx->wdiExpectedResponse ) |
| 5992 | { |
| 5993 | /* we received an expected response */ |
| 5994 | expectedResponse = eWLAN_PAL_TRUE; |
| 5995 | |
| 5996 | /*We expect that we will transition to started after this processing*/ |
| 5997 | pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST; |
| 5998 | |
| 5999 | /* we are no longer expecting a response */ |
| 6000 | pWDICtx->wdiExpectedResponse = WDI_MAX_RESP; |
| 6001 | } |
| 6002 | else |
| 6003 | { |
| 6004 | /* we received an indication or unexpected response */ |
| 6005 | expectedResponse = eWLAN_PAL_FALSE; |
| 6006 | /* for indications no need to update state from what it is right |
| 6007 | now, unless it explicitly does it in the indication handler (say |
| 6008 | for device failure ind) */ |
| 6009 | pWDICtx->ucExpectedStateTransition = pWDICtx->uGlobalState; |
| 6010 | } |
| 6011 | |
| 6012 | /*Process the response and indication */ |
| 6013 | wdiStatus = WDI_ProcessResponse( pWDICtx, pEventData ); |
| 6014 | |
| 6015 | /*Lock the CB as we are about to do a state transition*/ |
| 6016 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6017 | |
| 6018 | /*Transition to the expected state after the response processing |
| 6019 | - this should always be started state with the following exceptions: |
| 6020 | 1. processing of a failed start response |
| 6021 | 2. device failure detected while processing response |
| 6022 | 3. stop response received*/ |
| 6023 | WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6024 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6025 | /*Dequeue request that may have been queued while we were waiting for the |
| 6026 | response */ |
| 6027 | if ( expectedResponse ) |
| 6028 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6029 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6030 | } |
| 6031 | |
| 6032 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6033 | |
| 6034 | /*Return Success - always */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6035 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6036 | |
| 6037 | }/*WDI_MainRsp*/ |
| 6038 | |
| 6039 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6040 | STOPPED State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6041 | --------------------------------------------------------------------------*/ |
| 6042 | /** |
| 6043 | @brief Main FSM Stop function for state STOPPED |
| 6044 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6045 | |
| 6046 | @param pWDICtx: pointer to the WLAN DAL context |
| 6047 | pEventData: pointer to the event information structure |
| 6048 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6049 | @see |
| 6050 | @return Result of the function call |
| 6051 | */ |
| 6052 | WDI_Status |
| 6053 | WDI_MainStopStopped |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6054 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6055 | WDI_ControlBlockType* pWDICtx, |
| 6056 | WDI_EventInfoType* pEventData |
| 6057 | ) |
| 6058 | { |
| 6059 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6060 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6061 | ----------------------------------------------------------------------*/ |
| 6062 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6063 | { |
| 6064 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6065 | "Invalid parameters on Main Stop Stopped %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6066 | pWDICtx, pEventData); |
| 6067 | return WDI_STATUS_E_FAILURE; |
| 6068 | } |
| 6069 | |
| 6070 | /*We should normally not get a STOP request if we are already stopped |
| 6071 | since we should normally be stopped by the UMAC. However in some |
| 6072 | error situations we put ourselves in the stopped state without the |
| 6073 | UMAC knowing, so when we get a STOP request in this state we still |
| 6074 | process it since we need to clean up the underlying state */ |
| 6075 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6076 | "Processing stop request while stopped in FSM"); |
| 6077 | |
| 6078 | /*Return Success*/ |
| 6079 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6080 | |
| 6081 | }/*WDI_MainStopStopped*/ |
| 6082 | |
| 6083 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6084 | BUSY State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6085 | --------------------------------------------------------------------------*/ |
| 6086 | /** |
| 6087 | @brief Main FSM Start function for state BUSY |
| 6088 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6089 | |
| 6090 | @param pWDICtx: pointer to the WLAN DAL context |
| 6091 | pEventData: pointer to the event information structure |
| 6092 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6093 | @see |
| 6094 | @return Result of the function call |
| 6095 | */ |
| 6096 | WDI_Status |
| 6097 | WDI_MainStartBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6098 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6099 | WDI_ControlBlockType* pWDICtx, |
| 6100 | WDI_EventInfoType* pEventData |
| 6101 | ) |
| 6102 | { |
| 6103 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6104 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6105 | ----------------------------------------------------------------------*/ |
| 6106 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6107 | { |
| 6108 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6109 | "Invalid parameters on Main Start in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6110 | pWDICtx, pEventData); |
| 6111 | return WDI_STATUS_E_FAILURE; |
| 6112 | } |
| 6113 | |
| 6114 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6115 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6116 | ----------------------------------------------------------------------*/ |
| 6117 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6118 | "WDI Busy state - queue start request"); |
| 6119 | |
| 6120 | /*Queue the start request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6121 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6122 | |
| 6123 | /*Return Success*/ |
| 6124 | return WDI_STATUS_PENDING; |
| 6125 | }/*WDI_MainStartBusy*/ |
| 6126 | |
| 6127 | /** |
| 6128 | @brief Main FSM Stop function for state BUSY |
| 6129 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6130 | |
| 6131 | @param pWDICtx: pointer to the WLAN DAL context |
| 6132 | pEventData: pointer to the event information structure |
| 6133 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6134 | @see |
| 6135 | @return Result of the function call |
| 6136 | */ |
| 6137 | WDI_Status |
| 6138 | WDI_MainStopBusy |
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_ControlBlockType* pWDICtx, |
| 6141 | WDI_EventInfoType* pEventData |
| 6142 | ) |
| 6143 | { |
| 6144 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6145 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6146 | ----------------------------------------------------------------------*/ |
| 6147 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6148 | { |
| 6149 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6150 | "Invalid parameters on Main Stop in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6151 | pWDICtx, pEventData); |
| 6152 | return WDI_STATUS_E_FAILURE; |
| 6153 | } |
| 6154 | |
| 6155 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6156 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6157 | ----------------------------------------------------------------------*/ |
| 6158 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6159 | "WDI Busy state - queue stop request"); |
| 6160 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6161 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6162 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6163 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6164 | }/*WDI_MainStopBusy*/ |
| 6165 | |
| 6166 | /** |
| 6167 | @brief Main FSM Request function for state BUSY |
| 6168 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6169 | |
| 6170 | @param pWDICtx: pointer to the WLAN DAL context |
| 6171 | pEventData: pointer to the event information structure |
| 6172 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6173 | @see |
| 6174 | @return Result of the function call |
| 6175 | */ |
| 6176 | WDI_Status |
| 6177 | WDI_MainReqBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6178 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6179 | WDI_ControlBlockType* pWDICtx, |
| 6180 | WDI_EventInfoType* pEventData |
| 6181 | ) |
| 6182 | { |
| 6183 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6184 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6185 | ----------------------------------------------------------------------*/ |
| 6186 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6187 | { |
| 6188 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6189 | "Invalid parameters on Main Request in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6190 | pWDICtx, pEventData); |
| 6191 | return WDI_STATUS_E_FAILURE; |
| 6192 | } |
| 6193 | |
| 6194 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6195 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6196 | ----------------------------------------------------------------------*/ |
| 6197 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6198 | "WDI Busy state - queue request %d because waiting for response %d", |
| 6199 | pEventData->wdiRequest, pWDICtx->wdiExpectedResponse); |
| 6200 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6201 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6202 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6203 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6204 | }/*WDI_MainReqBusy*/ |
| 6205 | /** |
| 6206 | @brief Main FSM Close function for state BUSY |
| 6207 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6208 | |
| 6209 | @param pWDICtx: pointer to the WLAN DAL context |
| 6210 | pEventData: pointer to the event information structure |
| 6211 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6212 | @see |
| 6213 | @return Result of the function call |
| 6214 | */ |
| 6215 | WDI_Status |
| 6216 | WDI_MainCloseBusy |
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_ControlBlockType* pWDICtx, |
| 6219 | WDI_EventInfoType* pEventData |
| 6220 | ) |
| 6221 | { |
| 6222 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6223 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6224 | ----------------------------------------------------------------------*/ |
| 6225 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6226 | { |
| 6227 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6228 | "Invalid parameters on Main Close in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6229 | pWDICtx, pEventData); |
| 6230 | return WDI_STATUS_E_FAILURE; |
| 6231 | } |
| 6232 | |
| 6233 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6234 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6235 | ----------------------------------------------------------------------*/ |
| 6236 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6237 | "WDI Busy state - queue close request"); |
| 6238 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6239 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6240 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6241 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6242 | }/*WDI_MainCloseBusy*/ |
| 6243 | |
| 6244 | /** |
| 6245 | @brief Main FSM Shutdown function for INIT & STARTED states |
| 6246 | |
| 6247 | |
| 6248 | @param pWDICtx: pointer to the WLAN DAL context |
| 6249 | pEventData: pointer to the event information structure |
| 6250 | |
| 6251 | @see |
| 6252 | @return Result of the function call |
| 6253 | */ |
| 6254 | WDI_Status |
| 6255 | WDI_MainShutdown |
| 6256 | ( |
| 6257 | WDI_ControlBlockType* pWDICtx, |
| 6258 | WDI_EventInfoType* pEventData |
| 6259 | ) |
| 6260 | { |
| 6261 | /*-------------------------------------------------------------------- |
| 6262 | Sanity Check |
| 6263 | ----------------------------------------------------------------------*/ |
| 6264 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6265 | { |
| 6266 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6267 | "Invalid parameters on Main Start %x %x", |
| 6268 | pWDICtx, pEventData); |
| 6269 | return WDI_STATUS_E_FAILURE; |
| 6270 | } |
| 6271 | |
| 6272 | /*State at this point is BUSY - because we enter this state before posting |
| 6273 | an event to the FSM in order to prevent potential race conditions*/ |
| 6274 | |
| 6275 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6276 | "Processing shutdown request in FSM"); |
| 6277 | |
| 6278 | /*Return Success*/ |
| 6279 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6280 | |
| 6281 | }/*WDI_MainShutdown*/ |
| 6282 | |
| 6283 | /** |
| 6284 | @brief Main FSM Shutdown function for BUSY state |
| 6285 | |
| 6286 | |
| 6287 | @param pWDICtx: pointer to the WLAN DAL context |
| 6288 | pEventData: pointer to the event information structure |
| 6289 | |
| 6290 | @see |
| 6291 | @return Result of the function call |
| 6292 | */ |
| 6293 | WDI_Status |
| 6294 | WDI_MainShutdownBusy |
| 6295 | ( |
| 6296 | WDI_ControlBlockType* pWDICtx, |
| 6297 | WDI_EventInfoType* pEventData |
| 6298 | ) |
| 6299 | { |
| 6300 | /*-------------------------------------------------------------------- |
| 6301 | Sanity Check |
| 6302 | ----------------------------------------------------------------------*/ |
| 6303 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6304 | { |
| 6305 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6306 | "Invalid parameters on Main Start %x %x", |
| 6307 | pWDICtx, pEventData); |
| 6308 | return WDI_STATUS_E_FAILURE; |
| 6309 | } |
| 6310 | |
| 6311 | /* If you are waiting for a HAL response at this stage, you are not |
| 6312 | * going to get it. Riva is already shutdown/crashed. |
| 6313 | */ |
| 6314 | wpalTimerStop(&gWDICb.wptResponseTimer); |
| 6315 | |
| 6316 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6317 | "Processing shutdown request in FSM: Busy state "); |
| 6318 | |
| 6319 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6320 | |
| 6321 | }/*WDI_MainShutdownBusy*/ |
| 6322 | |
| 6323 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6324 | /*======================================================================= |
| 6325 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6326 | WLAN DAL Control Path Main Processing Functions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6327 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6328 | *=======================================================================*/ |
| 6329 | |
| 6330 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6331 | Main DAL Control Path Request Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6332 | ========================================================================*/ |
| 6333 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6334 | @brief Process Start Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6335 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6336 | |
| 6337 | @param pWDICtx: pointer to the WLAN DAL context |
| 6338 | pEventData: pointer to the event information structure |
| 6339 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6340 | @see |
| 6341 | @return Result of the function call |
| 6342 | */ |
| 6343 | WDI_Status |
| 6344 | WDI_ProcessStartReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6345 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6346 | WDI_ControlBlockType* pWDICtx, |
| 6347 | WDI_EventInfoType* pEventData |
| 6348 | ) |
| 6349 | { |
| 6350 | WDI_StartReqParamsType* pwdiStartParams = NULL; |
| 6351 | WDI_StartRspCb wdiStartRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6352 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6353 | wpt_uint16 usDataOffset = 0; |
| 6354 | wpt_uint16 usSendSize = 0; |
| 6355 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6356 | tHalMacStartReqMsg halStartReq; |
| 6357 | wpt_uint16 usLen = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6358 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6359 | |
| 6360 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6361 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6362 | -------------------------------------------------------------------------*/ |
| 6363 | if (( NULL == pEventData ) || |
| 6364 | ( NULL == (pwdiStartParams = (WDI_StartReqParamsType*)pEventData->pEventData)) || |
| 6365 | ( NULL == (wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc))) |
| 6366 | { |
| 6367 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6368 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6369 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6370 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6371 | } |
| 6372 | |
| 6373 | /*----------------------------------------------------------------------- |
| 6374 | Get message buffer |
| 6375 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6376 | usLen = sizeof(halStartReq.startReqParams) + |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6377 | pwdiStartParams->usConfigBufferLen; |
| 6378 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6379 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6380 | usLen, |
| 6381 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6382 | ( usSendSize < (usDataOffset + usLen ))) |
| 6383 | { |
| 6384 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6385 | "Unable to get send buffer in start req %x %x %x", |
| 6386 | pEventData, pwdiStartParams, wdiStartRspCb); |
| 6387 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6388 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6389 | } |
| 6390 | |
| 6391 | /*----------------------------------------------------------------------- |
| 6392 | Fill in the message |
| 6393 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6394 | halStartReq.startReqParams.driverType = |
| 6395 | WDI_2_HAL_DRV_TYPE(pwdiStartParams->wdiDriverType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6396 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6397 | halStartReq.startReqParams.uConfigBufferLen = |
| 6398 | pwdiStartParams->usConfigBufferLen; |
| 6399 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6400 | &halStartReq.startReqParams, |
| 6401 | sizeof(halStartReq.startReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6402 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6403 | usDataOffset += sizeof(halStartReq.startReqParams); |
| 6404 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6405 | pwdiStartParams->pConfigBuffer, |
| 6406 | pwdiStartParams->usConfigBufferLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6407 | |
| 6408 | pWDICtx->wdiReqStatusCB = pwdiStartParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6409 | pWDICtx->pReqStatusUserData = pwdiStartParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6410 | |
| 6411 | /*Save Low Level Ind CB and associated user data - it will be used further |
| 6412 | on when an indication is coming from the lower MAC*/ |
| 6413 | pWDICtx->wdiLowLevelIndCB = pwdiStartParams->wdiLowLevelIndCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6414 | pWDICtx->pIndUserData = pwdiStartParams->pIndUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6415 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6416 | pWDICtx->bFrameTransEnabled = pwdiStartParams->bFrameTransEnabled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6417 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6418 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6419 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6420 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6421 | wdiStartRspCb, pEventData->pUserData, WDI_START_RESP); |
| 6422 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6423 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6424 | }/*WDI_ProcessStartReq*/ |
| 6425 | |
| 6426 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6427 | @brief Process Stop Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6428 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6429 | |
| 6430 | @param pWDICtx: pointer to the WLAN DAL context |
| 6431 | pEventData: pointer to the event information structure |
| 6432 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6433 | @see |
| 6434 | @return Result of the function call |
| 6435 | */ |
| 6436 | WDI_Status |
| 6437 | WDI_ProcessStopReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6438 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6439 | WDI_ControlBlockType* pWDICtx, |
| 6440 | WDI_EventInfoType* pEventData |
| 6441 | ) |
| 6442 | { |
| 6443 | WDI_StopReqParamsType* pwdiStopParams = NULL; |
| 6444 | WDI_StopRspCb wdiStopRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6445 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6446 | wpt_uint16 usDataOffset = 0; |
| 6447 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6448 | wpt_status status; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6449 | tHalMacStopReqMsg halStopReq; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6450 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6451 | |
| 6452 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6453 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6454 | -------------------------------------------------------------------------*/ |
| 6455 | if (( NULL == pEventData ) || |
| 6456 | ( NULL == (pwdiStopParams = (WDI_StopReqParamsType*)pEventData->pEventData)) || |
| 6457 | ( NULL == (wdiStopRspCb = (WDI_StopRspCb)pEventData->pCBfnc))) |
| 6458 | { |
| 6459 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6460 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6461 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6462 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6463 | } |
| 6464 | |
| 6465 | /*----------------------------------------------------------------------- |
| 6466 | Get message buffer |
| 6467 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6468 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_STOP_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6469 | sizeof(halStopReq.stopReqParams), |
| 6470 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6471 | ( usSendSize < (usDataOffset + sizeof(halStopReq.stopReqParams) ))) |
| 6472 | { |
| 6473 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6474 | "Unable to get send buffer in stop req %x %x %x", |
| 6475 | pEventData, pwdiStopParams, wdiStopRspCb); |
| 6476 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6477 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6478 | } |
| 6479 | |
| 6480 | /*----------------------------------------------------------------------- |
| 6481 | Fill in the message |
| 6482 | -----------------------------------------------------------------------*/ |
| 6483 | halStopReq.stopReqParams.reason = WDI_2_HAL_STOP_REASON( |
| 6484 | pwdiStopParams->wdiStopReason); |
| 6485 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6486 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6487 | &halStopReq.stopReqParams, |
| 6488 | sizeof(halStopReq.stopReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6489 | |
| 6490 | pWDICtx->wdiReqStatusCB = pwdiStopParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6491 | pWDICtx->pReqStatusUserData = pwdiStopParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6492 | |
| 6493 | /*! TO DO: stop the data services */ |
| 6494 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 6495 | { |
| 6496 | /*Stop the STA Table !UT- check this logic again |
| 6497 | It is safer to do it here than on the response - because a stop is imminent*/ |
| 6498 | WDI_STATableStop(pWDICtx); |
| 6499 | |
| 6500 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6501 | status = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 6502 | if (eWLAN_PAL_STATUS_SUCCESS != status) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6503 | { |
| 6504 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6505 | "WDI Init failed to reset power state event"); |
| 6506 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6507 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6508 | return VOS_STATUS_E_FAILURE; |
| 6509 | } |
| 6510 | /* Stop Transport Driver, DXE */ |
| 6511 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_DOWN, WDI_SetPowerStateCb); |
| 6512 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6513 | * 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] | 6514 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6515 | status = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 6516 | WDI_SET_POWER_STATE_TIMEOUT); |
| 6517 | if (eWLAN_PAL_STATUS_SUCCESS != status) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6518 | { |
| 6519 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6520 | "WDI Init failed to wait on an event"); |
| 6521 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6522 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6523 | return VOS_STATUS_E_FAILURE; |
| 6524 | } |
| 6525 | } |
| 6526 | |
| 6527 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6528 | Send Stop Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6529 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6530 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6531 | wdiStopRspCb, pEventData->pUserData, WDI_STOP_RESP); |
| 6532 | |
| 6533 | }/*WDI_ProcessStopReq*/ |
| 6534 | |
| 6535 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6536 | @brief Process Close Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6537 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6538 | |
| 6539 | @param pWDICtx: pointer to the WLAN DAL context |
| 6540 | pEventData: pointer to the event information structure |
| 6541 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6542 | @see |
| 6543 | @return Result of the function call |
| 6544 | */ |
| 6545 | WDI_Status |
| 6546 | WDI_ProcessCloseReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6547 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6548 | WDI_ControlBlockType* pWDICtx, |
| 6549 | WDI_EventInfoType* pEventData |
| 6550 | ) |
| 6551 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6552 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6553 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6554 | |
| 6555 | /*Lock control block for cleanup*/ |
| 6556 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6557 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6558 | /*Clear all pending request*/ |
| 6559 | WDI_ClearPendingRequests(pWDICtx); |
| 6560 | |
| 6561 | /* Close Control transport*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6562 | WCTS_CloseTransport(pWDICtx->wctsHandle); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6563 | |
| 6564 | /* Close Data transport*/ |
| 6565 | /* FTM mode does not open Data Path */ |
| 6566 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 6567 | { |
| 6568 | WDTS_Close(pWDICtx); |
| 6569 | } |
| 6570 | |
| 6571 | /*Close the STA Table !UT- check this logic again*/ |
| 6572 | WDI_STATableClose(pWDICtx); |
| 6573 | |
| 6574 | /*close the PAL */ |
| 6575 | wptStatus = wpalClose(pWDICtx->pPALContext); |
| 6576 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 6577 | { |
| 6578 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6579 | "Failed to wpal Close %d", wptStatus); |
| 6580 | WDI_ASSERT(0); |
| 6581 | } |
| 6582 | |
| 6583 | /*Transition back to init state*/ |
| 6584 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
| 6585 | |
| 6586 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6587 | |
| 6588 | /*Make sure the expected state is properly defaulted to Init*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6589 | pWDICtx->ucExpectedStateTransition = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6590 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6591 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6592 | }/*WDI_ProcessCloseReq*/ |
| 6593 | |
| 6594 | |
| 6595 | /*=========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6596 | SCANING REQUEST PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6597 | ===========================================================================*/ |
| 6598 | |
| 6599 | /** |
| 6600 | @brief Process Init Scan Request function (called when Main FSM |
| 6601 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6602 | |
| 6603 | @param pWDICtx: pointer to the WLAN DAL context |
| 6604 | pEventData: pointer to the event information structure |
| 6605 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6606 | @see |
| 6607 | @return Result of the function call |
| 6608 | */ |
| 6609 | WDI_Status |
| 6610 | WDI_ProcessInitScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6611 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6612 | WDI_ControlBlockType* pWDICtx, |
| 6613 | WDI_EventInfoType* pEventData |
| 6614 | ) |
| 6615 | { |
| 6616 | WDI_InitScanReqParamsType* pwdiInitScanParams = NULL; |
| 6617 | WDI_InitScanRspCb wdiInitScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6618 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6619 | wpt_uint16 usDataOffset = 0; |
| 6620 | wpt_uint16 usSendSize = 0; |
| 6621 | wpt_uint8 i = 0; |
| 6622 | |
| 6623 | tHalInitScanReqMsg halInitScanReqMsg; |
| 6624 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6625 | /*This is temporary fix. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6626 | * It shold be removed once host and riva changes are in sync*/ |
| 6627 | tHalInitScanConReqMsg halInitScanConReqMsg; |
| 6628 | |
| 6629 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6630 | |
| 6631 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6632 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6633 | -------------------------------------------------------------------------*/ |
| 6634 | if (( NULL == pEventData ) || |
| 6635 | ( NULL == (pwdiInitScanParams = (WDI_InitScanReqParamsType*)pEventData->pEventData)) || |
| 6636 | ( NULL == (wdiInitScanRspCb = (WDI_InitScanRspCb)pEventData->pCBfnc))) |
| 6637 | { |
| 6638 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6639 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6640 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6641 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6642 | } |
| 6643 | |
| 6644 | #if 0 |
| 6645 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6646 | /*----------------------------------------------------------------------- |
| 6647 | Check to see if SCAN is already in progress - if so reject the req |
| 6648 | We only allow one scan at a time |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6649 | ! TO DO: - revisit this constraint |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6650 | -----------------------------------------------------------------------*/ |
| 6651 | if ( pWDICtx->bScanInProgress ) |
| 6652 | { |
| 6653 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6654 | "Scan is already in progress - subsequent scan is not allowed" |
| 6655 | " until the first scan completes"); |
| 6656 | |
| 6657 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6658 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6659 | } |
| 6660 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6661 | pWDICtx->bScanInProgress = eWLAN_PAL_TRUE; |
| 6662 | pWDICtx->uScanState = WDI_SCAN_INITIALIZED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6663 | |
| 6664 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6665 | #endif |
| 6666 | |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 6667 | if ((pwdiInitScanParams->wdiReqInfo.bUseNOA) && (!WDI_getFwWlanFeatCaps(P2P_GO_NOA_DECOUPLE_INIT_SCAN))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6668 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6669 | /*This is temporary fix. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6670 | * It shold be removed once host and riva changes are in sync*/ |
| 6671 | /*----------------------------------------------------------------------- |
| 6672 | Get message buffer |
| 6673 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6674 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_CON_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6675 | sizeof(halInitScanConReqMsg.initScanParams), |
| 6676 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6677 | ( usSendSize < (usDataOffset + sizeof(halInitScanConReqMsg.initScanParams) ))) |
| 6678 | { |
| 6679 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6680 | "Unable to get send buffer in init scan req %x %x %x", |
| 6681 | pEventData, pwdiInitScanParams, wdiInitScanRspCb); |
| 6682 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6683 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6684 | } |
| 6685 | |
| 6686 | |
| 6687 | /*----------------------------------------------------------------------- |
| 6688 | Fill in the message |
| 6689 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6690 | halInitScanConReqMsg.initScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6691 | WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode); |
| 6692 | |
| 6693 | wpalMemoryCopy(halInitScanConReqMsg.initScanParams.bssid, |
| 6694 | pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 6695 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6696 | halInitScanConReqMsg.initScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6697 | pwdiInitScanParams->wdiReqInfo.bNotifyBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6698 | halInitScanConReqMsg.initScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6699 | pwdiInitScanParams->wdiReqInfo.ucFrameType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6700 | halInitScanConReqMsg.initScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6701 | pwdiInitScanParams->wdiReqInfo.ucFrameLength; |
| 6702 | |
| 6703 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanConReqMsg.initScanParams.macMgmtHdr, |
| 6704 | &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 6705 | |
| 6706 | #ifdef WLAN_FEATURE_P2P |
| 6707 | halInitScanConReqMsg.initScanParams.useNoA = pwdiInitScanParams->wdiReqInfo.bUseNOA; |
| 6708 | halInitScanConReqMsg.initScanParams.scanDuration = pwdiInitScanParams->wdiReqInfo.scanDuration; |
| 6709 | #endif |
| 6710 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6711 | halInitScanConReqMsg.initScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6712 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; |
| 6713 | |
| 6714 | for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 6715 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6716 | halInitScanConReqMsg.initScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6717 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i]; |
| 6718 | } |
| 6719 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6720 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6721 | &halInitScanConReqMsg.initScanParams, |
| 6722 | sizeof(halInitScanConReqMsg.initScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6723 | } |
| 6724 | else |
| 6725 | { |
| 6726 | /*----------------------------------------------------------------------- |
| 6727 | Get message buffer |
| 6728 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6729 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6730 | sizeof(halInitScanReqMsg.initScanParams), |
| 6731 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6732 | ( usSendSize < (usDataOffset + sizeof(halInitScanReqMsg.initScanParams) ))) |
| 6733 | { |
| 6734 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6735 | "Unable to get send buffer in init scan req %x %x %x", |
| 6736 | pEventData, pwdiInitScanParams, wdiInitScanRspCb); |
| 6737 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6738 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6739 | } |
| 6740 | |
| 6741 | |
| 6742 | /*----------------------------------------------------------------------- |
| 6743 | Fill in the message |
| 6744 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6745 | halInitScanReqMsg.initScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6746 | WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode); |
| 6747 | |
| 6748 | wpalMemoryCopy(halInitScanReqMsg.initScanParams.bssid, |
| 6749 | pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 6750 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6751 | halInitScanReqMsg.initScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6752 | pwdiInitScanParams->wdiReqInfo.bNotifyBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6753 | halInitScanReqMsg.initScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6754 | pwdiInitScanParams->wdiReqInfo.ucFrameType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6755 | halInitScanReqMsg.initScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6756 | pwdiInitScanParams->wdiReqInfo.ucFrameLength; |
| 6757 | |
| 6758 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanReqMsg.initScanParams.macMgmtHdr, |
| 6759 | &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 6760 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6761 | halInitScanReqMsg.initScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6762 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; |
| 6763 | |
| 6764 | for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 6765 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6766 | halInitScanReqMsg.initScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6767 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i]; |
| 6768 | } |
| 6769 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6770 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6771 | &halInitScanReqMsg.initScanParams, |
| 6772 | sizeof(halInitScanReqMsg.initScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6773 | } |
| 6774 | |
| 6775 | pWDICtx->wdiReqStatusCB = pwdiInitScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6776 | pWDICtx->pReqStatusUserData = pwdiInitScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6777 | |
| 6778 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6779 | Send Init Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6780 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6781 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6782 | wdiInitScanRspCb, pEventData->pUserData, WDI_INIT_SCAN_RESP); |
| 6783 | |
| 6784 | }/*WDI_ProcessInitScanReq*/ |
| 6785 | |
| 6786 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6787 | @brief Process Start Scan Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6788 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6789 | |
| 6790 | @param pWDICtx: pointer to the WLAN DAL context |
| 6791 | pEventData: pointer to the event information structure |
| 6792 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6793 | @see |
| 6794 | @return Result of the function call |
| 6795 | */ |
| 6796 | WDI_Status |
| 6797 | WDI_ProcessStartScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6798 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6799 | WDI_ControlBlockType* pWDICtx, |
| 6800 | WDI_EventInfoType* pEventData |
| 6801 | ) |
| 6802 | { |
| 6803 | WDI_StartScanReqParamsType* pwdiStartScanParams = NULL; |
| 6804 | WDI_StartScanRspCb wdiStartScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6805 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6806 | wpt_uint16 usDataOffset = 0; |
| 6807 | wpt_uint16 usSendSize = 0; |
| 6808 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6809 | tHalStartScanReqMsg halStartScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6810 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6811 | |
| 6812 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6813 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6814 | -------------------------------------------------------------------------*/ |
| 6815 | if (( NULL == pEventData ) || |
| 6816 | ( NULL == (pwdiStartScanParams = (WDI_StartScanReqParamsType*)pEventData->pEventData)) || |
| 6817 | ( NULL == (wdiStartScanRspCb = (WDI_StartScanRspCb)pEventData->pCBfnc))) |
| 6818 | { |
| 6819 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6820 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6821 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6822 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6823 | } |
| 6824 | |
| 6825 | #if 0 |
| 6826 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6827 | /*----------------------------------------------------------------------- |
| 6828 | Check to see if SCAN is already in progress - start scan is only |
| 6829 | 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] | 6830 | is either init or end |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6831 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6832 | if (( !pWDICtx->bScanInProgress ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6833 | (( WDI_SCAN_INITIALIZED_ST != pWDICtx->uScanState ) && |
| 6834 | ( WDI_SCAN_ENDED_ST != pWDICtx->uScanState ))) |
| 6835 | { |
| 6836 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6837 | "Scan start not allowed in this state %d %d", |
| 6838 | pWDICtx->bScanInProgress, pWDICtx->uScanState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6839 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6840 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6841 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6842 | } |
| 6843 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6844 | pWDICtx->uScanState = WDI_SCAN_STARTED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6845 | |
| 6846 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6847 | #endif |
| 6848 | |
| 6849 | /*----------------------------------------------------------------------- |
| 6850 | Get message buffer |
| 6851 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6852 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6853 | sizeof(halStartScanReqMsg.startScanParams), |
| 6854 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6855 | ( usSendSize < (usDataOffset + sizeof(halStartScanReqMsg.startScanParams) ))) |
| 6856 | { |
| 6857 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6858 | "Unable to get send buffer in start scan req %x %x %x", |
| 6859 | pEventData, pwdiStartScanParams, wdiStartScanRspCb); |
| 6860 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6861 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6862 | } |
| 6863 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6864 | halStartScanReqMsg.startScanParams.scanChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6865 | pwdiStartScanParams->ucChannel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6866 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6867 | &halStartScanReqMsg.startScanParams, |
| 6868 | sizeof(halStartScanReqMsg.startScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6869 | |
| 6870 | pWDICtx->wdiReqStatusCB = pwdiStartScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6871 | pWDICtx->pReqStatusUserData = pwdiStartScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6872 | |
| 6873 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6874 | Send Start Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6875 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6876 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6877 | wdiStartScanRspCb, pEventData->pUserData, WDI_START_SCAN_RESP); |
| 6878 | }/*WDI_ProcessStartScanReq*/ |
| 6879 | |
| 6880 | |
| 6881 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6882 | @brief Process End Scan Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6883 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6884 | |
| 6885 | @param pWDICtx: pointer to the WLAN DAL context |
| 6886 | pEventData: pointer to the event information structure |
| 6887 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6888 | @see |
| 6889 | @return Result of the function call |
| 6890 | */ |
| 6891 | WDI_Status |
| 6892 | WDI_ProcessEndScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6893 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6894 | WDI_ControlBlockType* pWDICtx, |
| 6895 | WDI_EventInfoType* pEventData |
| 6896 | ) |
| 6897 | { |
| 6898 | WDI_EndScanReqParamsType* pwdiEndScanParams = NULL; |
| 6899 | WDI_EndScanRspCb wdiEndScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6900 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6901 | wpt_uint16 usDataOffset = 0; |
| 6902 | wpt_uint16 usSendSize = 0; |
| 6903 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6904 | tHalEndScanReqMsg halEndScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6905 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6906 | |
| 6907 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6908 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6909 | -------------------------------------------------------------------------*/ |
| 6910 | if (( NULL == pEventData ) || |
| 6911 | ( NULL == (pwdiEndScanParams = (WDI_EndScanReqParamsType*)pEventData->pEventData)) || |
| 6912 | ( NULL == (wdiEndScanRspCb = (WDI_EndScanRspCb)pEventData->pCBfnc))) |
| 6913 | { |
| 6914 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6915 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6916 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6917 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6918 | } |
| 6919 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6920 | /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN |
| 6921 | * sometimes because of this check the scan request is not being |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6922 | * forwarded to HAL and result in hang*/ |
| 6923 | #if 0 |
| 6924 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6925 | /*----------------------------------------------------------------------- |
| 6926 | Check to see if SCAN is already in progress - end scan is only |
| 6927 | allowed when a scan is ongoing and the state of the scan procedure |
| 6928 | is started |
| 6929 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6930 | if (( !pWDICtx->bScanInProgress ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6931 | ( WDI_SCAN_STARTED_ST != pWDICtx->uScanState )) |
| 6932 | { |
| 6933 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6934 | "End start not allowed in this state %d %d", |
| 6935 | pWDICtx->bScanInProgress, pWDICtx->uScanState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6936 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6937 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6938 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6939 | } |
| 6940 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6941 | pWDICtx->uScanState = WDI_SCAN_ENDED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6942 | |
| 6943 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6944 | #endif |
| 6945 | |
| 6946 | /*----------------------------------------------------------------------- |
| 6947 | Get message buffer |
| 6948 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6949 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_END_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6950 | sizeof(halEndScanReqMsg.endScanParams), |
| 6951 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6952 | ( usSendSize < (usDataOffset + sizeof(halEndScanReqMsg.endScanParams) ))) |
| 6953 | { |
| 6954 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6955 | "Unable to get send buffer in start scan req %x %x %x", |
| 6956 | pEventData, pwdiEndScanParams, wdiEndScanRspCb); |
| 6957 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6958 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6959 | } |
| 6960 | |
| 6961 | halEndScanReqMsg.endScanParams.scanChannel = pwdiEndScanParams->ucChannel; |
| 6962 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6963 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6964 | &halEndScanReqMsg.endScanParams, |
| 6965 | sizeof(halEndScanReqMsg.endScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6966 | |
| 6967 | pWDICtx->wdiReqStatusCB = pwdiEndScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6968 | pWDICtx->pReqStatusUserData = pwdiEndScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6969 | |
| 6970 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6971 | Send End Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6972 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6973 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6974 | wdiEndScanRspCb, pEventData->pUserData, WDI_END_SCAN_RESP); |
| 6975 | }/*WDI_ProcessEndScanReq*/ |
| 6976 | |
| 6977 | |
| 6978 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6979 | @brief Process Finish Scan Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6980 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6981 | |
| 6982 | @param pWDICtx: pointer to the WLAN DAL context |
| 6983 | pEventData: pointer to the event information structure |
| 6984 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6985 | @see |
| 6986 | @return Result of the function call |
| 6987 | */ |
| 6988 | WDI_Status |
| 6989 | WDI_ProcessFinishScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6990 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6991 | WDI_ControlBlockType* pWDICtx, |
| 6992 | WDI_EventInfoType* pEventData |
| 6993 | ) |
| 6994 | { |
| 6995 | WDI_FinishScanReqParamsType* pwdiFinishScanParams; |
| 6996 | WDI_FinishScanRspCb wdiFinishScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6997 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6998 | wpt_uint16 usDataOffset = 0; |
| 6999 | wpt_uint16 usSendSize = 0; |
| 7000 | wpt_uint8 i = 0; |
| 7001 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7002 | tHalFinishScanReqMsg halFinishScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7003 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7004 | |
| 7005 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7006 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7007 | -------------------------------------------------------------------------*/ |
| 7008 | if (( NULL == pEventData ) || |
| 7009 | ( NULL == pEventData->pEventData) || |
| 7010 | ( NULL == pEventData->pCBfnc)) |
| 7011 | { |
| 7012 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7013 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7014 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7015 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7016 | } |
| 7017 | |
| 7018 | pwdiFinishScanParams = (WDI_FinishScanReqParamsType*)pEventData->pEventData; |
| 7019 | wdiFinishScanRspCb = (WDI_FinishScanRspCb)pEventData->pCBfnc; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7020 | /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN |
| 7021 | * sometimes because of this check the scan request is not being |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7022 | * forwarded to HAL and result in hang*/ |
| 7023 | #if 0 |
| 7024 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7025 | /*----------------------------------------------------------------------- |
| 7026 | Check to see if SCAN is already in progress |
| 7027 | Finish scan gets invoked any scan states. ie. abort scan |
| 7028 | It should be allowed in any states. |
| 7029 | -----------------------------------------------------------------------*/ |
| 7030 | if ( !pWDICtx->bScanInProgress ) |
| 7031 | { |
| 7032 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7033 | "Finish start not allowed in this state %d", |
| 7034 | pWDICtx->bScanInProgress ); |
| 7035 | |
| 7036 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7037 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7038 | } |
| 7039 | |
| 7040 | /*----------------------------------------------------------------------- |
| 7041 | 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] | 7042 | back all subsequent requests will be blocked at BUSY state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7043 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7044 | pWDICtx->uScanState = WDI_SCAN_FINISHED_ST; |
| 7045 | pWDICtx->bScanInProgress = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7046 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7047 | #endif |
| 7048 | |
| 7049 | if ( pWDICtx->bInBmps ) |
| 7050 | { |
| 7051 | // notify DTS that we are entering BMPS |
| 7052 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, NULL); |
| 7053 | } |
| 7054 | |
| 7055 | /*----------------------------------------------------------------------- |
| 7056 | Get message buffer |
| 7057 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7058 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FINISH_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7059 | sizeof(halFinishScanReqMsg.finishScanParams), |
| 7060 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7061 | ( usSendSize < (usDataOffset + sizeof(halFinishScanReqMsg.finishScanParams) ))) |
| 7062 | { |
| 7063 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7064 | "Unable to get send buffer in start scan req %x %x %x", |
| 7065 | pEventData, pwdiFinishScanParams, wdiFinishScanRspCb); |
| 7066 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7067 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7068 | } |
| 7069 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7070 | halFinishScanReqMsg.finishScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7071 | WDI_2_HAL_SCAN_MODE(pwdiFinishScanParams->wdiReqInfo.wdiScanMode); |
| 7072 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7073 | halFinishScanReqMsg.finishScanParams.currentOperChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7074 | pwdiFinishScanParams->wdiReqInfo.ucCurrentOperatingChannel; |
| 7075 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7076 | halFinishScanReqMsg.finishScanParams.cbState = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7077 | WDI_2_HAL_CB_STATE(pwdiFinishScanParams->wdiReqInfo.wdiCBState); |
| 7078 | |
| 7079 | wpalMemoryCopy(halFinishScanReqMsg.finishScanParams.bssid, |
| 7080 | pwdiFinishScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 7081 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7082 | halFinishScanReqMsg.finishScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7083 | pwdiFinishScanParams->wdiReqInfo.bNotifyBSS ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7084 | halFinishScanReqMsg.finishScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7085 | pwdiFinishScanParams->wdiReqInfo.ucFrameType ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7086 | halFinishScanReqMsg.finishScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7087 | pwdiFinishScanParams->wdiReqInfo.ucFrameLength ; |
| 7088 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7089 | halFinishScanReqMsg.finishScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7090 | pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt ; |
| 7091 | |
| 7092 | for (i = 0; i < pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 7093 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7094 | halFinishScanReqMsg.finishScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7095 | pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i] ; |
| 7096 | } |
| 7097 | |
| 7098 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halFinishScanReqMsg.finishScanParams.macMgmtHdr, |
| 7099 | &pwdiFinishScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 7100 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7101 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7102 | &halFinishScanReqMsg.finishScanParams, |
| 7103 | sizeof(halFinishScanReqMsg.finishScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7104 | |
| 7105 | pWDICtx->wdiReqStatusCB = pwdiFinishScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7106 | pWDICtx->pReqStatusUserData = pwdiFinishScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7107 | |
| 7108 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7109 | Send Finish Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7110 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7111 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7112 | wdiFinishScanRspCb, pEventData->pUserData, WDI_FINISH_SCAN_RESP); |
| 7113 | }/*WDI_ProcessFinishScanReq*/ |
| 7114 | |
| 7115 | |
| 7116 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7117 | ASSOCIATION REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7118 | ==========================================================================*/ |
| 7119 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7120 | @brief Process BSS Join for a given Session |
| 7121 | |
| 7122 | @param pWDICtx: pointer to the WLAN DAL context |
| 7123 | pEventData: pointer to the event information structure |
| 7124 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7125 | @see |
| 7126 | @return Result of the function call |
| 7127 | */ |
| 7128 | WDI_Status |
| 7129 | WDI_ProcessBSSSessionJoinReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7130 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7131 | WDI_ControlBlockType* pWDICtx, |
| 7132 | WDI_JoinReqParamsType* pwdiJoinParams, |
| 7133 | WDI_JoinRspCb wdiJoinRspCb, |
| 7134 | void* pUserData |
| 7135 | ) |
| 7136 | { |
| 7137 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7138 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7139 | wpt_uint16 usDataOffset = 0; |
| 7140 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7141 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7142 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7143 | tHalJoinReqMsg halJoinReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7144 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7145 | |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7146 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7147 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7148 | /*------------------------------------------------------------------------ |
| 7149 | Check to see if we have any session with this BSSID already stored, we |
| 7150 | should not |
| 7151 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7152 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 7153 | pwdiJoinParams->wdiReqInfo.macBSSID, |
| 7154 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7155 | |
| 7156 | if ( NULL != pBSSSes ) |
| 7157 | { |
| 7158 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7159 | "Association for this BSSID: " MAC_ADDRESS_STR " is already in place", |
| 7160 | MAC_ADDR_ARRAY(pwdiJoinParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7161 | |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7162 | /*reset the bAssociationInProgress otherwise the next |
| 7163 | *join request will be queued*/ |
| 7164 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 7165 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7166 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7167 | } |
| 7168 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7169 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7170 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7171 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7172 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7173 | if ( NULL == pBSSSes ) |
| 7174 | { |
| 7175 | |
| 7176 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7177 | "DAL has no free sessions - cannot run another join"); |
| 7178 | |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7179 | /*reset the bAssociationInProgress otherwise the next |
| 7180 | *join request will be queued*/ |
| 7181 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7182 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7183 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7184 | } |
| 7185 | |
| 7186 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7187 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7188 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiJoinParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7189 | WDI_MAC_ADDR_LEN); |
| 7190 | |
| 7191 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7192 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7193 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7194 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7195 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7196 | |
| 7197 | /*----------------------------------------------------------------------- |
| 7198 | Get message buffer |
| 7199 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7200 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_JOIN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7201 | sizeof(halJoinReqMsg.joinReqParams), |
| 7202 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7203 | ( usSendSize < (usDataOffset + sizeof(halJoinReqMsg.joinReqParams) ))) |
| 7204 | { |
| 7205 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7206 | "Unable to get send buffer in join req %x %x %x", |
| 7207 | pUserData, pwdiJoinParams, wdiJoinRspCb); |
| 7208 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7209 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7210 | } |
| 7211 | |
| 7212 | wpalMemoryCopy(halJoinReqMsg.joinReqParams.bssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7213 | pwdiJoinParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7214 | |
| 7215 | wpalMemoryCopy(halJoinReqMsg.joinReqParams.selfStaMacAddr, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7216 | pwdiJoinParams->wdiReqInfo.macSTASelf, |
| 7217 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7218 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7219 | halJoinReqMsg.joinReqParams.ucChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7220 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucChannel; |
| 7221 | |
| 7222 | halJoinReqMsg.joinReqParams.linkState = pwdiJoinParams->wdiReqInfo.linkState; |
| 7223 | |
Madan Mohan Koyyalamudi | 83b1282 | 2012-11-02 12:43:10 -0700 | [diff] [blame] | 7224 | #ifdef WLAN_FEATURE_VOWIFI |
| 7225 | halJoinReqMsg.joinReqParams.maxTxPower = |
| 7226 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.cMaxTxPower; |
| 7227 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7228 | halJoinReqMsg.joinReqParams.ucLocalPowerConstraint = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7229 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucLocalPowerConstraint; |
| 7230 | #endif |
| 7231 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7232 | halJoinReqMsg.joinReqParams.secondaryChannelOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7233 | WDI_2_HAL_SEC_CH_OFFSET(pwdiJoinParams->wdiReqInfo.wdiChannelInfo. |
| 7234 | wdiSecondaryChannelOffset); |
| 7235 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7236 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7237 | &halJoinReqMsg.joinReqParams, |
| 7238 | sizeof(halJoinReqMsg.joinReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7239 | |
| 7240 | pWDICtx->wdiReqStatusCB = pwdiJoinParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7241 | pWDICtx->pReqStatusUserData = pwdiJoinParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7242 | |
| 7243 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7244 | Send Join Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7245 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7246 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 7247 | wdiJoinRspCb, pUserData, WDI_JOIN_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7248 | |
| 7249 | }/*WDI_ProcessBSSSessionJoinReq*/ |
| 7250 | |
| 7251 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7252 | @brief Process Join Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7253 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7254 | |
| 7255 | @param pWDICtx: pointer to the WLAN DAL context |
| 7256 | pEventData: pointer to the event information structure |
| 7257 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7258 | @see |
| 7259 | @return Result of the function call |
| 7260 | */ |
| 7261 | WDI_Status |
| 7262 | WDI_ProcessJoinReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7263 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7264 | WDI_ControlBlockType* pWDICtx, |
| 7265 | WDI_EventInfoType* pEventData |
| 7266 | ) |
| 7267 | { |
| 7268 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 7269 | WDI_JoinReqParamsType* pwdiJoinParams = NULL; |
| 7270 | WDI_JoinRspCb wdiJoinRspCb = NULL; |
| 7271 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7272 | |
| 7273 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7274 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7275 | -------------------------------------------------------------------------*/ |
| 7276 | if (( NULL == pEventData ) || |
| 7277 | ( NULL == (pwdiJoinParams = (WDI_JoinReqParamsType*)pEventData->pEventData)) || |
| 7278 | ( NULL == (wdiJoinRspCb = (WDI_JoinRspCb)pEventData->pCBfnc))) |
| 7279 | { |
| 7280 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7281 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7282 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7283 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7284 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7285 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7286 | /*------------------------------------------------------------------------- |
| 7287 | 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] | 7288 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7289 | -------------------------------------------------------------------------*/ |
| 7290 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7291 | |
| 7292 | if ( eWLAN_PAL_FALSE != pWDICtx->bAssociationInProgress ) |
| 7293 | { |
| 7294 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7295 | "Association is currently in progress, queueing new join req"); |
| 7296 | |
| 7297 | /*Association is in progress - queue current one*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7298 | wdiStatus = WDI_QueueNewAssocRequest(pWDICtx, pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7299 | pwdiJoinParams->wdiReqInfo.macBSSID); |
| 7300 | |
| 7301 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7302 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7303 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7304 | } |
| 7305 | |
| 7306 | /*Starting a new association */ |
| 7307 | pWDICtx->bAssociationInProgress = eWLAN_PAL_TRUE; |
| 7308 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7309 | |
| 7310 | /*Process the Join Request*/ |
| 7311 | return WDI_ProcessBSSSessionJoinReq( pWDICtx, pwdiJoinParams, |
| 7312 | wdiJoinRspCb,pEventData->pUserData); |
| 7313 | |
| 7314 | }/*WDI_ProcessJoinReq*/ |
| 7315 | |
| 7316 | |
| 7317 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7318 | @brief Process Config BSS Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7319 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7320 | |
| 7321 | @param pWDICtx: pointer to the WLAN DAL context |
| 7322 | pEventData: pointer to the event information structure |
| 7323 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7324 | @see |
| 7325 | @return Result of the function call |
| 7326 | */ |
| 7327 | WDI_Status |
| 7328 | WDI_ProcessConfigBSSReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7329 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7330 | WDI_ControlBlockType* pWDICtx, |
| 7331 | WDI_EventInfoType* pEventData |
| 7332 | ) |
| 7333 | { |
| 7334 | WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams; |
| 7335 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7336 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7337 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7338 | wpt_uint16 uMsgSize = 0; |
| 7339 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7340 | wpt_uint16 usDataOffset = 0; |
| 7341 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7342 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7343 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7344 | tConfigBssReqMsg halConfigBssReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7345 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7346 | |
| 7347 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7348 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7349 | -------------------------------------------------------------------------*/ |
| 7350 | if (( NULL == pEventData ) || |
| 7351 | ( NULL == pEventData->pEventData ) || |
| 7352 | ( NULL == pEventData->pCBfnc )) |
| 7353 | { |
| 7354 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7355 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7356 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7357 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7358 | } |
| 7359 | |
| 7360 | pwdiConfigBSSParams = (WDI_ConfigBSSReqParamsType*)pEventData->pEventData; |
| 7361 | wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pEventData->pCBfnc; |
| 7362 | /*------------------------------------------------------------------------- |
| 7363 | 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] | 7364 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7365 | -------------------------------------------------------------------------*/ |
| 7366 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7367 | |
| 7368 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7369 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7370 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7371 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 7372 | pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
| 7373 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7374 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7375 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7376 | { |
| 7377 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 7378 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7379 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7380 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7381 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7382 | if ( NULL == pBSSSes ) |
| 7383 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7384 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7385 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7386 | "DAL has no free sessions - cannot run another join"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7387 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7388 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7389 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7390 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7391 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7392 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7393 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7394 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7395 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7396 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7397 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7398 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7399 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
| 7400 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7401 | /* 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] | 7402 | * Request in case of IBSS*/ |
| 7403 | if((pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_IBSS_MODE) || |
| 7404 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_INFRA_AP_MODE) || |
| 7405 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_AP_MODE) || |
| 7406 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_STA_MODE)) |
| 7407 | { |
| 7408 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7409 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7410 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7411 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7412 | if ( NULL == pBSSSes ) |
| 7413 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7414 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7415 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7416 | "DAL has no free sessions - cannot run another join"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7417 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7418 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7419 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7420 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7421 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7422 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7423 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7424 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7425 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7426 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7427 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7428 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7429 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
| 7430 | } |
| 7431 | else |
| 7432 | { |
| 7433 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7434 | "%s: Association sequence for this BSS does not yet exist." MAC_ADDRESS_STR "wdiBssType %d", |
| 7435 | __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID), |
| 7436 | pwdiConfigBSSParams->wdiReqInfo.wdiBSSType); |
| 7437 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7438 | /* for IBSS testing */ |
| 7439 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7440 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7441 | } |
| 7442 | #endif |
| 7443 | } |
| 7444 | |
| 7445 | /*------------------------------------------------------------------------ |
| 7446 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7447 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7448 | ------------------------------------------------------------------------*/ |
| 7449 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7450 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7451 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7452 | "%s: Association sequence for this BSS exists but currently queued. " MAC_ADDRESS_STR " bssIdx %d", |
| 7453 | __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID), |
| 7454 | ucCurrentBSSSesIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7455 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7456 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7457 | |
| 7458 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7459 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7460 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7461 | } |
| 7462 | |
| 7463 | /* Cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7464 | wpalMemoryCopy(&pWDICtx->wdiCachedConfigBssReq, |
| 7465 | pwdiConfigBSSParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7466 | sizeof(pWDICtx->wdiCachedConfigBssReq)); |
| 7467 | |
| 7468 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7469 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7470 | /* Allocation of BssReqMsg Memory Based on Firmware Capabilities */ |
| 7471 | #ifdef WLAN_FEATURE_11AC |
| 7472 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 7473 | uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams_V1); // Version - 1 For 11AC |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7474 | else |
| 7475 | #endif |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 7476 | uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams); // default Version - 0 Structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7477 | |
| 7478 | /*----------------------------------------------------------------------- |
| 7479 | Get message buffer |
| 7480 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7481 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_BSS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7482 | uMsgSize, &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7483 | ( usSendSize < (usDataOffset + uMsgSize ))) |
| 7484 | { |
| 7485 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7486 | "Unable to get send buffer in config bss req %x %x %x", |
| 7487 | pEventData, pwdiConfigBSSParams, wdiConfigBSSRspCb); |
| 7488 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7489 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7490 | } |
| 7491 | |
| 7492 | /*Copy the BSS request */ |
Madan Mohan Koyyalamudi | a208d10 | 2012-10-15 15:18:18 -0700 | [diff] [blame] | 7493 | #ifdef WLAN_FEATURE_11AC |
| 7494 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
| 7495 | WDI_CopyWDIConfigBSSToHALConfigBSS( (tConfigBssParams*)&halConfigBssReqMsg.uBssParams.configBssParams_V1, |
| 7496 | &pwdiConfigBSSParams->wdiReqInfo); |
| 7497 | else |
| 7498 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7499 | WDI_CopyWDIConfigBSSToHALConfigBSS( &halConfigBssReqMsg.uBssParams.configBssParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7500 | &pwdiConfigBSSParams->wdiReqInfo); |
| 7501 | |
| 7502 | /* Need to fill in the STA Index to invalid, since at this point we have not |
| 7503 | yet received it from HAL */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7504 | halConfigBssReqMsg.uBssParams.configBssParams.staContext.staIdx = WDI_STA_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7505 | |
| 7506 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7507 | halConfigBssReqMsg.uBssParams.configBssParams.staContext.bssIdx = pBSSSes->ucBSSIdx; |
| 7508 | |
Madan Mohan Koyyalamudi | f244d8f | 2012-11-29 11:21:05 -0800 | [diff] [blame] | 7509 | #ifdef WLAN_FEATURE_11AC |
| 7510 | if (WDI_getFwWlanFeatCaps(DOT11AC)){ |
| 7511 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7512 | &halConfigBssReqMsg.uBssParams.configBssParams_V1, |
| 7513 | uMsgSize); |
| 7514 | }else |
| 7515 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7516 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7517 | &halConfigBssReqMsg.uBssParams.configBssParams, |
| 7518 | uMsgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7519 | |
| 7520 | pWDICtx->wdiReqStatusCB = pwdiConfigBSSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7521 | pWDICtx->pReqStatusUserData = pwdiConfigBSSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7522 | |
| 7523 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7524 | Send Config BSS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7525 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7526 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 7527 | wdiConfigBSSRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7528 | WDI_CONFIG_BSS_RESP); |
| 7529 | |
| 7530 | }/*WDI_ProcessConfigBSSReq*/ |
| 7531 | |
| 7532 | |
| 7533 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7534 | @brief Process Del BSS Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7535 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7536 | |
| 7537 | @param pWDICtx: pointer to the WLAN DAL context |
| 7538 | pEventData: pointer to the event information structure |
| 7539 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7540 | @see |
| 7541 | @return Result of the function call |
| 7542 | */ |
| 7543 | WDI_Status |
| 7544 | WDI_ProcessDelBSSReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7545 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7546 | WDI_ControlBlockType* pWDICtx, |
| 7547 | WDI_EventInfoType* pEventData |
| 7548 | ) |
| 7549 | { |
| 7550 | WDI_DelBSSReqParamsType* pwdiDelBSSParams = NULL; |
| 7551 | WDI_DelBSSRspCb wdiDelBSSRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7552 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7553 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7554 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7555 | wpt_uint16 usDataOffset = 0; |
| 7556 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7557 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7558 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7559 | tDeleteBssReqMsg halBssReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7560 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7561 | |
| 7562 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7563 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7564 | -------------------------------------------------------------------------*/ |
| 7565 | if (( NULL == pEventData ) || |
| 7566 | ( NULL == (pwdiDelBSSParams = (WDI_DelBSSReqParamsType*)pEventData->pEventData)) || |
| 7567 | ( NULL == (wdiDelBSSRspCb = (WDI_DelBSSRspCb)pEventData->pCBfnc))) |
| 7568 | { |
| 7569 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7570 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7571 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7572 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7573 | } |
| 7574 | |
| 7575 | /*------------------------------------------------------------------------- |
| 7576 | 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] | 7577 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7578 | -------------------------------------------------------------------------*/ |
| 7579 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7580 | |
| 7581 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7582 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7583 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7584 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 7585 | pwdiDelBSSParams->ucBssIdx, |
| 7586 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7587 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7588 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7589 | { |
| 7590 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7591 | "%s: BSS does not yet exist. ucBssIdx %d", |
| 7592 | __func__, pwdiDelBSSParams->ucBssIdx); |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 7593 | |
| 7594 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7595 | |
| 7596 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7597 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 7598 | |
| 7599 | /*------------------------------------------------------------------------ |
| 7600 | Check if this BSS is being currently processed or queued, |
| 7601 | if queued - queue the new request as well |
| 7602 | ------------------------------------------------------------------------*/ |
| 7603 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7604 | { |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 7605 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7606 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 7607 | __func__, pwdiDelBSSParams->ucBssIdx); |
| 7608 | |
| 7609 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
| 7610 | |
| 7611 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7612 | |
| 7613 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7614 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 7615 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7616 | /*----------------------------------------------------------------------- |
| 7617 | If we receive a Del BSS request for an association that is already in |
| 7618 | progress, it indicates that the assoc has failed => we no longer have |
| 7619 | an association in progress => we must check for pending associations |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7620 | 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] | 7621 | -----------------------------------------------------------------------*/ |
| 7622 | if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx ) |
| 7623 | { |
| 7624 | /*We can switch to false here because even if a subsequent Join comes in |
| 7625 | it will only be processed when DAL transitions out of BUSY state which |
| 7626 | happens when the Del BSS request comes */ |
| 7627 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 7628 | |
| 7629 | /*Former association is complete - prepare next pending assoc for |
| 7630 | processing */ |
| 7631 | WDI_DequeueAssocRequest(pWDICtx); |
| 7632 | } |
| 7633 | |
| 7634 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7635 | /*----------------------------------------------------------------------- |
| 7636 | Get message buffer |
| 7637 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7638 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BSS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7639 | sizeof(halBssReqMsg.deleteBssParams), |
| 7640 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7641 | ( usSendSize < (usDataOffset + sizeof(halBssReqMsg.deleteBssParams) ))) |
| 7642 | { |
| 7643 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7644 | "Unable to get send buffer in start req %x %x %x", |
| 7645 | pEventData, pwdiDelBSSParams, wdiDelBSSRspCb); |
| 7646 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7647 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7648 | } |
| 7649 | |
| 7650 | /*Fill in the message request structure*/ |
| 7651 | |
| 7652 | /*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] | 7653 | halBssReqMsg.deleteBssParams.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7654 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7655 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7656 | &halBssReqMsg.deleteBssParams, |
| 7657 | sizeof(halBssReqMsg.deleteBssParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7658 | |
| 7659 | pWDICtx->wdiReqStatusCB = pwdiDelBSSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7660 | pWDICtx->pReqStatusUserData = pwdiDelBSSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7661 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7662 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7663 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7664 | Send Del BSS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7665 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7666 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7667 | wdiDelBSSRspCb, pEventData->pUserData, WDI_DEL_BSS_RESP); |
| 7668 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7669 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7670 | }/*WDI_ProcessDelBSSReq*/ |
| 7671 | |
| 7672 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7673 | @brief Process Post Assoc Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7674 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7675 | |
| 7676 | @param pWDICtx: pointer to the WLAN DAL context |
| 7677 | pEventData: pointer to the event information structure |
| 7678 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7679 | @see |
| 7680 | @return Result of the function call |
| 7681 | */ |
| 7682 | WDI_Status |
| 7683 | WDI_ProcessPostAssocReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7684 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7685 | WDI_ControlBlockType* pWDICtx, |
| 7686 | WDI_EventInfoType* pEventData |
| 7687 | ) |
| 7688 | { |
| 7689 | WDI_PostAssocReqParamsType* pwdiPostAssocParams = NULL; |
| 7690 | WDI_PostAssocRspCb wdiPostAssocRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7691 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7692 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7693 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7694 | wpt_uint16 usDataOffset = 0; |
| 7695 | wpt_uint16 usSendSize = 0; |
| 7696 | wpt_uint16 uMsgSize = 0; |
| 7697 | wpt_uint16 uOffset = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7698 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7699 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7700 | tPostAssocReqMsg halPostAssocReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7701 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7702 | |
| 7703 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7704 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7705 | -------------------------------------------------------------------------*/ |
| 7706 | if (( NULL == pEventData ) || |
| 7707 | ( NULL == (pwdiPostAssocParams = (WDI_PostAssocReqParamsType*)pEventData->pEventData)) || |
| 7708 | ( NULL == (wdiPostAssocRspCb = (WDI_PostAssocRspCb)pEventData->pCBfnc))) |
| 7709 | { |
| 7710 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7711 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7712 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7713 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7714 | } |
| 7715 | |
| 7716 | /*------------------------------------------------------------------------- |
| 7717 | 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] | 7718 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7719 | -------------------------------------------------------------------------*/ |
| 7720 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7721 | |
| 7722 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7723 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7724 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7725 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 7726 | pwdiPostAssocParams->wdiBSSParams.macBSSID, |
| 7727 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7728 | |
| 7729 | if ( NULL == pBSSSes ) |
| 7730 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7731 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7732 | "%s: Association sequence for this BSS does not yet exist - " |
| 7733 | "operation not allowed. macBSSID " MAC_ADDRESS_STR, |
| 7734 | __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7735 | |
| 7736 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7737 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7738 | } |
| 7739 | |
| 7740 | /*------------------------------------------------------------------------ |
| 7741 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7742 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7743 | ------------------------------------------------------------------------*/ |
| 7744 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7745 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7746 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7747 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 7748 | __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7749 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7750 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7751 | |
| 7752 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7753 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7754 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7755 | } |
| 7756 | |
| 7757 | /*----------------------------------------------------------------------- |
| 7758 | If Post Assoc was not yet received - the current association must |
| 7759 | be in progress |
| 7760 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7761 | if (( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7762 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 7763 | { |
| 7764 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7765 | "Association sequence for this BSS association no longer in " |
| 7766 | "progress - not allowed"); |
| 7767 | |
| 7768 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7769 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7770 | } |
| 7771 | |
| 7772 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7773 | Post Assoc Request is only allowed in Joining state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7774 | -----------------------------------------------------------------------*/ |
| 7775 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 7776 | { |
| 7777 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7778 | "Post Assoc not allowed before JOIN - failing request"); |
| 7779 | |
| 7780 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7781 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7782 | } |
| 7783 | |
| 7784 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7785 | |
| 7786 | uMsgSize = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams) + |
| 7787 | sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams) ; |
| 7788 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7789 | Fill message for tx over the bus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7790 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7791 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_POST_ASSOC_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7792 | uMsgSize,&pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7793 | ( usSendSize < (usDataOffset + uMsgSize ))) |
| 7794 | { |
| 7795 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7796 | "Unable to get send buffer in start req %x %x %x", |
| 7797 | pEventData, pwdiPostAssocParams, wdiPostAssocRspCb); |
| 7798 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7799 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7800 | } |
| 7801 | |
| 7802 | /*Copy the STA parameters */ |
| 7803 | WDI_CopyWDIStaCtxToHALStaCtx(&halPostAssocReqMsg.postAssocReqParams.configStaParams, |
| 7804 | &pwdiPostAssocParams->wdiSTAParams ); |
| 7805 | |
| 7806 | /* Need to fill in the self STA Index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7807 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7808 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 7809 | pwdiPostAssocParams->wdiSTAParams.macSTA, |
| 7810 | (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configStaParams.staIdx )) |
| 7811 | { |
| 7812 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7813 | "This station does not exist in the WDI Station Table %d"); |
| 7814 | wpalMutexRelease(&pWDICtx->wptMutex); |
Madan Mohan Koyyalamudi | f244d8f | 2012-11-29 11:21:05 -0800 | [diff] [blame] | 7815 | wpalMemoryFree(pSendBuffer); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7816 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7817 | } |
| 7818 | |
| 7819 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7820 | halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7821 | pBSSSes->ucBSSIdx; |
| 7822 | |
| 7823 | /*Copy the BSS parameters */ |
| 7824 | WDI_CopyWDIConfigBSSToHALConfigBSS( &halPostAssocReqMsg.postAssocReqParams.configBssParams, |
| 7825 | &pwdiPostAssocParams->wdiBSSParams); |
| 7826 | |
| 7827 | /* Need to fill in the STA index of the peer */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7828 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7829 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 7830 | pwdiPostAssocParams->wdiBSSParams.wdiSTAContext.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7831 | (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configBssParams.staContext.staIdx)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7832 | { |
| 7833 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7834 | "This station does not exist in the WDI Station Table %d"); |
| 7835 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7836 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7837 | } |
| 7838 | |
| 7839 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7840 | halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7841 | pBSSSes->ucBSSIdx; |
| 7842 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7843 | |
| 7844 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7845 | &halPostAssocReqMsg.postAssocReqParams.configStaParams, |
| 7846 | sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7847 | |
| 7848 | uOffset = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams); |
| 7849 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7850 | wpalMemoryCopy( pSendBuffer+usDataOffset + uOffset, |
| 7851 | &halPostAssocReqMsg.postAssocReqParams.configBssParams, |
| 7852 | sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7853 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7854 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7855 | pWDICtx->wdiReqStatusCB = pwdiPostAssocParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7856 | pWDICtx->pReqStatusUserData = pwdiPostAssocParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7857 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7858 | |
| 7859 | wpalMemoryCopy( &pWDICtx->wdiCachedPostAssocReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7860 | pwdiPostAssocParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7861 | sizeof(pWDICtx->wdiCachedPostAssocReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7862 | |
| 7863 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7864 | Send Post Assoc Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7865 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7866 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7867 | wdiPostAssocRspCb, pEventData->pUserData, WDI_POST_ASSOC_RESP); |
| 7868 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7869 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7870 | }/*WDI_ProcessPostAssocReq*/ |
| 7871 | |
| 7872 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7873 | @brief Process Del STA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7874 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7875 | |
| 7876 | @param pWDICtx: pointer to the WLAN DAL context |
| 7877 | pEventData: pointer to the event information structure |
| 7878 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7879 | @see |
| 7880 | @return Result of the function call |
| 7881 | */ |
| 7882 | WDI_Status |
| 7883 | WDI_ProcessDelSTAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7884 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7885 | WDI_ControlBlockType* pWDICtx, |
| 7886 | WDI_EventInfoType* pEventData |
| 7887 | ) |
| 7888 | { |
| 7889 | WDI_DelSTAReqParamsType* pwdiDelSTAParams; |
| 7890 | WDI_DelSTARspCb wdiDelSTARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7891 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7892 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7893 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7894 | wpt_uint16 usDataOffset = 0; |
| 7895 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7896 | wpt_macAddr macBSSID; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7897 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 7898 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7899 | tDeleteStaReqMsg halDelStaReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7900 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7901 | |
| 7902 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7903 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7904 | -------------------------------------------------------------------------*/ |
| 7905 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 7906 | ( NULL == pEventData->pCBfnc )) |
| 7907 | { |
| 7908 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7909 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7910 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7911 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7912 | } |
| 7913 | |
| 7914 | pwdiDelSTAParams = (WDI_DelSTAReqParamsType*)pEventData->pEventData; |
| 7915 | wdiDelSTARspCb = (WDI_DelSTARspCb)pEventData->pCBfnc; |
| 7916 | /*------------------------------------------------------------------------- |
| 7917 | 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] | 7918 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7919 | -------------------------------------------------------------------------*/ |
| 7920 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7921 | |
| 7922 | /*------------------------------------------------------------------------ |
| 7923 | Find the BSS for which the request is made and identify WDI session |
| 7924 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7925 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 7926 | pwdiDelSTAParams->ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7927 | &macBSSID)) |
| 7928 | { |
| 7929 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7930 | "This station does not exist in the WDI Station Table %d"); |
| 7931 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7932 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7933 | } |
| 7934 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7935 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 7936 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7937 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7938 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7939 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 7940 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7941 | |
| 7942 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7943 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7944 | } |
| 7945 | |
| 7946 | /*------------------------------------------------------------------------ |
| 7947 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7948 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7949 | ------------------------------------------------------------------------*/ |
| 7950 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7951 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7952 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7953 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 7954 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
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 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7957 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7958 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7959 | } |
| 7960 | |
| 7961 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7962 | /*----------------------------------------------------------------------- |
| 7963 | Get message buffer |
| 7964 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7965 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7966 | sizeof(halDelStaReqMsg.delStaParams), |
| 7967 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7968 | ( usSendSize < (usDataOffset + sizeof(halDelStaReqMsg.delStaParams) ))) |
| 7969 | { |
| 7970 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7971 | "Unable to get send buffer in start req %x %x %x", |
| 7972 | pEventData, pwdiDelSTAParams, wdiDelSTARspCb); |
| 7973 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7974 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7975 | } |
| 7976 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7977 | halDelStaReqMsg.delStaParams.staIdx = pwdiDelSTAParams->ucSTAIdx; |
| 7978 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7979 | &halDelStaReqMsg.delStaParams, |
| 7980 | sizeof(halDelStaReqMsg.delStaParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7981 | |
| 7982 | pWDICtx->wdiReqStatusCB = pwdiDelSTAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7983 | pWDICtx->pReqStatusUserData = pwdiDelSTAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7984 | |
| 7985 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7986 | Send Del STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7987 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7988 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7989 | wdiDelSTARspCb, pEventData->pUserData, WDI_DEL_STA_RESP); |
| 7990 | |
| 7991 | }/*WDI_ProcessDelSTAReq*/ |
| 7992 | |
| 7993 | |
| 7994 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7995 | SECURITY REQUEST PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7996 | ==========================================================================*/ |
| 7997 | /** |
| 7998 | @brief Process Set BSS Key Request function (called when Main FSM |
| 7999 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8000 | |
| 8001 | @param pWDICtx: pointer to the WLAN DAL context |
| 8002 | pEventData: pointer to the event information structure |
| 8003 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8004 | @see |
| 8005 | @return Result of the function call |
| 8006 | */ |
| 8007 | WDI_Status |
| 8008 | WDI_ProcessSetBssKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8009 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8010 | WDI_ControlBlockType* pWDICtx, |
| 8011 | WDI_EventInfoType* pEventData |
| 8012 | ) |
| 8013 | { |
| 8014 | WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams; |
| 8015 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8016 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8017 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8018 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8019 | wpt_uint16 usDataOffset = 0; |
| 8020 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8021 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8022 | tSetBssKeyReqMsg halSetBssKeyReqMsg = {{0}}; |
| 8023 | wpt_uint8 keyIndex = 0; |
| 8024 | |
| 8025 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8026 | |
| 8027 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8028 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8029 | -------------------------------------------------------------------------*/ |
| 8030 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8031 | ( NULL == pEventData->pCBfnc )) |
| 8032 | { |
| 8033 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8034 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8035 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8036 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8037 | } |
| 8038 | |
| 8039 | pwdiSetBSSKeyParams = (WDI_SetBSSKeyReqParamsType*)pEventData->pEventData; |
| 8040 | wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pEventData->pCBfnc; |
| 8041 | /*------------------------------------------------------------------------- |
| 8042 | 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] | 8043 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8044 | -------------------------------------------------------------------------*/ |
| 8045 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8046 | |
| 8047 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8048 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8049 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8050 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 8051 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx, |
| 8052 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8053 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8054 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8055 | { |
| 8056 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8057 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 8058 | __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8059 | |
| 8060 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8061 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8062 | } |
| 8063 | |
| 8064 | /*------------------------------------------------------------------------ |
| 8065 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8066 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8067 | ------------------------------------------------------------------------*/ |
| 8068 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8069 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8070 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8071 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 8072 | __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8073 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8074 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8075 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8076 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8077 | } |
| 8078 | |
| 8079 | |
| 8080 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8081 | /*----------------------------------------------------------------------- |
| 8082 | Get message buffer |
| 8083 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8084 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BSS_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8085 | sizeof(halSetBssKeyReqMsg.setBssKeyParams), |
| 8086 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8087 | ( usSendSize < (usDataOffset + sizeof(halSetBssKeyReqMsg.setBssKeyParams) ))) |
| 8088 | { |
| 8089 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8090 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8091 | pEventData, pwdiSetBSSKeyParams, wdiSetBSSKeyRspCb); |
| 8092 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8093 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8094 | } |
| 8095 | |
| 8096 | /*----------------------------------------------------------------------- |
| 8097 | Copy the Key parameters into the HAL message |
| 8098 | -----------------------------------------------------------------------*/ |
| 8099 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8100 | halSetBssKeyReqMsg.setBssKeyParams.bssIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8101 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8102 | halSetBssKeyReqMsg.setBssKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8103 | WDI_2_HAL_ENC_TYPE (pwdiSetBSSKeyParams->wdiBSSKeyInfo.wdiEncType); |
| 8104 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8105 | halSetBssKeyReqMsg.setBssKeyParams.numKeys = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8106 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys; |
| 8107 | |
| 8108 | for(keyIndex = 0; keyIndex < pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys ; |
| 8109 | keyIndex++) |
| 8110 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8111 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8112 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyId; |
| 8113 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].unicast = |
| 8114 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].unicast; |
| 8115 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyDirection = |
| 8116 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyDirection; |
| 8117 | wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8118 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8119 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8120 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8121 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8122 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8123 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyLength; |
| 8124 | wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8125 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8126 | WDI_MAX_KEY_LENGTH); |
| 8127 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8128 | |
| 8129 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8130 | &halSetBssKeyReqMsg.setBssKeyParams, |
| 8131 | sizeof(halSetBssKeyReqMsg.setBssKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8132 | |
| 8133 | pWDICtx->wdiReqStatusCB = pwdiSetBSSKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8134 | pWDICtx->pReqStatusUserData = pwdiSetBSSKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8135 | |
| 8136 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8137 | Send Set BSS Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8138 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8139 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8140 | wdiSetBSSKeyRspCb, pEventData->pUserData, |
| 8141 | WDI_SET_BSS_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8142 | |
| 8143 | }/*WDI_ProcessSetBssKeyReq*/ |
| 8144 | |
| 8145 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8146 | @brief Process Remove BSS Key Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8147 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8148 | |
| 8149 | @param pWDICtx: pointer to the WLAN DAL context |
| 8150 | pEventData: pointer to the event information structure |
| 8151 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8152 | @see |
| 8153 | @return Result of the function call |
| 8154 | */ |
| 8155 | WDI_Status |
| 8156 | WDI_ProcessRemoveBssKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8157 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8158 | WDI_ControlBlockType* pWDICtx, |
| 8159 | WDI_EventInfoType* pEventData |
| 8160 | ) |
| 8161 | { |
| 8162 | WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams; |
| 8163 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8164 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8165 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8166 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8167 | wpt_uint16 usDataOffset = 0; |
| 8168 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8169 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8170 | tRemoveBssKeyReqMsg halRemoveBssKeyReqMsg = {{0}}; |
| 8171 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8172 | |
| 8173 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8174 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8175 | -------------------------------------------------------------------------*/ |
| 8176 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8177 | ( NULL == pEventData->pCBfnc )) |
| 8178 | { |
| 8179 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8180 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8181 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8182 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8183 | } |
| 8184 | |
| 8185 | pwdiRemoveBSSKeyParams = (WDI_RemoveBSSKeyReqParamsType*)pEventData->pEventData; |
| 8186 | wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pEventData->pCBfnc; |
| 8187 | /*------------------------------------------------------------------------- |
| 8188 | 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] | 8189 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8190 | -------------------------------------------------------------------------*/ |
| 8191 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8192 | |
| 8193 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8194 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8195 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8196 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 8197 | pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx, |
| 8198 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8199 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8200 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8201 | { |
| 8202 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8203 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 8204 | __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8205 | |
| 8206 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8207 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8208 | } |
| 8209 | |
| 8210 | /*------------------------------------------------------------------------ |
| 8211 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8212 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8213 | ------------------------------------------------------------------------*/ |
| 8214 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8215 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8216 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8217 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 8218 | __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8219 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8220 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8221 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8222 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8223 | } |
| 8224 | |
| 8225 | |
| 8226 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8227 | |
| 8228 | /*----------------------------------------------------------------------- |
| 8229 | Get message buffer |
| 8230 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8231 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_BSS_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8232 | sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams), |
| 8233 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8234 | ( usSendSize < (usDataOffset + sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams) ))) |
| 8235 | { |
| 8236 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8237 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8238 | pEventData, pwdiRemoveBSSKeyParams, wdiRemoveBSSKeyRspCb); |
| 8239 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8240 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8241 | } |
| 8242 | /*----------------------------------------------------------------------- |
| 8243 | Copy the Key parameters into the HAL message |
| 8244 | -----------------------------------------------------------------------*/ |
| 8245 | halRemoveBssKeyReqMsg.removeBssKeyParams.bssIdx = ucCurrentBSSSesIdx; |
| 8246 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8247 | halRemoveBssKeyReqMsg.removeBssKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8248 | WDI_2_HAL_ENC_TYPE (pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiEncType); |
| 8249 | |
| 8250 | halRemoveBssKeyReqMsg.removeBssKeyParams.keyId = pwdiRemoveBSSKeyParams->wdiKeyInfo.ucKeyId; |
| 8251 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8252 | halRemoveBssKeyReqMsg.removeBssKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8253 | WDI_2_HAL_WEP_TYPE(pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiWEPType); |
| 8254 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8255 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8256 | &halRemoveBssKeyReqMsg.removeBssKeyParams, |
| 8257 | sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8258 | |
| 8259 | pWDICtx->wdiReqStatusCB = pwdiRemoveBSSKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8260 | pWDICtx->pReqStatusUserData = pwdiRemoveBSSKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8261 | |
| 8262 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8263 | Send Remove BSS Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8264 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8265 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8266 | wdiRemoveBSSKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8267 | WDI_RMV_BSS_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8268 | }/*WDI_ProcessRemoveBssKeyReq*/ |
| 8269 | |
| 8270 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8271 | @brief Process Set STA KeyRequest function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8272 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8273 | |
| 8274 | @param pWDICtx: pointer to the WLAN DAL context |
| 8275 | pEventData: pointer to the event information structure |
| 8276 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8277 | @see |
| 8278 | @return Result of the function call |
| 8279 | */ |
| 8280 | WDI_Status |
| 8281 | WDI_ProcessSetStaKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8282 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8283 | WDI_ControlBlockType* pWDICtx, |
| 8284 | WDI_EventInfoType* pEventData |
| 8285 | ) |
| 8286 | { |
| 8287 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams; |
| 8288 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 8289 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8290 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8291 | wpt_uint16 usDataOffset = 0; |
| 8292 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8293 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8294 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8295 | wpt_uint8 ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8296 | tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}}; |
| 8297 | wpt_uint8 keyIndex = 0; |
| 8298 | |
| 8299 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8300 | |
| 8301 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8302 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8303 | -------------------------------------------------------------------------*/ |
| 8304 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8305 | ( NULL == pEventData->pCBfnc )) |
| 8306 | { |
| 8307 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8308 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8309 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8310 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8311 | } |
| 8312 | |
| 8313 | pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData; |
| 8314 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc; |
| 8315 | /*------------------------------------------------------------------------- |
| 8316 | 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] | 8317 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8318 | -------------------------------------------------------------------------*/ |
| 8319 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8320 | |
| 8321 | /*------------------------------------------------------------------------ |
| 8322 | Find the BSS for which the request is made and identify WDI session |
| 8323 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8324 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8325 | pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8326 | &macBSSID)) |
| 8327 | { |
| 8328 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8329 | "This station does not exist in the WDI Station Table %d"); |
| 8330 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8331 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8332 | } |
| 8333 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8334 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8335 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8336 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8337 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8338 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8339 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8340 | |
| 8341 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8342 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8343 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8344 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8345 | /*------------------------------------------------------------------------ |
| 8346 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8347 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8348 | ------------------------------------------------------------------------*/ |
| 8349 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8350 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8351 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8352 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8353 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8354 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8355 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8356 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8357 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8358 | } |
| 8359 | |
| 8360 | |
| 8361 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8362 | /*----------------------------------------------------------------------- |
| 8363 | Get message buffer |
| 8364 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8365 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8366 | sizeof(halSetStaKeyReqMsg.setStaKeyParams), |
| 8367 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8368 | ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) ))) |
| 8369 | { |
| 8370 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8371 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8372 | pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb); |
| 8373 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8374 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8375 | } |
| 8376 | /*----------------------------------------------------------------------- |
| 8377 | Copy the STA Key parameters into the HAL message |
| 8378 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8379 | halSetStaKeyReqMsg.setStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8380 | WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8381 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8382 | halSetStaKeyReqMsg.setStaKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8383 | WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType ); |
| 8384 | |
| 8385 | halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8386 | |
| 8387 | halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx; |
| 8388 | |
| 8389 | halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc; |
| 8390 | |
| 8391 | #ifdef WLAN_SOFTAP_FEATURE |
| 8392 | for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ; |
| 8393 | keyIndex++) |
| 8394 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8395 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8396 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId; |
| 8397 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast = |
| 8398 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast; |
| 8399 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection = |
| 8400 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection; |
| 8401 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8402 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8403 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8404 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8405 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8406 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8407 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength; |
| 8408 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8409 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8410 | WDI_MAX_KEY_LENGTH); |
| 8411 | } |
| 8412 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8413 | halSetStaKeyReqMsg.setStaKeyParams.key.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8414 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId; |
| 8415 | halSetStaKeyReqMsg.setStaKeyParams.key.unicast = |
| 8416 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast; |
| 8417 | halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection = |
| 8418 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection; |
| 8419 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8420 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8421 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8422 | halSetStaKeyReqMsg.setStaKeyParams.key.paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8423 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8424 | halSetStaKeyReqMsg.setStaKeyParams.key.keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8425 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength; |
| 8426 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8427 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8428 | WDI_MAX_KEY_LENGTH); |
| 8429 | #endif |
| 8430 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8431 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8432 | &halSetStaKeyReqMsg.setStaKeyParams, |
| 8433 | sizeof(halSetStaKeyReqMsg.setStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8434 | |
| 8435 | pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8436 | pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8437 | |
| 8438 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8439 | Send Set STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8440 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8441 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8442 | wdiSetSTAKeyRspCb, pEventData->pUserData, |
| 8443 | WDI_SET_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8444 | |
| 8445 | }/*WDI_ProcessSetSTAKeyReq*/ |
| 8446 | |
| 8447 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8448 | @brief Process Remove STA Key Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8449 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8450 | |
| 8451 | @param pWDICtx: pointer to the WLAN DAL context |
| 8452 | pEventData: pointer to the event information structure |
| 8453 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8454 | @see |
| 8455 | @return Result of the function call |
| 8456 | */ |
| 8457 | WDI_Status |
| 8458 | WDI_ProcessRemoveStaKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8459 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8460 | WDI_ControlBlockType* pWDICtx, |
| 8461 | WDI_EventInfoType* pEventData |
| 8462 | ) |
| 8463 | { |
| 8464 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams; |
| 8465 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 8466 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8467 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8468 | wpt_uint16 usDataOffset = 0; |
| 8469 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8470 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8471 | wpt_macAddr macBSSID; |
| 8472 | wpt_uint8 ucCurrentBSSSesIdx; |
| 8473 | tRemoveStaKeyReqMsg halRemoveStaKeyReqMsg = {{0}}; |
| 8474 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8475 | |
| 8476 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8477 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8478 | -------------------------------------------------------------------------*/ |
| 8479 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8480 | ( NULL == pEventData->pCBfnc )) |
| 8481 | { |
| 8482 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8483 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8484 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8485 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8486 | } |
| 8487 | |
| 8488 | pwdiRemoveSTAKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData; |
| 8489 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc; |
| 8490 | /*------------------------------------------------------------------------- |
| 8491 | 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] | 8492 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8493 | -------------------------------------------------------------------------*/ |
| 8494 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8495 | |
| 8496 | /*------------------------------------------------------------------------ |
| 8497 | Find the BSS for which the request is made and identify WDI session |
| 8498 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8499 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8500 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8501 | &macBSSID)) |
| 8502 | { |
| 8503 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8504 | "This station does not exist in the WDI Station Table %d"); |
| 8505 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8506 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8507 | } |
| 8508 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8509 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8510 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8511 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8512 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8513 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8514 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8515 | |
| 8516 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8517 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8518 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8519 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8520 | /*------------------------------------------------------------------------ |
| 8521 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8522 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8523 | ------------------------------------------------------------------------*/ |
| 8524 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8525 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8526 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8527 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8528 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8529 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8530 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8531 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8532 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8533 | } |
| 8534 | |
| 8535 | |
| 8536 | |
| 8537 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8538 | /*----------------------------------------------------------------------- |
| 8539 | Get message buffer |
| 8540 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8541 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8542 | sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams), |
| 8543 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8544 | ( usSendSize < (usDataOffset + sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams) ))) |
| 8545 | { |
| 8546 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8547 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8548 | pEventData, pwdiRemoveSTAKeyParams, wdiRemoveSTAKeyRspCb); |
| 8549 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8550 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8551 | } |
| 8552 | |
| 8553 | /*----------------------------------------------------------------------- |
| 8554 | Copy the Key parameters into the HAL message |
| 8555 | -----------------------------------------------------------------------*/ |
| 8556 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8557 | halRemoveStaKeyReqMsg.removeStaKeyParams.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8558 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8559 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8560 | halRemoveStaKeyReqMsg.removeStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8561 | WDI_2_HAL_ENC_TYPE (pwdiRemoveSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8562 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8563 | halRemoveStaKeyReqMsg.removeStaKeyParams.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8564 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucKeyId; |
| 8565 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8566 | halRemoveStaKeyReqMsg.removeStaKeyParams.unicast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8567 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucUnicast; |
| 8568 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8569 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8570 | &halRemoveStaKeyReqMsg.removeStaKeyParams, |
| 8571 | sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8572 | |
| 8573 | pWDICtx->wdiReqStatusCB = pwdiRemoveSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8574 | pWDICtx->pReqStatusUserData = pwdiRemoveSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8575 | |
| 8576 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8577 | Send Remove STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8578 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8579 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8580 | wdiRemoveSTAKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8581 | WDI_RMV_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8582 | |
| 8583 | }/*WDI_ProcessRemoveSTAKeyReq*/ |
| 8584 | |
| 8585 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8586 | @brief Process Set STA KeyRequest function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8587 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8588 | |
| 8589 | @param pWDICtx: pointer to the WLAN DAL context |
| 8590 | pEventData: pointer to the event information structure |
| 8591 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8592 | @see |
| 8593 | @return Result of the function call |
| 8594 | */ |
| 8595 | WDI_Status |
| 8596 | WDI_ProcessSetStaBcastKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8597 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8598 | WDI_ControlBlockType* pWDICtx, |
| 8599 | WDI_EventInfoType* pEventData |
| 8600 | ) |
| 8601 | { |
| 8602 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams; |
| 8603 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 8604 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8605 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8606 | wpt_uint16 usDataOffset = 0; |
| 8607 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8608 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8609 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8610 | wpt_uint8 ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8611 | tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}}; |
| 8612 | wpt_uint8 keyIndex = 0; |
| 8613 | |
| 8614 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8615 | |
| 8616 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8617 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8618 | -------------------------------------------------------------------------*/ |
| 8619 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8620 | ( NULL == pEventData->pCBfnc )) |
| 8621 | { |
| 8622 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8623 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8624 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8625 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8626 | } |
| 8627 | |
| 8628 | pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData; |
| 8629 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc; |
| 8630 | /*------------------------------------------------------------------------- |
| 8631 | 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] | 8632 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8633 | -------------------------------------------------------------------------*/ |
| 8634 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8635 | |
| 8636 | /*------------------------------------------------------------------------ |
| 8637 | Find the BSS for which the request is made and identify WDI session |
| 8638 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8639 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8640 | pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8641 | &macBSSID)) |
| 8642 | { |
| 8643 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8644 | "This station does not exist in the WDI Station Table %d"); |
| 8645 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8646 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8647 | } |
| 8648 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8649 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8650 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8651 | { |
| 8652 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8653 | "Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8654 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8655 | |
| 8656 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8657 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8658 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8659 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8660 | /*------------------------------------------------------------------------ |
| 8661 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8662 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8663 | ------------------------------------------------------------------------*/ |
| 8664 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8665 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8666 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8667 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8668 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8669 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8670 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8671 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8672 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8673 | } |
| 8674 | |
| 8675 | |
| 8676 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8677 | /*----------------------------------------------------------------------- |
| 8678 | Get message buffer |
| 8679 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8680 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8681 | sizeof(halSetStaKeyReqMsg.setStaKeyParams), |
| 8682 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8683 | ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) ))) |
| 8684 | { |
| 8685 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8686 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8687 | pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb); |
| 8688 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8689 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8690 | } |
| 8691 | /*----------------------------------------------------------------------- |
| 8692 | Copy the STA Key parameters into the HAL message |
| 8693 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8694 | halSetStaKeyReqMsg.setStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8695 | WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8696 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8697 | halSetStaKeyReqMsg.setStaKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8698 | WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType ); |
| 8699 | |
| 8700 | halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8701 | |
| 8702 | halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx; |
| 8703 | |
| 8704 | halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc; |
| 8705 | |
| 8706 | #ifdef WLAN_SOFTAP_FEATURE |
| 8707 | for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ; |
| 8708 | keyIndex++) |
| 8709 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8710 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8711 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId; |
| 8712 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast = |
| 8713 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast; |
| 8714 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection = |
| 8715 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection; |
| 8716 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8717 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8718 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8719 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8720 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8721 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8722 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength; |
| 8723 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8724 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8725 | WDI_MAX_KEY_LENGTH); |
| 8726 | } |
| 8727 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8728 | halSetStaKeyReqMsg.setStaKeyParams.key.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8729 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId; |
| 8730 | halSetStaKeyReqMsg.setStaKeyParams.key.unicast = |
| 8731 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast; |
| 8732 | halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection = |
| 8733 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection; |
| 8734 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8735 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8736 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8737 | halSetStaKeyReqMsg.setStaKeyParams.key.paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8738 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8739 | halSetStaKeyReqMsg.setStaKeyParams.key.keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8740 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength; |
| 8741 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8742 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8743 | WDI_MAX_KEY_LENGTH); |
| 8744 | #endif |
| 8745 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8746 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8747 | &halSetStaKeyReqMsg.setStaKeyParams, |
| 8748 | sizeof(halSetStaKeyReqMsg.setStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8749 | |
| 8750 | pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8751 | pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8752 | |
| 8753 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8754 | Send Set STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8755 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8756 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8757 | wdiSetSTAKeyRspCb, pEventData->pUserData, |
| 8758 | WDI_SET_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8759 | |
| 8760 | }/*WDI_ProcessSetSTABcastKeyReq*/ |
| 8761 | |
| 8762 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8763 | @brief Process Remove STA Key Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8764 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8765 | |
| 8766 | @param pWDICtx: pointer to the WLAN DAL context |
| 8767 | pEventData: pointer to the event information structure |
| 8768 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8769 | @see |
| 8770 | @return Result of the function call |
| 8771 | */ |
| 8772 | WDI_Status |
| 8773 | WDI_ProcessRemoveStaBcastKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8774 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8775 | WDI_ControlBlockType* pWDICtx, |
| 8776 | WDI_EventInfoType* pEventData |
| 8777 | ) |
| 8778 | { |
| 8779 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams; |
| 8780 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 8781 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8782 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8783 | wpt_uint16 usDataOffset = 0; |
| 8784 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8785 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8786 | wpt_macAddr macBSSID; |
| 8787 | wpt_uint8 ucCurrentBSSSesIdx; |
| 8788 | tRemoveStaKeyReqMsg halRemoveStaBcastKeyReqMsg = {{0}}; |
| 8789 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8790 | |
| 8791 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8792 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8793 | -------------------------------------------------------------------------*/ |
| 8794 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8795 | ( NULL == pEventData->pCBfnc )) |
| 8796 | { |
| 8797 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8798 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8799 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8800 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8801 | } |
| 8802 | |
| 8803 | pwdiRemoveSTABcastKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData; |
| 8804 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc; |
| 8805 | /*------------------------------------------------------------------------- |
| 8806 | 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] | 8807 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8808 | -------------------------------------------------------------------------*/ |
| 8809 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8810 | |
| 8811 | /*------------------------------------------------------------------------ |
| 8812 | Find the BSS for which the request is made and identify WDI session |
| 8813 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8814 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8815 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8816 | &macBSSID)) |
| 8817 | { |
| 8818 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8819 | "This station does not exist in the WDI Station Table %d"); |
| 8820 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8821 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8822 | } |
| 8823 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8824 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8825 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8826 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8827 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8828 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8829 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8830 | |
| 8831 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8832 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8833 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8834 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8835 | /*------------------------------------------------------------------------ |
| 8836 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8837 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8838 | ------------------------------------------------------------------------*/ |
| 8839 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8840 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8841 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8842 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8843 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8844 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8845 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8846 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8847 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8848 | } |
| 8849 | |
| 8850 | |
| 8851 | |
| 8852 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8853 | /*----------------------------------------------------------------------- |
| 8854 | Get message buffer |
| 8855 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8856 | 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] | 8857 | sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams), |
| 8858 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8859 | ( usSendSize < (usDataOffset + sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams) ))) |
| 8860 | { |
| 8861 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8862 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8863 | pEventData, pwdiRemoveSTABcastKeyParams, wdiRemoveSTAKeyRspCb); |
| 8864 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8865 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8866 | } |
| 8867 | |
| 8868 | /*----------------------------------------------------------------------- |
| 8869 | Copy the Key parameters into the HAL message |
| 8870 | -----------------------------------------------------------------------*/ |
| 8871 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8872 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8873 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8874 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8875 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8876 | WDI_2_HAL_ENC_TYPE (pwdiRemoveSTABcastKeyParams->wdiKeyInfo.wdiEncType); |
| 8877 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8878 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8879 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucKeyId; |
| 8880 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8881 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.unicast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8882 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucUnicast; |
| 8883 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8884 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8885 | &halRemoveStaBcastKeyReqMsg.removeStaKeyParams, |
| 8886 | sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8887 | |
| 8888 | pWDICtx->wdiReqStatusCB = pwdiRemoveSTABcastKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8889 | pWDICtx->pReqStatusUserData = pwdiRemoveSTABcastKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8890 | |
| 8891 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8892 | Send Remove STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8893 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8894 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8895 | wdiRemoveSTAKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8896 | WDI_RMV_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8897 | |
| 8898 | }/*WDI_ProcessRemoveSTABcastKeyReq*/ |
| 8899 | |
| 8900 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8901 | QOS and BA PROCESSING REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8902 | ==========================================================================*/ |
| 8903 | /** |
| 8904 | @brief Process Add TSpec Request function (called when Main FSM |
| 8905 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8906 | |
| 8907 | @param pWDICtx: pointer to the WLAN DAL context |
| 8908 | pEventData: pointer to the event information structure |
| 8909 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8910 | @see |
| 8911 | @return Result of the function call |
| 8912 | */ |
| 8913 | WDI_Status |
| 8914 | WDI_ProcessAddTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8915 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8916 | WDI_ControlBlockType* pWDICtx, |
| 8917 | WDI_EventInfoType* pEventData |
| 8918 | ) |
| 8919 | { |
| 8920 | WDI_AddTSReqParamsType* pwdiAddTSParams; |
| 8921 | WDI_AddTsRspCb wdiAddTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8922 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8923 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8924 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8925 | wpt_uint16 usDataOffset = 0; |
| 8926 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8927 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8928 | wpt_macAddr macBSSID; |
| 8929 | tAddTsParams halAddTsParams = {0}; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8930 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8931 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8932 | |
| 8933 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8934 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8935 | -------------------------------------------------------------------------*/ |
| 8936 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8937 | ( NULL == pEventData->pCBfnc )) |
| 8938 | { |
| 8939 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8940 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8941 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8942 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8943 | } |
| 8944 | |
| 8945 | pwdiAddTSParams = (WDI_AddTSReqParamsType*)pEventData->pEventData; |
| 8946 | wdiAddTSRspCb = (WDI_AddTsRspCb)pEventData->pCBfnc; |
| 8947 | /*------------------------------------------------------------------------- |
| 8948 | 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] | 8949 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8950 | -------------------------------------------------------------------------*/ |
| 8951 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8952 | |
| 8953 | /*------------------------------------------------------------------------ |
| 8954 | Find the BSS for which the request is made and identify WDI session |
| 8955 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8956 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8957 | pwdiAddTSParams->wdiTsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8958 | &macBSSID)) |
| 8959 | { |
| 8960 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8961 | "This station does not exist in the WDI Station Table %d"); |
| 8962 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8963 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8964 | } |
| 8965 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8966 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8967 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8968 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8969 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8970 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8971 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8972 | |
| 8973 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8974 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8975 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8976 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8977 | /*------------------------------------------------------------------------ |
| 8978 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8979 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8980 | ------------------------------------------------------------------------*/ |
| 8981 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8982 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8983 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8984 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8985 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8986 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8987 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8988 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8989 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8990 | } |
| 8991 | |
| 8992 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8993 | /*----------------------------------------------------------------------- |
| 8994 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8995 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8996 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8997 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_TS_REQ, |
| 8998 | sizeof(halAddTsParams), |
| 8999 | &pSendBuffer, &usDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9000 | &usSendSize))|| |
| 9001 | ( usSendSize < (usDataOffset + sizeof(halAddTsParams) ))) |
| 9002 | { |
| 9003 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9004 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9005 | pEventData, pwdiAddTSParams, wdiAddTSRspCb); |
| 9006 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9007 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9008 | } |
| 9009 | |
| 9010 | halAddTsParams.staIdx = pwdiAddTSParams->wdiTsInfo.ucSTAIdx; |
| 9011 | halAddTsParams.tspecIdx = pwdiAddTSParams->wdiTsInfo.ucTspecIdx; |
| 9012 | |
| 9013 | //TSPEC IE |
| 9014 | halAddTsParams.tspec.type = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucType; |
| 9015 | halAddTsParams.tspec.length = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucLength; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9016 | halAddTsParams.tspec.nomMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9017 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usNomMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9018 | halAddTsParams.tspec.maxMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9019 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMaxMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9020 | halAddTsParams.tspec.minSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9021 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9022 | halAddTsParams.tspec.maxSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9023 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9024 | halAddTsParams.tspec.inactInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9025 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uInactInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9026 | halAddTsParams.tspec.suspendInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9027 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSuspendInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9028 | halAddTsParams.tspec.svcStartTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9029 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSvcStartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9030 | halAddTsParams.tspec.minDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9031 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9032 | halAddTsParams.tspec.meanDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9033 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMeanDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9034 | halAddTsParams.tspec.peakDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9035 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uPeakDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9036 | halAddTsParams.tspec.maxBurstSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9037 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxBurstSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9038 | halAddTsParams.tspec.delayBound = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9039 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uDelayBound; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9040 | halAddTsParams.tspec.minPhyRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9041 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinPhyRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9042 | halAddTsParams.tspec.surplusBw = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9043 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usSurplusBw; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9044 | halAddTsParams.tspec.mediumTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9045 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMediumTime; |
| 9046 | |
| 9047 | //TSPEC IE : TS INFO : TRAFFIC |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9048 | halAddTsParams.tspec.tsinfo.traffic.ackPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9049 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.accessPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9050 | halAddTsParams.tspec.tsinfo.traffic.userPrio = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9051 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.userPrio; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9052 | halAddTsParams.tspec.tsinfo.traffic.psb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9053 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.psb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9054 | halAddTsParams.tspec.tsinfo.traffic.aggregation = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9055 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.aggregation; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9056 | halAddTsParams.tspec.tsinfo.traffic.direction = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9057 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.direction; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9058 | halAddTsParams.tspec.tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9059 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.tsid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9060 | halAddTsParams.tspec.tsinfo.traffic.trafficType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9061 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.trafficType; |
| 9062 | |
| 9063 | //TSPEC IE : TS INFO : SCHEDULE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9064 | halAddTsParams.tspec.tsinfo.schedule.rsvd = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9065 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.rsvd; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9066 | halAddTsParams.tspec.tsinfo.schedule.schedule = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9067 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.schedule; |
| 9068 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9069 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9070 | &halAddTsParams, |
| 9071 | sizeof(halAddTsParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9072 | |
| 9073 | pWDICtx->wdiReqStatusCB = pwdiAddTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9074 | pWDICtx->pReqStatusUserData = pwdiAddTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9075 | |
| 9076 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9077 | Send Add TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9078 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9079 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9080 | wdiAddTSRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9081 | WDI_ADD_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9082 | }/*WDI_ProcessAddTSpecReq*/ |
| 9083 | |
| 9084 | |
| 9085 | /** |
| 9086 | @brief Process Del TSpec Request function (called when Main FSM |
| 9087 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9088 | |
| 9089 | @param pWDICtx: pointer to the WLAN DAL context |
| 9090 | pEventData: pointer to the event information structure |
| 9091 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9092 | @see |
| 9093 | @return Result of the function call |
| 9094 | */ |
| 9095 | WDI_Status |
| 9096 | WDI_ProcessDelTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9097 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9098 | WDI_ControlBlockType* pWDICtx, |
| 9099 | WDI_EventInfoType* pEventData |
| 9100 | ) |
| 9101 | { |
| 9102 | WDI_DelTSReqParamsType* pwdiDelTSParams; |
| 9103 | WDI_DelTsRspCb wdiDelTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9104 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9105 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9106 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9107 | wpt_uint16 usDataOffset = 0; |
| 9108 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9109 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9110 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9111 | |
| 9112 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9113 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9114 | -------------------------------------------------------------------------*/ |
| 9115 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9116 | ( NULL == pEventData->pCBfnc )) |
| 9117 | { |
| 9118 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9119 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9120 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9121 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9122 | } |
| 9123 | |
| 9124 | pwdiDelTSParams = (WDI_DelTSReqParamsType*)pEventData->pEventData; |
| 9125 | wdiDelTSRspCb = (WDI_DelTsRspCb)pEventData->pCBfnc; |
| 9126 | |
| 9127 | /*------------------------------------------------------------------------- |
| 9128 | 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] | 9129 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9130 | -------------------------------------------------------------------------*/ |
| 9131 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9132 | |
| 9133 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9134 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9135 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9136 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 9137 | pwdiDelTSParams->wdiDelTSInfo.macBSSID, |
| 9138 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9139 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9140 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9141 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9142 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9143 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9144 | __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID)); |
| 9145 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9146 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9147 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9148 | } |
| 9149 | |
| 9150 | /*------------------------------------------------------------------------ |
| 9151 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9152 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9153 | ------------------------------------------------------------------------*/ |
| 9154 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9155 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9156 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9157 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9158 | __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9159 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9160 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9161 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9162 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9163 | } |
| 9164 | |
| 9165 | |
| 9166 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9167 | /*----------------------------------------------------------------------- |
| 9168 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9169 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9170 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9171 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_TS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9172 | sizeof(pwdiDelTSParams->wdiDelTSInfo), |
| 9173 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9174 | ( usSendSize < (usDataOffset + sizeof(pwdiDelTSParams->wdiDelTSInfo) ))) |
| 9175 | { |
| 9176 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9177 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9178 | pEventData, pwdiDelTSParams, wdiDelTSRspCb); |
| 9179 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9180 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9181 | } |
| 9182 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9183 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9184 | &pwdiDelTSParams->wdiDelTSInfo, |
| 9185 | sizeof(pwdiDelTSParams->wdiDelTSInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9186 | |
| 9187 | pWDICtx->wdiReqStatusCB = pwdiDelTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9188 | pWDICtx->pReqStatusUserData = pwdiDelTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9189 | |
| 9190 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9191 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9192 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9193 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9194 | wdiDelTSRspCb, pEventData->pUserData, WDI_DEL_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9195 | }/*WDI_ProcessDelTSpecReq*/ |
| 9196 | |
| 9197 | /** |
| 9198 | @brief Process Update EDCA Params Request function (called when |
| 9199 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9200 | |
| 9201 | @param pWDICtx: pointer to the WLAN DAL context |
| 9202 | pEventData: pointer to the event information structure |
| 9203 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9204 | @see |
| 9205 | @return Result of the function call |
| 9206 | */ |
| 9207 | WDI_Status |
| 9208 | WDI_ProcessUpdateEDCAParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9209 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9210 | WDI_ControlBlockType* pWDICtx, |
| 9211 | WDI_EventInfoType* pEventData |
| 9212 | ) |
| 9213 | { |
| 9214 | WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams; |
| 9215 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9216 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9217 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9218 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9219 | wpt_uint16 usDataOffset = 0; |
| 9220 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9221 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9222 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9223 | |
| 9224 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9225 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9226 | -------------------------------------------------------------------------*/ |
| 9227 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9228 | ( NULL == pEventData->pCBfnc )) |
| 9229 | { |
| 9230 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9231 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9232 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9233 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9234 | } |
| 9235 | |
| 9236 | pwdiUpdateEDCAParams = (WDI_UpdateEDCAParamsType*)pEventData->pEventData; |
| 9237 | wdiUpdateEDCARspCb = (WDI_UpdateEDCAParamsRspCb)pEventData->pCBfnc; |
| 9238 | /*------------------------------------------------------------------------- |
| 9239 | 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] | 9240 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9241 | -------------------------------------------------------------------------*/ |
| 9242 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9243 | |
| 9244 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9245 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9246 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9247 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 9248 | pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx, |
| 9249 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9250 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9251 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9252 | { |
| 9253 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9254 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 9255 | __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9256 | |
| 9257 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9258 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9259 | } |
| 9260 | |
| 9261 | /*------------------------------------------------------------------------ |
| 9262 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9263 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9264 | ------------------------------------------------------------------------*/ |
| 9265 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9266 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9267 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9268 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 9269 | __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9270 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9271 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9272 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9273 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9274 | } |
| 9275 | |
| 9276 | |
| 9277 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9278 | /*----------------------------------------------------------------------- |
| 9279 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9280 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9281 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9282 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_EDCA_PRMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9283 | sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo), |
| 9284 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9285 | ( usSendSize < (usDataOffset + sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo) ))) |
| 9286 | { |
| 9287 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9288 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9289 | pEventData, pwdiUpdateEDCAParams, wdiUpdateEDCARspCb); |
| 9290 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9291 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9292 | } |
| 9293 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9294 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9295 | &pwdiUpdateEDCAParams->wdiEDCAInfo, |
| 9296 | sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9297 | |
| 9298 | pWDICtx->wdiReqStatusCB = pwdiUpdateEDCAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9299 | pWDICtx->pReqStatusUserData = pwdiUpdateEDCAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9300 | |
| 9301 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9302 | Send Update EDCA Params Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9303 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9304 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9305 | wdiUpdateEDCARspCb, pEventData->pUserData, |
| 9306 | WDI_UPD_EDCA_PRMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9307 | }/*WDI_ProcessUpdateEDCAParamsReq*/ |
| 9308 | |
| 9309 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9310 | @brief Process Add BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9311 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9312 | |
| 9313 | @param pWDICtx: pointer to the WLAN DAL context |
| 9314 | pEventData: pointer to the event information structure |
| 9315 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9316 | @see |
| 9317 | @return Result of the function call |
| 9318 | */ |
| 9319 | WDI_Status |
| 9320 | WDI_ProcessAddBASessionReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9321 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9322 | WDI_ControlBlockType* pWDICtx, |
| 9323 | WDI_EventInfoType* pEventData |
| 9324 | ) |
| 9325 | { |
| 9326 | WDI_AddBASessionReqParamsType* pwdiAddBASessionParams; |
| 9327 | WDI_AddBASessionRspCb wdiAddBASessionRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9328 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9329 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9330 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9331 | wpt_uint16 usDataOffset = 0; |
| 9332 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9333 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9334 | wpt_macAddr macBSSID; |
| 9335 | |
| 9336 | tAddBASessionReqMsg halAddBASessionReq; |
| 9337 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9338 | |
| 9339 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9340 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9341 | -------------------------------------------------------------------------*/ |
| 9342 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9343 | ( NULL == pEventData->pCBfnc )) |
| 9344 | { |
| 9345 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9346 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9347 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9348 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9349 | } |
| 9350 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9351 | pwdiAddBASessionParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9352 | (WDI_AddBASessionReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9353 | wdiAddBASessionRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9354 | (WDI_AddBASessionRspCb)pEventData->pCBfnc; |
| 9355 | /*------------------------------------------------------------------------- |
| 9356 | 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] | 9357 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9358 | -------------------------------------------------------------------------*/ |
| 9359 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9360 | |
| 9361 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9362 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9363 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9364 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9365 | pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9366 | &macBSSID)) |
| 9367 | { |
| 9368 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9369 | "This station does not exist in the WDI Station Table %d"); |
| 9370 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9371 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9372 | } |
| 9373 | |
| 9374 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9375 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9376 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9377 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9378 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9379 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9380 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9381 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
| 9382 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9383 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9384 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9385 | } |
| 9386 | |
| 9387 | /*------------------------------------------------------------------------ |
| 9388 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9389 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9390 | ------------------------------------------------------------------------*/ |
| 9391 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9392 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9393 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9394 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9395 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9396 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9397 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9398 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9399 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9400 | } |
| 9401 | |
| 9402 | |
| 9403 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9404 | /*----------------------------------------------------------------------- |
| 9405 | Get message buffer |
| 9406 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9407 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 9408 | WDI_ADD_BA_SESSION_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9409 | sizeof(halAddBASessionReq.addBASessionParams), |
| 9410 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9411 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9412 | (usDataOffset + sizeof(halAddBASessionReq.addBASessionParams) ))) |
| 9413 | { |
| 9414 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9415 | "Unable to get send buffer in Add BA session req %x %x %x", |
| 9416 | pEventData, pwdiAddBASessionParams, wdiAddBASessionRspCb); |
| 9417 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9418 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9419 | } |
| 9420 | |
| 9421 | halAddBASessionReq.addBASessionParams.staIdx = |
| 9422 | pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx; |
| 9423 | wpalMemoryCopy(halAddBASessionReq.addBASessionParams.peerMacAddr, |
| 9424 | pwdiAddBASessionParams->wdiBASessionInfoType.macPeerAddr, |
| 9425 | WDI_MAC_ADDR_LEN); |
| 9426 | halAddBASessionReq.addBASessionParams.baTID = |
| 9427 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaTID; |
| 9428 | halAddBASessionReq.addBASessionParams.baPolicy = |
| 9429 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaPolicy; |
| 9430 | halAddBASessionReq.addBASessionParams.baBufferSize = |
| 9431 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaBufferSize; |
| 9432 | halAddBASessionReq.addBASessionParams.baTimeout = |
| 9433 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaTimeout; |
| 9434 | halAddBASessionReq.addBASessionParams.baSSN = |
| 9435 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaSSN; |
| 9436 | halAddBASessionReq.addBASessionParams.baDirection = |
| 9437 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaDirection; |
| 9438 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9439 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9440 | &halAddBASessionReq.addBASessionParams, |
| 9441 | sizeof(halAddBASessionReq.addBASessionParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9442 | |
| 9443 | pWDICtx->wdiReqStatusCB = pwdiAddBASessionParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9444 | pWDICtx->pReqStatusUserData = pwdiAddBASessionParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9445 | |
| 9446 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9447 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9448 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9449 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9450 | wdiAddBASessionRspCb, pEventData->pUserData, |
| 9451 | WDI_ADD_BA_SESSION_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9452 | }/*WDI_ProcessAddBASessionReq*/ |
| 9453 | |
| 9454 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9455 | @brief Process Del BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9456 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9457 | |
| 9458 | @param pWDICtx: pointer to the WLAN DAL context |
| 9459 | pEventData: pointer to the event information structure |
| 9460 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9461 | @see |
| 9462 | @return Result of the function call |
| 9463 | */ |
| 9464 | WDI_Status |
| 9465 | WDI_ProcessDelBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9466 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9467 | WDI_ControlBlockType* pWDICtx, |
| 9468 | WDI_EventInfoType* pEventData |
| 9469 | ) |
| 9470 | { |
| 9471 | WDI_DelBAReqParamsType* pwdiDelBAParams; |
| 9472 | WDI_DelBARspCb wdiDelBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9473 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9474 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9475 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9476 | wpt_uint16 usDataOffset = 0; |
| 9477 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9478 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9479 | wpt_macAddr macBSSID; |
| 9480 | tDelBAParams halDelBAparam; |
| 9481 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9482 | |
| 9483 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9484 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9485 | -------------------------------------------------------------------------*/ |
| 9486 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9487 | ( NULL == pEventData->pCBfnc )) |
| 9488 | { |
| 9489 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9490 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9491 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9492 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9493 | } |
| 9494 | |
| 9495 | pwdiDelBAParams = (WDI_DelBAReqParamsType*)pEventData->pEventData; |
| 9496 | wdiDelBARspCb = (WDI_DelBARspCb)pEventData->pCBfnc; |
| 9497 | /*------------------------------------------------------------------------- |
| 9498 | 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] | 9499 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9500 | -------------------------------------------------------------------------*/ |
| 9501 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9502 | |
| 9503 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9504 | Find the BSS for which the request is made |
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 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9507 | pwdiDelBAParams->wdiBAInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9508 | &macBSSID)) |
| 9509 | { |
| 9510 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9511 | "This station does not exist in the WDI Station Table %d"); |
| 9512 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9513 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9514 | } |
| 9515 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9516 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9517 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9518 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9519 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9520 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9521 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9522 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9523 | |
| 9524 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9525 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9526 | } |
| 9527 | |
| 9528 | /*------------------------------------------------------------------------ |
| 9529 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9530 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9531 | ------------------------------------------------------------------------*/ |
| 9532 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9533 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9534 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9535 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9536 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
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 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9539 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9540 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9541 | } |
| 9542 | |
| 9543 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9544 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9545 | sizeof(halDelBAparam), |
| 9546 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9547 | ( usSendSize < (usDataOffset + sizeof(halDelBAparam) ))) |
| 9548 | { |
| 9549 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9550 | "Unable to get send buffer for DEL BA req %x %x %x", |
| 9551 | pEventData, pwdiDelBAParams, wdiDelBARspCb); |
| 9552 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9553 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9554 | } |
| 9555 | |
| 9556 | halDelBAparam.staIdx = pwdiDelBAParams->wdiBAInfo.ucSTAIdx; |
| 9557 | halDelBAparam.baTID = pwdiDelBAParams->wdiBAInfo.ucBaTID; |
| 9558 | halDelBAparam.baDirection = pwdiDelBAParams->wdiBAInfo.ucBaDirection; |
| 9559 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9560 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9561 | &halDelBAparam, |
| 9562 | sizeof(halDelBAparam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9563 | |
| 9564 | pWDICtx->wdiReqStatusCB = pwdiDelBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9565 | pWDICtx->pReqStatusUserData = pwdiDelBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9566 | |
| 9567 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9568 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9569 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9570 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9571 | wdiDelBARspCb, pEventData->pUserData, WDI_DEL_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9572 | }/*WDI_ProcessDelBAReq*/ |
| 9573 | |
| 9574 | #ifdef FEATURE_WLAN_CCX |
| 9575 | |
| 9576 | WDI_Status |
| 9577 | WDI_ProcessTSMStatsReq |
| 9578 | ( |
| 9579 | WDI_ControlBlockType* pWDICtx, |
| 9580 | WDI_EventInfoType* pEventData |
| 9581 | ) |
| 9582 | { |
| 9583 | WDI_TSMStatsReqParamsType* pwdiTSMParams; |
| 9584 | WDI_TsmRspCb wdiTSMRspCb; |
| 9585 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 9586 | WDI_BSSSessionType* pBSSSes = NULL; |
| 9587 | wpt_uint8* pSendBuffer = NULL; |
| 9588 | wpt_uint16 usDataOffset = 0; |
| 9589 | wpt_uint16 usSendSize = 0; |
| 9590 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 9591 | tTsmStatsParams halTsmStatsReqParams = {0}; |
| 9592 | |
| 9593 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9594 | |
| 9595 | /*------------------------------------------------------------------------- |
| 9596 | Sanity check |
| 9597 | -------------------------------------------------------------------------*/ |
| 9598 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9599 | ( NULL == pEventData->pCBfnc )) |
| 9600 | { |
| 9601 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9602 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9603 | WDI_ASSERT(0); |
| 9604 | return WDI_STATUS_E_FAILURE; |
| 9605 | } |
| 9606 | |
| 9607 | pwdiTSMParams = (WDI_TSMStatsReqParamsType*)pEventData->pEventData; |
| 9608 | wdiTSMRspCb = (WDI_TsmRspCb)pEventData->pCBfnc; |
| 9609 | /*------------------------------------------------------------------------- |
| 9610 | Check to see if we are in the middle of an association, if so queue, if |
| 9611 | not it means it is free to process request |
| 9612 | -------------------------------------------------------------------------*/ |
| 9613 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9614 | |
| 9615 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, &pBSSSes); |
| 9616 | if ( NULL == pBSSSes ) |
| 9617 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9618 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9619 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9620 | __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9621 | |
| 9622 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9623 | return WDI_STATUS_E_NOT_ALLOWED; |
| 9624 | } |
| 9625 | |
| 9626 | /*------------------------------------------------------------------------ |
| 9627 | Check if this BSS is being currently processed or queued, |
| 9628 | if queued - queue the new request as well |
| 9629 | ------------------------------------------------------------------------*/ |
| 9630 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9631 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9632 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9633 | "s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9634 | __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9635 | |
| 9636 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
| 9637 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9638 | return wdiStatus; |
| 9639 | } |
| 9640 | |
| 9641 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9642 | /*----------------------------------------------------------------------- |
| 9643 | Get message buffer |
| 9644 | ! TO DO : proper conversion into the HAL Message Request Format |
| 9645 | -----------------------------------------------------------------------*/ |
| 9646 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_TSM_STATS_REQ, |
| 9647 | sizeof(halTsmStatsReqParams), |
| 9648 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9649 | ( usSendSize < (usDataOffset + sizeof(halTsmStatsReqParams) ))) |
| 9650 | { |
| 9651 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9652 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9653 | pEventData, pwdiTSMParams, wdiTSMRspCb); |
| 9654 | WDI_ASSERT(0); |
| 9655 | return WDI_STATUS_E_FAILURE; |
| 9656 | } |
| 9657 | |
| 9658 | halTsmStatsReqParams.tsmTID = pwdiTSMParams->wdiTsmStatsParamsInfo.ucTid; |
| 9659 | wpalMemoryCopy(halTsmStatsReqParams.bssId, |
| 9660 | pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, |
| 9661 | WDI_MAC_ADDR_LEN); |
| 9662 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9663 | &halTsmStatsReqParams, |
| 9664 | sizeof(halTsmStatsReqParams)); |
| 9665 | |
| 9666 | pWDICtx->wdiReqStatusCB = pwdiTSMParams->wdiReqStatusCB; |
| 9667 | pWDICtx->pReqStatusUserData = pwdiTSMParams->pUserData; |
| 9668 | |
| 9669 | /*------------------------------------------------------------------------- |
| 9670 | Send TSM Stats Request to HAL |
| 9671 | -------------------------------------------------------------------------*/ |
| 9672 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9673 | wdiTSMRspCb, pEventData->pUserData, |
| 9674 | WDI_TSM_STATS_RESP); |
| 9675 | }/*WDI_ProcessTSMStatsReq*/ |
| 9676 | |
| 9677 | #endif |
| 9678 | |
| 9679 | |
| 9680 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9681 | @brief Process Flush AC Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9682 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9683 | |
| 9684 | @param pWDICtx: pointer to the WLAN DAL context |
| 9685 | pEventData: pointer to the event information structure |
| 9686 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9687 | @see |
| 9688 | @return Result of the function call |
| 9689 | */ |
| 9690 | WDI_Status |
| 9691 | WDI_ProcessFlushAcReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9692 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9693 | WDI_ControlBlockType* pWDICtx, |
| 9694 | WDI_EventInfoType* pEventData |
| 9695 | ) |
| 9696 | { |
| 9697 | WDI_FlushAcReqParamsType* pwdiFlushAcParams = NULL; |
| 9698 | WDI_FlushAcRspCb wdiFlushAcRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9699 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9700 | wpt_uint16 usDataOffset = 0; |
| 9701 | wpt_uint16 usSendSize = 0; |
| 9702 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9703 | |
| 9704 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9705 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9706 | -------------------------------------------------------------------------*/ |
| 9707 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9708 | ( NULL == pEventData->pCBfnc )) |
| 9709 | { |
| 9710 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9711 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9712 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9713 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9714 | } |
| 9715 | |
| 9716 | pwdiFlushAcParams = (WDI_FlushAcReqParamsType*)pEventData->pEventData; |
| 9717 | wdiFlushAcRspCb = (WDI_FlushAcRspCb)pEventData->pCBfnc; |
| 9718 | /*----------------------------------------------------------------------- |
| 9719 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9720 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9721 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9722 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FLUSH_AC_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9723 | sizeof(pwdiFlushAcParams->wdiFlushAcInfo), |
| 9724 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9725 | ( usSendSize < (usDataOffset + sizeof(pwdiFlushAcParams->wdiFlushAcInfo) ))) |
| 9726 | { |
| 9727 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9728 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9729 | pEventData, pwdiFlushAcParams, wdiFlushAcRspCb); |
| 9730 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9731 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9732 | } |
| 9733 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9734 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9735 | &pwdiFlushAcParams->wdiFlushAcInfo, |
| 9736 | sizeof(pwdiFlushAcParams->wdiFlushAcInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9737 | |
| 9738 | pWDICtx->wdiReqStatusCB = pwdiFlushAcParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9739 | pWDICtx->pReqStatusUserData = pwdiFlushAcParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9740 | |
| 9741 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9742 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9743 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9744 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9745 | wdiFlushAcRspCb, pEventData->pUserData, WDI_FLUSH_AC_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9746 | }/*WDI_ProcessFlushAcReq*/ |
| 9747 | |
| 9748 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9749 | @brief Process BT AMP event Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9750 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9751 | |
| 9752 | @param pWDICtx: pointer to the WLAN DAL context |
| 9753 | pEventData: pointer to the event information structure |
| 9754 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9755 | @see |
| 9756 | @return Result of the function call |
| 9757 | */ |
| 9758 | WDI_Status |
| 9759 | WDI_ProcessBtAmpEventReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9760 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9761 | WDI_ControlBlockType* pWDICtx, |
| 9762 | WDI_EventInfoType* pEventData |
| 9763 | ) |
| 9764 | { |
| 9765 | WDI_BtAmpEventParamsType* pwdiBtAmpEventParams = NULL; |
| 9766 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9767 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9768 | wpt_uint16 usDataOffset = 0; |
| 9769 | wpt_uint16 usSendSize = 0; |
| 9770 | |
| 9771 | tBtAmpEventMsg haltBtAmpEventMsg; |
| 9772 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9773 | |
| 9774 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9775 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9776 | -------------------------------------------------------------------------*/ |
| 9777 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9778 | ( NULL == pEventData->pCBfnc )) |
| 9779 | { |
| 9780 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9781 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9782 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9783 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9784 | } |
| 9785 | |
| 9786 | pwdiBtAmpEventParams = (WDI_BtAmpEventParamsType*)pEventData->pEventData; |
| 9787 | wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pEventData->pCBfnc; |
| 9788 | /*----------------------------------------------------------------------- |
| 9789 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9790 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9791 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9792 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_BTAMP_EVENT_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9793 | sizeof(haltBtAmpEventMsg.btAmpEventParams), |
| 9794 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9795 | ( usSendSize < (usDataOffset + sizeof(haltBtAmpEventMsg.btAmpEventParams) ))) |
| 9796 | { |
| 9797 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9798 | "Unable to get send buffer in BT AMP event req %x %x %x", |
| 9799 | pEventData, pwdiBtAmpEventParams, wdiBtAmpEventRspCb); |
| 9800 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9801 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9802 | } |
| 9803 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9804 | haltBtAmpEventMsg.btAmpEventParams.btAmpEventType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9805 | pwdiBtAmpEventParams->wdiBtAmpEventInfo.ucBtAmpEventType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9806 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9807 | &haltBtAmpEventMsg.btAmpEventParams, |
| 9808 | sizeof(haltBtAmpEventMsg.btAmpEventParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9809 | |
| 9810 | pWDICtx->wdiReqStatusCB = pwdiBtAmpEventParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9811 | pWDICtx->pReqStatusUserData = pwdiBtAmpEventParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9812 | |
| 9813 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9814 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9815 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9816 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9817 | wdiBtAmpEventRspCb, pEventData->pUserData, WDI_BTAMP_EVENT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9818 | }/*WDI_ProcessBtAmpEventReq*/ |
| 9819 | |
| 9820 | /** |
| 9821 | @brief Process Add STA self Request function (called when Main FSM |
| 9822 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9823 | |
| 9824 | @param pWDICtx: pointer to the WLAN DAL context |
| 9825 | pEventData: pointer to the event information structure |
| 9826 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9827 | @see |
| 9828 | @return Result of the function call |
| 9829 | */ |
| 9830 | WDI_Status |
| 9831 | WDI_ProcessAddSTASelfReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9832 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9833 | WDI_ControlBlockType* pWDICtx, |
| 9834 | WDI_EventInfoType* pEventData |
| 9835 | ) |
| 9836 | { |
| 9837 | WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams; |
| 9838 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9839 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9840 | wpt_uint16 usDataOffset = 0; |
| 9841 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9842 | tAddStaSelfParams halAddSTASelfParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9843 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9844 | |
| 9845 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9846 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9847 | -------------------------------------------------------------------------*/ |
| 9848 | if (( NULL == pEventData ) || |
| 9849 | ( NULL == pEventData->pEventData) || |
| 9850 | ( NULL == pEventData->pCBfnc)) |
| 9851 | { |
| 9852 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9853 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9854 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9855 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9856 | } |
| 9857 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9858 | pwdiAddSTASelfReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9859 | (WDI_AddSTASelfReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9860 | wdiAddSTASelfReqRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9861 | (WDI_AddSTASelfParamsRspCb)pEventData->pCBfnc; |
| 9862 | /*----------------------------------------------------------------------- |
| 9863 | Get message buffer |
| 9864 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9865 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 9866 | WDI_ADD_STA_SELF_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9867 | sizeof(tAddStaSelfParams), |
| 9868 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9869 | ( usSendSize < (usDataOffset + sizeof(tAddStaSelfParams) ))) |
| 9870 | { |
| 9871 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9872 | "Unable to get send buffer in ADD STA SELF REQ %x %x %x", |
| 9873 | pEventData, pwdiAddSTASelfReqParams, wdiAddSTASelfReqRspCb); |
| 9874 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9875 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9876 | } |
| 9877 | |
| 9878 | /* Cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9879 | wpalMemoryCopy(&pWDICtx->wdiCacheAddSTASelfReq, pwdiAddSTASelfReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9880 | sizeof(pWDICtx->wdiCacheAddSTASelfReq)); |
| 9881 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9882 | wpalMemoryCopy(halAddSTASelfParams.selfMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9883 | pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.selfMacAddr, 6) ; |
| 9884 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9885 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halAddSTASelfParams, |
| 9886 | sizeof(tAddStaSelfParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9887 | |
| 9888 | pWDICtx->wdiReqStatusCB = pwdiAddSTASelfReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9889 | pWDICtx->pReqStatusUserData = pwdiAddSTASelfReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9890 | |
| 9891 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9892 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9893 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9894 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9895 | wdiAddSTASelfReqRspCb, pEventData->pUserData, |
| 9896 | WDI_ADD_STA_SELF_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9897 | }/*WDI_ProcessAddSTASelfReq*/ |
| 9898 | |
| 9899 | |
| 9900 | |
| 9901 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9902 | @brief Process Del Sta Self Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9903 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9904 | |
| 9905 | @param pWDICtx: pointer to the WLAN DAL context |
| 9906 | pEventData: pointer to the event information structure |
| 9907 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9908 | @see |
| 9909 | @return Result of the function call |
| 9910 | */ |
| 9911 | WDI_Status |
| 9912 | WDI_ProcessDelSTASelfReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9913 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9914 | WDI_ControlBlockType* pWDICtx, |
| 9915 | WDI_EventInfoType* pEventData |
| 9916 | ) |
| 9917 | { |
| 9918 | WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams; |
| 9919 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9920 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9921 | wpt_uint16 usDataOffset = 0; |
| 9922 | wpt_uint16 usSendSize = 0; |
| 9923 | tDelStaSelfParams halSetDelSelfSTAParams; |
| 9924 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9925 | |
| 9926 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9927 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9928 | -------------------------------------------------------------------------*/ |
| 9929 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9930 | ( NULL == pEventData->pCBfnc )) |
| 9931 | { |
| 9932 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9933 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9934 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9935 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9936 | } |
| 9937 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9938 | pwdiDelStaSelfReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9939 | (WDI_DelSTASelfReqParamsType*)pEventData->pEventData; |
| 9940 | wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pEventData->pCBfnc; |
| 9941 | |
| 9942 | /*----------------------------------------------------------------------- |
| 9943 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9944 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9945 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9946 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_SELF_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9947 | sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo), |
| 9948 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9949 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9950 | (usDataOffset + sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo) ))) |
| 9951 | { |
| 9952 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9953 | "Unable to get send buffer in Del Sta Self req %x %x %x", |
| 9954 | pEventData, pwdiDelStaSelfReqParams, wdiDelStaSelfRspCb); |
| 9955 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9956 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9957 | } |
| 9958 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9959 | wpalMemoryCopy(halSetDelSelfSTAParams.selfMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9960 | pwdiDelStaSelfReqParams->wdiDelStaSelfInfo.selfMacAddr, 6) ; |
| 9961 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9962 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halSetDelSelfSTAParams, |
| 9963 | sizeof(tDelStaSelfParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9964 | |
| 9965 | pWDICtx->wdiReqStatusCB = pwdiDelStaSelfReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9966 | pWDICtx->pReqStatusUserData = pwdiDelStaSelfReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9967 | |
| 9968 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9969 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9970 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9971 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9972 | wdiDelStaSelfRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9973 | WDI_DEL_STA_SELF_RESP); |
| 9974 | |
| 9975 | } |
| 9976 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9977 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 9978 | /** |
| 9979 | @brief Process Start Oem Data Request function (called when Main |
| 9980 | FSM allows it) |
| 9981 | |
| 9982 | @param pWDICtx: pointer to the WLAN DAL context |
| 9983 | pEventData: pointer to the event information structure |
| 9984 | |
| 9985 | @see |
| 9986 | @return Result of the function call |
| 9987 | */ |
| 9988 | WDI_Status |
| 9989 | WDI_ProcessStartOemDataReq |
| 9990 | ( |
| 9991 | WDI_ControlBlockType* pWDICtx, |
| 9992 | WDI_EventInfoType* pEventData |
| 9993 | ) |
| 9994 | { |
| 9995 | WDI_oemDataReqParamsType* pwdiOemDataReqParams = NULL; |
| 9996 | WDI_oemDataRspCb wdiOemDataRspCb; |
| 9997 | wpt_uint8* pSendBuffer = NULL; |
| 9998 | wpt_uint16 usDataOffset = 0; |
| 9999 | wpt_uint16 usSendSize = 0; |
| 10000 | wpt_uint16 reqLen; |
| 10001 | tStartOemDataReqParams* halStartOemDataReqParams; |
| 10002 | |
| 10003 | /*------------------------------------------------------------------------- |
| 10004 | Sanity check |
| 10005 | -------------------------------------------------------------------------*/ |
| 10006 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10007 | ( NULL == pEventData->pCBfnc )) |
| 10008 | { |
| 10009 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10010 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10011 | WDI_ASSERT(0); |
| 10012 | return WDI_STATUS_E_FAILURE; |
| 10013 | } |
| 10014 | |
| 10015 | pwdiOemDataReqParams = (WDI_oemDataReqParamsType*)pEventData->pEventData; |
| 10016 | wdiOemDataRspCb = (WDI_oemDataRspCb)pEventData->pCBfnc; |
| 10017 | |
| 10018 | /*----------------------------------------------------------------------- |
| 10019 | Get message buffer |
| 10020 | -----------------------------------------------------------------------*/ |
| 10021 | |
| 10022 | reqLen = sizeof(tStartOemDataReqParams); |
| 10023 | |
| 10024 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10025 | WDI_START_OEM_DATA_REQ, reqLen, |
| 10026 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10027 | (usSendSize < (usDataOffset + reqLen))) |
| 10028 | { |
| 10029 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10030 | "Unable to get send buffer in Start Oem Data req %x %x %x", |
| 10031 | pEventData, pwdiOemDataReqParams, wdiOemDataRspCb); |
| 10032 | WDI_ASSERT(0); |
| 10033 | return WDI_STATUS_E_FAILURE; |
| 10034 | } |
| 10035 | |
| 10036 | //copying WDI OEM DATA REQ PARAMS to shared memory |
| 10037 | halStartOemDataReqParams = (tStartOemDataReqParams *)(pSendBuffer + usDataOffset ); |
| 10038 | |
| 10039 | wpalMemoryCopy(&halStartOemDataReqParams->selfMacAddr, &pwdiOemDataReqParams->wdiOemDataReqInfo.selfMacAddr, sizeof(wpt_macAddr)); |
| 10040 | wpalMemoryCopy(&halStartOemDataReqParams->oemDataReq, &pwdiOemDataReqParams->wdiOemDataReqInfo.oemDataReq, OEM_DATA_REQ_SIZE); |
| 10041 | |
| 10042 | pWDICtx->wdiReqStatusCB = pwdiOemDataReqParams->wdiReqStatusCB; |
| 10043 | pWDICtx->pReqStatusUserData = pwdiOemDataReqParams->pUserData; |
| 10044 | |
| 10045 | /*------------------------------------------------------------------------- |
| 10046 | Send Start Request to HAL |
| 10047 | -------------------------------------------------------------------------*/ |
| 10048 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10049 | wdiOemDataRspCb, pEventData->pUserData, |
| 10050 | WDI_START_OEM_DATA_RESP); |
| 10051 | }/*WDI_ProcessStartOemDataReq*/ |
| 10052 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10053 | |
| 10054 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10055 | @brief Process Host Resume Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10056 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10057 | |
| 10058 | @param pWDICtx: pointer to the WLAN DAL context |
| 10059 | pEventData: pointer to the event information structure |
| 10060 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10061 | @see |
| 10062 | @return Result of the function call |
| 10063 | */ |
| 10064 | WDI_Status |
| 10065 | WDI_ProcessHostResumeReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10066 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10067 | WDI_ControlBlockType* pWDICtx, |
| 10068 | WDI_EventInfoType* pEventData |
| 10069 | ) |
| 10070 | { |
| 10071 | WDI_ResumeParamsType* pwdiHostResumeParams = NULL; |
| 10072 | WDI_HostResumeEventRspCb wdiHostResumeRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10073 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10074 | wpt_uint16 usDataOffset = 0; |
| 10075 | wpt_uint16 usSendSize = 0; |
| 10076 | tHalWlanHostResumeReqParam halResumeReqParams; |
| 10077 | |
| 10078 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10079 | |
| 10080 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10081 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10082 | -------------------------------------------------------------------------*/ |
| 10083 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10084 | ( NULL == pEventData->pCBfnc )) |
| 10085 | { |
| 10086 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10087 | "%s: Invalid parameters ",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10088 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10089 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10090 | } |
| 10091 | |
| 10092 | pwdiHostResumeParams = (WDI_ResumeParamsType*)pEventData->pEventData; |
| 10093 | wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pEventData->pCBfnc; |
| 10094 | |
| 10095 | /*----------------------------------------------------------------------- |
| 10096 | Get message buffer |
| 10097 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10098 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10099 | WDI_HOST_RESUME_REQ, sizeof(halResumeReqParams), |
| 10100 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10101 | (usSendSize < (usDataOffset + sizeof(halResumeReqParams)))) |
| 10102 | { |
| 10103 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10104 | "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] | 10105 | pEventData, pwdiHostResumeParams, wdiHostResumeRspCb); |
| 10106 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10107 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10108 | } |
| 10109 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10110 | halResumeReqParams.configuredMcstBcstFilterSetting = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10111 | pwdiHostResumeParams->wdiResumeParams.ucConfiguredMcstBcstFilterSetting; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10112 | |
| 10113 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10114 | &halResumeReqParams, |
| 10115 | sizeof(halResumeReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10116 | |
| 10117 | pWDICtx->wdiReqStatusCB = pwdiHostResumeParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10118 | pWDICtx->pReqStatusUserData = pwdiHostResumeParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10119 | |
| 10120 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10121 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10122 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10123 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10124 | wdiHostResumeRspCb, pEventData->pUserData, |
| 10125 | WDI_HOST_RESUME_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10126 | }/*WDI_ProcessHostResumeReq*/ |
| 10127 | |
| 10128 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10129 | @brief Process set Tx Per Tracking Parameters Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10130 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10131 | |
| 10132 | @param pWDICtx: pointer to the WLAN DAL context |
| 10133 | pEventData: pointer to the event information structure |
| 10134 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10135 | @see |
| 10136 | @return Result of the function call |
| 10137 | */ |
| 10138 | WDI_Status |
| 10139 | WDI_ProcessSetTxPerTrackingReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10140 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10141 | WDI_ControlBlockType* pWDICtx, |
| 10142 | WDI_EventInfoType* pEventData |
| 10143 | ) |
| 10144 | { |
| 10145 | WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams = NULL; |
| 10146 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10147 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10148 | wpt_uint16 usDataOffset = 0; |
| 10149 | wpt_uint16 usSendSize = 0; |
| 10150 | tHalTxPerTrackingReqParam halTxPerTrackingReqParam; |
| 10151 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10152 | |
| 10153 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10154 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10155 | -------------------------------------------------------------------------*/ |
| 10156 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10157 | ( NULL == pEventData->pCBfnc )) |
| 10158 | { |
| 10159 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10160 | "%s: Invalid parameters ",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10161 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10162 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10163 | } |
| 10164 | |
| 10165 | pwdiSetTxPerTrackingReqParams = (WDI_SetTxPerTrackingReqParamsType*)pEventData->pEventData; |
| 10166 | pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pEventData->pCBfnc; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10167 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10168 | /*----------------------------------------------------------------------- |
| 10169 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10170 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10171 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10172 | 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] | 10173 | sizeof(halTxPerTrackingReqParam), |
| 10174 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10175 | ( usSendSize < (usDataOffset + sizeof(halTxPerTrackingReqParam) ))) |
| 10176 | { |
| 10177 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10178 | "Unable to get send buffer in set tx per tracking req %x %x %x", |
| 10179 | pEventData, pwdiSetTxPerTrackingReqParams, pwdiSetTxPerTrackingRspCb); |
| 10180 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10181 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10182 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10183 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10184 | halTxPerTrackingReqParam.ucTxPerTrackingEnable = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingEnable; |
| 10185 | halTxPerTrackingReqParam.ucTxPerTrackingPeriod = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingPeriod; |
| 10186 | halTxPerTrackingReqParam.ucTxPerTrackingRatio = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingRatio; |
| 10187 | halTxPerTrackingReqParam.uTxPerTrackingWatermark = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.uTxPerTrackingWatermark; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10188 | |
| 10189 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10190 | &halTxPerTrackingReqParam, |
| 10191 | sizeof(halTxPerTrackingReqParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10192 | |
| 10193 | pWDICtx->wdiReqStatusCB = pwdiSetTxPerTrackingReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10194 | pWDICtx->pReqStatusUserData = pwdiSetTxPerTrackingReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10195 | |
| 10196 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10197 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10198 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10199 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10200 | pwdiSetTxPerTrackingRspCb, pEventData->pUserData, WDI_SET_TX_PER_TRACKING_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10201 | }/*WDI_ProcessSetTxPerTrackingReq*/ |
| 10202 | |
| 10203 | /*========================================================================= |
| 10204 | Indications |
| 10205 | =========================================================================*/ |
| 10206 | |
| 10207 | /** |
| 10208 | @brief Process Suspend Indications function (called when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10209 | |
| 10210 | @param pWDICtx: pointer to the WLAN DAL context |
| 10211 | pEventData: pointer to the event information structure |
| 10212 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10213 | @see |
| 10214 | @return Result of the function call |
| 10215 | */ |
| 10216 | WDI_Status |
| 10217 | WDI_ProcessHostSuspendInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10218 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10219 | WDI_ControlBlockType* pWDICtx, |
| 10220 | WDI_EventInfoType* pEventData |
| 10221 | ) |
| 10222 | { |
| 10223 | WDI_SuspendParamsType *pSuspendIndParams; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10224 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10225 | wpt_uint16 usDataOffset = 0; |
| 10226 | wpt_uint16 usSendSize = 0; |
| 10227 | WDI_Status wdiStatus; |
| 10228 | tHalWlanHostSuspendIndParam halWlanSuspendIndparams; |
| 10229 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10230 | |
| 10231 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10232 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10233 | -------------------------------------------------------------------------*/ |
| 10234 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData )) |
| 10235 | { |
| 10236 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10237 | "%s: Invalid parameters in Suspend ind",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10238 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10239 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10240 | } |
| 10241 | |
| 10242 | pSuspendIndParams = (WDI_SuspendParamsType *)pEventData->pEventData; |
| 10243 | |
| 10244 | /*----------------------------------------------------------------------- |
| 10245 | Get message buffer |
| 10246 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10247 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10248 | WDI_HOST_SUSPEND_IND, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10249 | sizeof(halWlanSuspendIndparams), |
| 10250 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10251 | (usSendSize < (usDataOffset + sizeof(halWlanSuspendIndparams)))) |
| 10252 | { |
| 10253 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10254 | "Unable to get send buffer in Suspend Ind "); |
| 10255 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10256 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10257 | } |
| 10258 | |
| 10259 | halWlanSuspendIndparams.configuredMcstBcstFilterSetting = |
| 10260 | pSuspendIndParams->wdiSuspendParams.ucConfiguredMcstBcstFilterSetting; |
| 10261 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10262 | halWlanSuspendIndparams.activeSessionCount = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10263 | WDI_GetActiveSessionsCount(pWDICtx); |
| 10264 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10265 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halWlanSuspendIndparams, |
| 10266 | sizeof(tHalWlanHostSuspendIndParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10267 | |
| 10268 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10269 | Send Suspend Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10270 | -------------------------------------------------------------------------*/ |
| 10271 | pWDICtx->wdiReqStatusCB = pSuspendIndParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10272 | pWDICtx->pReqStatusUserData = pSuspendIndParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10273 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10274 | wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10275 | return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC; |
| 10276 | }/*WDI_ProcessHostSuspendInd*/ |
| 10277 | |
| 10278 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10279 | MISC CONTROL PROCESSING REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10280 | ==========================================================================*/ |
| 10281 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10282 | @brief Process Channel Switch Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10283 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10284 | |
| 10285 | @param pWDICtx: pointer to the WLAN DAL context |
| 10286 | pEventData: pointer to the event information structure |
| 10287 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10288 | @see |
| 10289 | @return Result of the function call |
| 10290 | */ |
| 10291 | WDI_Status |
| 10292 | WDI_ProcessChannelSwitchReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10293 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10294 | WDI_ControlBlockType* pWDICtx, |
| 10295 | WDI_EventInfoType* pEventData |
| 10296 | ) |
| 10297 | { |
| 10298 | WDI_SwitchChReqParamsType* pwdiSwitchChParams; |
| 10299 | WDI_SwitchChRspCb wdiSwitchChRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10300 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10301 | wpt_uint16 usDataOffset = 0; |
| 10302 | wpt_uint16 usSendSize = 0; |
| 10303 | tSwitchChannelReqMsg halSwitchChannelReq = {{0}}; |
| 10304 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10305 | |
| 10306 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10307 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10308 | -------------------------------------------------------------------------*/ |
| 10309 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10310 | ( NULL == pEventData->pCBfnc )) |
| 10311 | { |
| 10312 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10313 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10314 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10315 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10316 | } |
| 10317 | |
| 10318 | pwdiSwitchChParams = (WDI_SwitchChReqParamsType*)pEventData->pEventData; |
| 10319 | wdiSwitchChRspCb = (WDI_SwitchChRspCb)pEventData->pCBfnc; |
| 10320 | /*----------------------------------------------------------------------- |
| 10321 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10322 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10323 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10324 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CH_SWITCH_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10325 | sizeof(halSwitchChannelReq.switchChannelParams), |
| 10326 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10327 | ( usSendSize < (usDataOffset + sizeof(halSwitchChannelReq.switchChannelParams) ))) |
| 10328 | { |
| 10329 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10330 | "Unable to get send buffer in channel switch req %x %x %x", |
| 10331 | pEventData, pwdiSwitchChParams, wdiSwitchChRspCb); |
| 10332 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10333 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10334 | } |
| 10335 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10336 | halSwitchChannelReq.switchChannelParams.channelNumber = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10337 | pwdiSwitchChParams->wdiChInfo.ucChannel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10338 | #ifndef WLAN_FEATURE_VOWIFI |
| 10339 | halSwitchChannelReq.switchChannelParams.localPowerConstraint = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10340 | pwdiSwitchChParams->wdiChInfo.ucLocalPowerConstraint; |
| 10341 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10342 | halSwitchChannelReq.switchChannelParams.secondaryChannelOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10343 | pwdiSwitchChParams->wdiChInfo.wdiSecondaryChannelOffset; |
| 10344 | |
| 10345 | #ifdef WLAN_FEATURE_VOWIFI |
| 10346 | halSwitchChannelReq.switchChannelParams.maxTxPower |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10347 | = pwdiSwitchChParams->wdiChInfo.cMaxTxPower; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10348 | wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.selfStaMacAddr, |
| 10349 | pwdiSwitchChParams->wdiChInfo.macSelfStaMacAddr, |
| 10350 | WDI_MAC_ADDR_LEN); |
| 10351 | wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.bssId, |
| 10352 | pwdiSwitchChParams->wdiChInfo.macBSSId, |
| 10353 | WDI_MAC_ADDR_LEN); |
| 10354 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10355 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10356 | &halSwitchChannelReq.switchChannelParams, |
| 10357 | sizeof(halSwitchChannelReq.switchChannelParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10358 | |
| 10359 | pWDICtx->wdiReqStatusCB = pwdiSwitchChParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10360 | pWDICtx->pReqStatusUserData = pwdiSwitchChParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10361 | |
| 10362 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10363 | Send Switch Channel Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10364 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10365 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10366 | wdiSwitchChRspCb, pEventData->pUserData, WDI_CH_SWITCH_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10367 | }/*WDI_ProcessChannelSwitchReq*/ |
| 10368 | |
| 10369 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10370 | @brief Process Config STA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10371 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10372 | |
| 10373 | @param pWDICtx: pointer to the WLAN DAL context |
| 10374 | pEventData: pointer to the event information structure |
| 10375 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10376 | @see |
| 10377 | @return Result of the function call |
| 10378 | */ |
| 10379 | WDI_Status |
| 10380 | WDI_ProcessConfigStaReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10381 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10382 | WDI_ControlBlockType* pWDICtx, |
| 10383 | WDI_EventInfoType* pEventData |
| 10384 | ) |
| 10385 | { |
| 10386 | WDI_ConfigSTAReqParamsType* pwdiConfigSTAParams; |
| 10387 | WDI_ConfigSTARspCb wdiConfigSTARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10388 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10389 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10390 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10391 | wpt_uint16 usDataOffset = 0; |
| 10392 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10393 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10394 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10395 | tConfigStaReqMsg halConfigStaReqMsg; |
| 10396 | wpt_uint16 uMsgSize = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10397 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10398 | |
| 10399 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10400 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10401 | -------------------------------------------------------------------------*/ |
| 10402 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10403 | ( NULL == pEventData->pCBfnc )) |
| 10404 | { |
| 10405 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10406 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10407 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10408 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10409 | } |
| 10410 | |
| 10411 | pwdiConfigSTAParams = (WDI_ConfigSTAReqParamsType*)pEventData->pEventData; |
| 10412 | wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pEventData->pCBfnc; |
| 10413 | /*------------------------------------------------------------------------- |
| 10414 | 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] | 10415 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10416 | -------------------------------------------------------------------------*/ |
| 10417 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10418 | |
| 10419 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10420 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10421 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10422 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 10423 | pwdiConfigSTAParams->wdiReqInfo.macBSSID, |
| 10424 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10425 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10426 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10427 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10428 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 10429 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 10430 | __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10431 | |
| 10432 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10433 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10434 | } |
| 10435 | |
| 10436 | /*------------------------------------------------------------------------ |
| 10437 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10438 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10439 | ------------------------------------------------------------------------*/ |
| 10440 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10441 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10442 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10443 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10444 | __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10445 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10446 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10447 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10448 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10449 | } |
| 10450 | |
| 10451 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10452 | |
| 10453 | /* Allocation of StaReqMsg Memory Based on Firmware Capabilities */ |
| 10454 | #ifdef WLAN_FEATURE_11AC |
| 10455 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 10456 | uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams_V1); // Version-1 For 11AC |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10457 | else |
| 10458 | #endif |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 10459 | uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams); // Version-0 Default |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10460 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10461 | /*----------------------------------------------------------------------- |
| 10462 | Get message buffer |
| 10463 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10464 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_STA_REQ, |
| 10465 | uMsgSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10466 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10467 | ( usSendSize < (usDataOffset + uMsgSize ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10468 | { |
| 10469 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10470 | "Unable to get send buffer in config sta req %x %x %x", |
| 10471 | pEventData, pwdiConfigSTAParams, wdiConfigSTARspCb); |
| 10472 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10473 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10474 | } |
| 10475 | |
| 10476 | /*Copy the station context*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10477 | WDI_CopyWDIStaCtxToHALStaCtx( &halConfigStaReqMsg.uStaParams.configStaParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10478 | &pwdiConfigSTAParams->wdiReqInfo); |
| 10479 | |
| 10480 | if(pwdiConfigSTAParams->wdiReqInfo.wdiSTAType == WDI_STA_ENTRY_SELF) |
| 10481 | { |
| 10482 | /* Need to fill in the self STA Index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10483 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10484 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 10485 | pwdiConfigSTAParams->wdiReqInfo.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10486 | (wpt_uint8*)&halConfigStaReqMsg.uStaParams.configStaParams.staIdx )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10487 | { |
| 10488 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10489 | "This station does not exist in the WDI Station Table %d"); |
| 10490 | wpalMutexRelease(&pWDICtx->wptMutex); |
Madan Mohan Koyyalamudi | f244d8f | 2012-11-29 11:21:05 -0800 | [diff] [blame] | 10491 | wpalMemoryFree(pSendBuffer); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10492 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10493 | } |
| 10494 | } |
| 10495 | else |
| 10496 | { |
| 10497 | /* Need to fill in the STA Index to invalid, since at this point we have not |
| 10498 | yet received it from HAL */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10499 | halConfigStaReqMsg.uStaParams.configStaParams.staIdx = WDI_STA_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10500 | } |
| 10501 | |
| 10502 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10503 | halConfigStaReqMsg.uStaParams.configStaParams.bssIdx = pBSSSes->ucBSSIdx; |
Madan Mohan Koyyalamudi | 0e4acab | 2012-11-02 12:46:40 -0700 | [diff] [blame] | 10504 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10505 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10506 | &halConfigStaReqMsg.uStaParams, |
Madan Mohan Koyyalamudi | 0e4acab | 2012-11-02 12:46:40 -0700 | [diff] [blame] | 10507 | uMsgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10508 | |
| 10509 | pWDICtx->wdiReqStatusCB = pwdiConfigSTAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10510 | pWDICtx->pReqStatusUserData = pwdiConfigSTAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10511 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10512 | wpalMemoryCopy( &pWDICtx->wdiCachedConfigStaReq, |
| 10513 | pwdiConfigSTAParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10514 | sizeof(pWDICtx->wdiCachedConfigStaReq)); |
| 10515 | |
| 10516 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10517 | Send Config STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10518 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10519 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10520 | wdiConfigSTARspCb, pEventData->pUserData, WDI_CONFIG_STA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10521 | }/*WDI_ProcessConfigStaReq*/ |
| 10522 | |
| 10523 | |
| 10524 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10525 | @brief Process Set Link State Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10526 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10527 | |
| 10528 | @param pWDICtx: pointer to the WLAN DAL context |
| 10529 | pEventData: pointer to the event information structure |
| 10530 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10531 | @see |
| 10532 | @return Result of the function call |
| 10533 | */ |
| 10534 | WDI_Status |
| 10535 | WDI_ProcessSetLinkStateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10536 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10537 | WDI_ControlBlockType* pWDICtx, |
| 10538 | WDI_EventInfoType* pEventData |
| 10539 | ) |
| 10540 | { |
| 10541 | WDI_SetLinkReqParamsType* pwdiSetLinkParams; |
| 10542 | WDI_SetLinkStateRspCb wdiSetLinkRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10543 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10544 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10545 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10546 | wpt_uint16 usDataOffset = 0; |
| 10547 | wpt_uint16 usSendSize = 0; |
| 10548 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10549 | tLinkStateParams halLinkStateReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10550 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10551 | |
| 10552 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10553 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10554 | -------------------------------------------------------------------------*/ |
| 10555 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10556 | ( NULL == pEventData->pCBfnc )) |
| 10557 | { |
| 10558 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10559 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10560 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10561 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10562 | } |
| 10563 | |
| 10564 | pwdiSetLinkParams = (WDI_SetLinkReqParamsType*)pEventData->pEventData; |
| 10565 | wdiSetLinkRspCb = (WDI_SetLinkStateRspCb)pEventData->pCBfnc; |
| 10566 | /*------------------------------------------------------------------------- |
| 10567 | 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] | 10568 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10569 | -------------------------------------------------------------------------*/ |
| 10570 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10571 | |
| 10572 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10573 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10574 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10575 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 10576 | pwdiSetLinkParams->wdiLinkInfo.macBSSID, |
| 10577 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10578 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10579 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10580 | { |
Madan Mohan Koyyalamudi | 891e949 | 2012-10-21 12:19:31 -0700 | [diff] [blame] | 10581 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10582 | "%s: Set link request received outside association session. macBSSID " MAC_ADDRESS_STR, |
| 10583 | __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10584 | } |
| 10585 | else |
| 10586 | { |
| 10587 | /*------------------------------------------------------------------------ |
| 10588 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10589 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10590 | ------------------------------------------------------------------------*/ |
| 10591 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10592 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10593 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10594 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10595 | __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID)); |
| 10596 | |
| 10597 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10598 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10599 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10600 | } |
| 10601 | } |
| 10602 | /* If the link is set to enter IDLE - the Session allocated for this BSS |
| 10603 | will be deleted on the Set Link State response coming from HAL |
| 10604 | - cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10605 | wpalMemoryCopy(&pWDICtx->wdiCacheSetLinkStReq, pwdiSetLinkParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10606 | sizeof(pWDICtx->wdiCacheSetLinkStReq)); |
| 10607 | |
| 10608 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 10609 | /*----------------------------------------------------------------------- |
| 10610 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10611 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10612 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10613 | |
| 10614 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_LINK_ST_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10615 | sizeof(halLinkStateReqMsg), |
| 10616 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10617 | ( usSendSize < (usDataOffset + sizeof(halLinkStateReqMsg) ))) |
| 10618 | { |
| 10619 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10620 | "Unable to get send buffer in set bss key req %x %x %x", |
| 10621 | pEventData, pwdiSetLinkParams, wdiSetLinkRspCb); |
| 10622 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10623 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10624 | } |
| 10625 | |
| 10626 | wpalMemoryCopy(halLinkStateReqMsg.bssid, |
| 10627 | pwdiSetLinkParams->wdiLinkInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 10628 | |
| 10629 | wpalMemoryCopy(halLinkStateReqMsg.selfMacAddr, |
| 10630 | pwdiSetLinkParams->wdiLinkInfo.macSelfStaMacAddr, WDI_MAC_ADDR_LEN); |
| 10631 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10632 | halLinkStateReqMsg.state = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10633 | WDI_2_HAL_LINK_STATE(pwdiSetLinkParams->wdiLinkInfo.wdiLinkState); |
| 10634 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10635 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10636 | &halLinkStateReqMsg, |
| 10637 | sizeof(halLinkStateReqMsg)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10638 | |
| 10639 | pWDICtx->wdiReqStatusCB = pwdiSetLinkParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10640 | pWDICtx->pReqStatusUserData = pwdiSetLinkParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10641 | |
| 10642 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10643 | Send Set Link State Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10644 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10645 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10646 | wdiSetLinkRspCb, pEventData->pUserData, WDI_SET_LINK_ST_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10647 | }/*WDI_ProcessSetLinkStateReq*/ |
| 10648 | |
| 10649 | |
| 10650 | /** |
| 10651 | @brief Process Get Stats Request function (called when Main FSM |
| 10652 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10653 | |
| 10654 | @param pWDICtx: pointer to the WLAN DAL context |
| 10655 | pEventData: pointer to the event information structure |
| 10656 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10657 | @see |
| 10658 | @return Result of the function call |
| 10659 | */ |
| 10660 | WDI_Status |
| 10661 | WDI_ProcessGetStatsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10662 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10663 | WDI_ControlBlockType* pWDICtx, |
| 10664 | WDI_EventInfoType* pEventData |
| 10665 | ) |
| 10666 | { |
| 10667 | WDI_GetStatsReqParamsType* pwdiGetStatsParams; |
| 10668 | WDI_GetStatsRspCb wdiGetStatsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10669 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10670 | wpt_uint16 usDataOffset = 0; |
| 10671 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10672 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10673 | WDI_BSSSessionType* pBSSSes = NULL; |
| 10674 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10675 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10676 | tHalStatsReqMsg halStatsReqMsg; |
| 10677 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10678 | |
| 10679 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10680 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10681 | -------------------------------------------------------------------------*/ |
| 10682 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) || |
| 10683 | ( NULL == pEventData->pCBfnc ) ) |
| 10684 | { |
| 10685 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10686 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10687 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10688 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10689 | } |
| 10690 | |
| 10691 | pwdiGetStatsParams = (WDI_GetStatsReqParamsType*)pEventData->pEventData; |
| 10692 | wdiGetStatsRspCb = (WDI_GetStatsRspCb)pEventData->pCBfnc; |
| 10693 | |
| 10694 | /*------------------------------------------------------------------------- |
| 10695 | 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] | 10696 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10697 | -------------------------------------------------------------------------*/ |
| 10698 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10699 | |
| 10700 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10701 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10702 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10703 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 10704 | pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10705 | &macBSSID)) |
| 10706 | { |
| 10707 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10708 | "This station does not exist in the WDI Station Table %d"); |
| 10709 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10710 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10711 | } |
| 10712 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10713 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 10714 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10715 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10716 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 10717 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 10718 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10719 | |
| 10720 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10721 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10722 | } |
| 10723 | |
| 10724 | /*------------------------------------------------------------------------ |
| 10725 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10726 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10727 | ------------------------------------------------------------------------*/ |
| 10728 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10729 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10730 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10731 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10732 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10733 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10734 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10735 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10736 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10737 | } |
| 10738 | |
| 10739 | |
| 10740 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 10741 | |
| 10742 | /*----------------------------------------------------------------------- |
| 10743 | Get message buffer |
| 10744 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10745 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GET_STATS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10746 | sizeof(halStatsReqMsg.statsReqParams), |
| 10747 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10748 | ( usSendSize < (usDataOffset + sizeof(halStatsReqMsg.statsReqParams) ))) |
| 10749 | { |
| 10750 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10751 | "Unable to get send buffer in set bss key req %x %x %x", |
| 10752 | pEventData, pwdiGetStatsParams, wdiGetStatsRspCb); |
| 10753 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10754 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10755 | } |
| 10756 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10757 | halStatsReqMsg.statsReqParams.staId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10758 | pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10759 | halStatsReqMsg.statsReqParams.statsMask = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10760 | pwdiGetStatsParams->wdiGetStatsParamsInfo.uStatsMask; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10761 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10762 | &halStatsReqMsg.statsReqParams, |
| 10763 | sizeof(halStatsReqMsg.statsReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10764 | |
| 10765 | pWDICtx->wdiReqStatusCB = pwdiGetStatsParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10766 | pWDICtx->pReqStatusUserData = pwdiGetStatsParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10767 | |
| 10768 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10769 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10770 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10771 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10772 | wdiGetStatsRspCb, pEventData->pUserData, WDI_GET_STATS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10773 | }/*WDI_ProcessGetStatsReq*/ |
| 10774 | |
| 10775 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10776 | @brief Process Update Cfg Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10777 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10778 | |
| 10779 | @param pWDICtx: pointer to the WLAN DAL context |
| 10780 | pEventData: pointer to the event information structure |
| 10781 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10782 | @see |
| 10783 | @return Result of the function call |
| 10784 | */ |
| 10785 | WDI_Status |
| 10786 | WDI_ProcessUpdateCfgReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10787 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10788 | WDI_ControlBlockType* pWDICtx, |
| 10789 | WDI_EventInfoType* pEventData |
| 10790 | ) |
| 10791 | { |
| 10792 | WDI_UpdateCfgReqParamsType* pwdiUpdateCfgParams = NULL; |
| 10793 | WDI_UpdateCfgRspCb wdiUpdateCfgRspCb = NULL; |
| 10794 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10795 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10796 | wpt_uint16 usDataOffset = 0; |
| 10797 | wpt_uint16 usSendSize = 0; |
| 10798 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10799 | |
| 10800 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10801 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10802 | -------------------------------------------------------------------------*/ |
| 10803 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10804 | ( NULL == pEventData->pCBfnc)) |
| 10805 | { |
| 10806 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10807 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10808 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10809 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10810 | } |
| 10811 | |
| 10812 | pwdiUpdateCfgParams = (WDI_UpdateCfgReqParamsType*)pEventData->pEventData; |
| 10813 | wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pEventData->pCBfnc; |
| 10814 | |
| 10815 | /*----------------------------------------------------------------------- |
| 10816 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10817 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10818 | -----------------------------------------------------------------------*/ |
| 10819 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10820 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_CFG_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10821 | pwdiUpdateCfgParams->uConfigBufferLen + sizeof(wpt_uint32), |
| 10822 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10823 | ( usSendSize < (usDataOffset + pwdiUpdateCfgParams->uConfigBufferLen))) |
| 10824 | { |
| 10825 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10826 | "Unable to get send buffer in set bss key req %x %x %x", |
| 10827 | pEventData, pwdiUpdateCfgParams, wdiUpdateCfgRspCb); |
| 10828 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10829 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10830 | } |
| 10831 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10832 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10833 | &pwdiUpdateCfgParams->uConfigBufferLen, |
| 10834 | sizeof(wpt_uint32)); |
| 10835 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(wpt_uint32), |
| 10836 | pwdiUpdateCfgParams->pConfigBuffer, |
| 10837 | pwdiUpdateCfgParams->uConfigBufferLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10838 | |
| 10839 | pWDICtx->wdiReqStatusCB = pwdiUpdateCfgParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10840 | pWDICtx->pReqStatusUserData = pwdiUpdateCfgParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10841 | |
| 10842 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10843 | Send Update Cfg Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10844 | -------------------------------------------------------------------------*/ |
| 10845 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10846 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10847 | wdiUpdateCfgRspCb, pEventData->pUserData, WDI_UPDATE_CFG_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10848 | |
| 10849 | }/*WDI_ProcessUpdateCfgReq*/ |
| 10850 | |
| 10851 | |
| 10852 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10853 | @brief Process Add BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10854 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10855 | |
| 10856 | @param pWDICtx: pointer to the WLAN DAL context |
| 10857 | pEventData: pointer to the event information structure |
| 10858 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10859 | @see |
| 10860 | @return Result of the function call |
| 10861 | */ |
| 10862 | WDI_Status |
| 10863 | WDI_ProcessAddBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10864 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10865 | WDI_ControlBlockType* pWDICtx, |
| 10866 | WDI_EventInfoType* pEventData |
| 10867 | ) |
| 10868 | { |
| 10869 | WDI_AddBAReqParamsType* pwdiAddBAParams; |
| 10870 | WDI_AddBARspCb wdiAddBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10871 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10872 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10873 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10874 | wpt_uint16 usDataOffset = 0; |
| 10875 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10876 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10877 | wpt_macAddr macBSSID; |
| 10878 | |
| 10879 | tAddBAReqMsg halAddBAReq; |
| 10880 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10881 | |
| 10882 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10883 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10884 | -------------------------------------------------------------------------*/ |
| 10885 | if (( NULL == pEventData ) || |
| 10886 | ( NULL == pEventData->pEventData) || |
| 10887 | ( NULL == pEventData->pCBfnc )) |
| 10888 | { |
| 10889 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10890 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10891 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10892 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10893 | } |
| 10894 | |
| 10895 | pwdiAddBAParams = (WDI_AddBAReqParamsType*)pEventData->pEventData; |
| 10896 | wdiAddBARspCb = (WDI_AddBARspCb)pEventData->pCBfnc; |
| 10897 | |
| 10898 | /*------------------------------------------------------------------------- |
| 10899 | 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] | 10900 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10901 | -------------------------------------------------------------------------*/ |
| 10902 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10903 | |
| 10904 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10905 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10906 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10907 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 10908 | pwdiAddBAParams->wdiBAInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10909 | &macBSSID)) |
| 10910 | { |
| 10911 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10912 | "This station does not exist in the WDI Station Table %d"); |
| 10913 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10914 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10915 | } |
| 10916 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10917 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 10918 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10919 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10920 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 10921 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 10922 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10923 | |
| 10924 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10925 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10926 | } |
| 10927 | |
| 10928 | /*------------------------------------------------------------------------ |
| 10929 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10930 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10931 | ------------------------------------------------------------------------*/ |
| 10932 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10933 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10934 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10935 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10936 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10937 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10938 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10939 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10940 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10941 | } |
| 10942 | |
| 10943 | |
| 10944 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 10945 | /*----------------------------------------------------------------------- |
| 10946 | Get message buffer |
| 10947 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10948 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10949 | sizeof(halAddBAReq.addBAParams), |
| 10950 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10951 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10952 | (usDataOffset + sizeof(halAddBAReq.addBAParams) ))) |
| 10953 | { |
| 10954 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10955 | "Unable to get send buffer in Add BA req %x %x %x", |
| 10956 | pEventData, pwdiAddBAParams, wdiAddBARspCb); |
| 10957 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10958 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10959 | } |
| 10960 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10961 | halAddBAReq.addBAParams.baSessionID = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10962 | pwdiAddBAParams->wdiBAInfoType.ucBaSessionID; |
| 10963 | halAddBAReq.addBAParams.winSize = pwdiAddBAParams->wdiBAInfoType.ucWinSize; |
| 10964 | #ifdef FEATURE_ON_CHIP_REORDERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10965 | halAddBAReq.addBAParams.isReorderingDoneOnChip = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10966 | pwdiAddBAParams->wdiBAInfoType.bIsReorderingDoneOnChip; |
| 10967 | #endif |
| 10968 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10969 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10970 | &halAddBAReq.addBAParams, |
| 10971 | sizeof(halAddBAReq.addBAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10972 | |
| 10973 | pWDICtx->wdiReqStatusCB = pwdiAddBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10974 | pWDICtx->pReqStatusUserData = pwdiAddBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10975 | |
| 10976 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10977 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10978 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10979 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10980 | wdiAddBARspCb, pEventData->pUserData, |
| 10981 | WDI_ADD_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10982 | }/*WDI_ProcessAddBAReq*/ |
| 10983 | |
| 10984 | |
| 10985 | |
| 10986 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10987 | @brief Process Trigger BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10988 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10989 | |
| 10990 | @param pWDICtx: pointer to the WLAN DAL context |
| 10991 | pEventData: pointer to the event information structure |
| 10992 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10993 | @see |
| 10994 | @return Result of the function call |
| 10995 | */ |
| 10996 | WDI_Status |
| 10997 | WDI_ProcessTriggerBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10998 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10999 | WDI_ControlBlockType* pWDICtx, |
| 11000 | WDI_EventInfoType* pEventData |
| 11001 | ) |
| 11002 | { |
| 11003 | WDI_TriggerBAReqParamsType* pwdiTriggerBAParams; |
| 11004 | WDI_TriggerBARspCb wdiTriggerBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11005 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11006 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11007 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11008 | wpt_uint16 usDataOffset = 0; |
| 11009 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11010 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11011 | wpt_uint16 index; |
| 11012 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11013 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11014 | tTriggerBAReqMsg halTriggerBAReq; |
| 11015 | tTriggerBaReqCandidate* halTriggerBACandidate; |
| 11016 | WDI_TriggerBAReqCandidateType* wdiTriggerBACandidate; |
| 11017 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11018 | |
| 11019 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11020 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11021 | -------------------------------------------------------------------------*/ |
| 11022 | if (( NULL == pEventData ) || |
| 11023 | ( NULL == pEventData->pEventData ) || |
| 11024 | ( NULL == pEventData->pCBfnc )) |
| 11025 | { |
| 11026 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11027 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11028 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11029 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11030 | } |
| 11031 | |
| 11032 | pwdiTriggerBAParams = (WDI_TriggerBAReqParamsType*)pEventData->pEventData; |
| 11033 | wdiTriggerBARspCb = (WDI_TriggerBARspCb)pEventData->pCBfnc; |
| 11034 | /*------------------------------------------------------------------------- |
| 11035 | 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] | 11036 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11037 | -------------------------------------------------------------------------*/ |
| 11038 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 11039 | |
| 11040 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11041 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11042 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11043 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 11044 | pwdiTriggerBAParams->wdiTriggerBAInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11045 | &macBSSID)) |
| 11046 | { |
| 11047 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11048 | "This station does not exist in the WDI Station Table %d"); |
| 11049 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11050 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11051 | } |
| 11052 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11053 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 11054 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11055 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11056 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11057 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 11058 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11059 | |
| 11060 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11061 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11062 | } |
| 11063 | |
| 11064 | /*------------------------------------------------------------------------ |
| 11065 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11066 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11067 | ------------------------------------------------------------------------*/ |
| 11068 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 11069 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11070 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11071 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 11072 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11073 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11074 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11075 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11076 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11077 | } |
| 11078 | |
| 11079 | |
| 11080 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11081 | /*----------------------------------------------------------------------- |
| 11082 | Get message buffer |
| 11083 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11084 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 11085 | WDI_TRIGGER_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11086 | sizeof(halTriggerBAReq.triggerBAParams) + |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11087 | (sizeof(tTriggerBaReqCandidate) * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11088 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt), |
| 11089 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11090 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11091 | (usDataOffset + sizeof(halTriggerBAReq.triggerBAParams)+ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11092 | (sizeof(tTriggerBaReqCandidate) * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11093 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt) ))) |
| 11094 | { |
| 11095 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11096 | "Unable to get send buffer in Trigger BA req %x %x %x", |
| 11097 | pEventData, pwdiTriggerBAParams, wdiTriggerBARspCb); |
| 11098 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11099 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11100 | } |
| 11101 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11102 | halTriggerBAReq.triggerBAParams.baSessionID = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11103 | pwdiTriggerBAParams->wdiTriggerBAInfoType.ucBASessionID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11104 | halTriggerBAReq.triggerBAParams.baCandidateCnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11105 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt; |
| 11106 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11107 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11108 | &halTriggerBAReq.triggerBAParams, |
| 11109 | sizeof(halTriggerBAReq.triggerBAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11110 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11111 | wdiTriggerBACandidate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11112 | (WDI_TriggerBAReqCandidateType*)(pwdiTriggerBAParams + 1); |
| 11113 | halTriggerBACandidate = (tTriggerBaReqCandidate*)(pSendBuffer+usDataOffset+ |
| 11114 | sizeof(halTriggerBAReq.triggerBAParams)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11115 | |
| 11116 | for(index = 0 ; index < halTriggerBAReq.triggerBAParams.baCandidateCnt ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11117 | index++) |
| 11118 | { |
| 11119 | halTriggerBACandidate->staIdx = wdiTriggerBACandidate->ucSTAIdx; |
| 11120 | halTriggerBACandidate->tidBitmap = wdiTriggerBACandidate->ucTidBitmap; |
| 11121 | halTriggerBACandidate++; |
| 11122 | wdiTriggerBACandidate++; |
| 11123 | } |
| 11124 | |
| 11125 | pWDICtx->wdiReqStatusCB = pwdiTriggerBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11126 | pWDICtx->pReqStatusUserData = pwdiTriggerBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11127 | |
| 11128 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11129 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11130 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11131 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11132 | wdiTriggerBARspCb, pEventData->pUserData, |
| 11133 | WDI_TRIGGER_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11134 | }/*WDI_ProcessTriggerBAReq*/ |
| 11135 | |
| 11136 | |
| 11137 | |
| 11138 | /** |
| 11139 | @brief Process Update Beacon Params Request function (called when Main FSM |
| 11140 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11141 | |
| 11142 | @param pWDICtx: pointer to the WLAN DAL context |
| 11143 | pEventData: pointer to the event information structure |
| 11144 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11145 | @see |
| 11146 | @return Result of the function call |
| 11147 | */ |
| 11148 | WDI_Status |
| 11149 | WDI_ProcessUpdateBeaconParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11150 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11151 | WDI_ControlBlockType* pWDICtx, |
| 11152 | WDI_EventInfoType* pEventData |
| 11153 | ) |
| 11154 | { |
| 11155 | WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams; |
| 11156 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11157 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11158 | wpt_uint16 usDataOffset = 0; |
| 11159 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11160 | tUpdateBeaconParams halUpdateBeaconParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11161 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11162 | |
| 11163 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11164 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11165 | -------------------------------------------------------------------------*/ |
| 11166 | if (( NULL == pEventData ) || |
| 11167 | ( NULL == pEventData->pEventData) || |
| 11168 | ( NULL == pEventData->pCBfnc)) |
| 11169 | { |
| 11170 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11171 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11172 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11173 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11174 | } |
| 11175 | |
| 11176 | pwdiUpdateBeaconParams = (WDI_UpdateBeaconParamsType*)pEventData->pEventData; |
| 11177 | wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pEventData->pCBfnc; |
| 11178 | /*----------------------------------------------------------------------- |
| 11179 | Get message buffer |
| 11180 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11181 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_BCON_PRMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11182 | sizeof(halUpdateBeaconParams), |
| 11183 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11184 | ( usSendSize < (usDataOffset + sizeof(halUpdateBeaconParams) ))) |
| 11185 | { |
| 11186 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11187 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11188 | pEventData, pwdiUpdateBeaconParams, wdiUpdateBeaconParamsRspCb); |
| 11189 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11190 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11191 | } |
| 11192 | |
| 11193 | /*BSS Index of the BSS*/ |
| 11194 | halUpdateBeaconParams.bssIdx = |
| 11195 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucBssIdx; |
| 11196 | /*shortPreamble mode. HAL should update all the STA rates when it |
| 11197 | receives this message*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11198 | halUpdateBeaconParams.fShortPreamble = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11199 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortPreamble; |
| 11200 | /* short Slot time.*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11201 | halUpdateBeaconParams.fShortSlotTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11202 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortSlotTime; |
| 11203 | /* Beacon Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11204 | halUpdateBeaconParams.beaconInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11205 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usBeaconInterval; |
| 11206 | |
| 11207 | /*Protection related */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11208 | halUpdateBeaconParams.llaCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11209 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllaCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11210 | halUpdateBeaconParams.llbCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11211 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllbCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11212 | halUpdateBeaconParams.llgCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11213 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllgCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11214 | halUpdateBeaconParams.ht20MhzCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11215 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucHt20MhzCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11216 | halUpdateBeaconParams.llnNonGFCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11217 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllnNonGFCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11218 | halUpdateBeaconParams.fLsigTXOPProtectionFullSupport = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11219 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfLsigTXOPProtectionFullSupport; |
| 11220 | halUpdateBeaconParams.fRIFSMode = |
| 11221 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfRIFSMode; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11222 | halUpdateBeaconParams.paramChangeBitmap = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11223 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usChangeBitmap; |
| 11224 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11225 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halUpdateBeaconParams, |
| 11226 | sizeof(halUpdateBeaconParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11227 | |
| 11228 | pWDICtx->wdiReqStatusCB = pwdiUpdateBeaconParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11229 | pWDICtx->pReqStatusUserData = pwdiUpdateBeaconParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11230 | |
| 11231 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11232 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11233 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11234 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11235 | wdiUpdateBeaconParamsRspCb, pEventData->pUserData, WDI_UPD_BCON_PRMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11236 | }/*WDI_ProcessUpdateBeaconParamsReq*/ |
| 11237 | |
| 11238 | |
| 11239 | |
| 11240 | /** |
| 11241 | @brief Process Send Beacon template Request function (called when Main FSM |
| 11242 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11243 | |
| 11244 | @param pWDICtx: pointer to the WLAN DAL context |
| 11245 | pEventData: pointer to the event information structure |
| 11246 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11247 | @see |
| 11248 | @return Result of the function call |
| 11249 | */ |
| 11250 | WDI_Status |
| 11251 | WDI_ProcessSendBeaconParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11252 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11253 | WDI_ControlBlockType* pWDICtx, |
| 11254 | WDI_EventInfoType* pEventData |
| 11255 | ) |
| 11256 | { |
| 11257 | WDI_SendBeaconParamsType* pwdiSendBeaconParams; |
| 11258 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11259 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11260 | wpt_uint16 usDataOffset = 0; |
| 11261 | wpt_uint16 usSendSize = 0; |
| 11262 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11263 | |
| 11264 | tSendBeaconReqMsg halSendBeaconReq; |
| 11265 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11266 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11267 | -------------------------------------------------------------------------*/ |
| 11268 | if (( NULL == pEventData ) || |
| 11269 | ( NULL == pEventData->pEventData ) || |
| 11270 | ( NULL == pEventData->pCBfnc )) |
| 11271 | { |
| 11272 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11273 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11274 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11275 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11276 | } |
| 11277 | |
| 11278 | pwdiSendBeaconParams = (WDI_SendBeaconParamsType*)pEventData->pEventData; |
| 11279 | wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pEventData->pCBfnc; |
| 11280 | /*----------------------------------------------------------------------- |
| 11281 | Get message buffer |
| 11282 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11283 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SND_BCON_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11284 | sizeof(halSendBeaconReq.sendBeaconParam), |
| 11285 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11286 | ( usSendSize < (usDataOffset + sizeof(halSendBeaconReq.sendBeaconParam) ))) |
| 11287 | { |
| 11288 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11289 | "Unable to get send buffer in send beacon req %x %x %x", |
| 11290 | pEventData, pwdiSendBeaconParams, wdiSendBeaconParamsRspCb); |
| 11291 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11292 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11293 | } |
| 11294 | |
| 11295 | wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.bssId, |
| 11296 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.macBSSID, |
| 11297 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11298 | halSendBeaconReq.sendBeaconParam.beaconLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11299 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength; |
| 11300 | wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.beacon, |
| 11301 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beacon, |
| 11302 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength); |
| 11303 | #ifdef WLAN_SOFTAP_FEATURE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11304 | halSendBeaconReq.sendBeaconParam.timIeOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11305 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.timIeOffset; |
| 11306 | #endif |
| 11307 | #ifdef WLAN_FEATURE_P2P |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11308 | halSendBeaconReq.sendBeaconParam.p2pIeOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11309 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset; |
| 11310 | #endif |
| 11311 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11312 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11313 | &halSendBeaconReq.sendBeaconParam, |
| 11314 | sizeof(halSendBeaconReq.sendBeaconParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11315 | |
| 11316 | pWDICtx->wdiReqStatusCB = pwdiSendBeaconParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11317 | pWDICtx->pReqStatusUserData = pwdiSendBeaconParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11318 | |
| 11319 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11320 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11321 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11322 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11323 | wdiSendBeaconParamsRspCb, pEventData->pUserData, WDI_SND_BCON_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11324 | }/*WDI_ProcessSendBeaconParamsReq*/ |
| 11325 | |
| 11326 | /** |
| 11327 | @brief Process Update Beacon Params Request function (called when Main FSM |
| 11328 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11329 | |
| 11330 | @param pWDICtx: pointer to the WLAN DAL context |
| 11331 | pEventData: pointer to the event information structure |
| 11332 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11333 | @see |
| 11334 | @return Result of the function call |
| 11335 | */ |
| 11336 | WDI_Status |
| 11337 | WDI_ProcessUpdateProbeRspTemplateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11338 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11339 | WDI_ControlBlockType* pWDICtx, |
| 11340 | WDI_EventInfoType* pEventData |
| 11341 | ) |
| 11342 | { |
| 11343 | WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRespTmplParams; |
| 11344 | WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRespTmplRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11345 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11346 | wpt_uint16 usDataOffset = 0; |
| 11347 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11348 | tSendProbeRespReqParams halUpdateProbeRspTmplParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11349 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11350 | |
| 11351 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11352 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11353 | -------------------------------------------------------------------------*/ |
| 11354 | if (( NULL == pEventData ) || |
| 11355 | ( NULL == pEventData->pEventData) || |
| 11356 | ( NULL == pEventData->pCBfnc)) |
| 11357 | { |
| 11358 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11359 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11360 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11361 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11362 | } |
| 11363 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11364 | pwdiUpdateProbeRespTmplParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11365 | (WDI_UpdateProbeRspTemplateParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11366 | wdiUpdateProbeRespTmplRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11367 | (WDI_UpdateProbeRspTemplateRspCb)pEventData->pCBfnc; |
| 11368 | /*----------------------------------------------------------------------- |
| 11369 | Get message buffer |
| 11370 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11371 | 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] | 11372 | sizeof(halUpdateProbeRspTmplParams), |
| 11373 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11374 | ( usSendSize < (usDataOffset + sizeof(halUpdateProbeRspTmplParams) ))) |
| 11375 | { |
| 11376 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11377 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11378 | pEventData, pwdiUpdateProbeRespTmplParams, wdiUpdateProbeRespTmplRspCb); |
| 11379 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11380 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11381 | } |
| 11382 | |
| 11383 | wpalMemoryCopy(halUpdateProbeRspTmplParams.bssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11384 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11385 | WDI_MAC_ADDR_LEN); |
| 11386 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11387 | halUpdateProbeRspTmplParams.probeRespTemplateLen = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11388 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uProbeRespTemplateLen; |
| 11389 | |
| 11390 | wpalMemoryCopy(halUpdateProbeRspTmplParams.pProbeRespTemplate, |
| 11391 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.pProbeRespTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11392 | BEACON_TEMPLATE_SIZE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11393 | |
| 11394 | |
| 11395 | wpalMemoryCopy(halUpdateProbeRspTmplParams.ucProxyProbeReqValidIEBmap, |
| 11396 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uaProxyProbeReqValidIEBmap, |
| 11397 | WDI_PROBE_REQ_BITMAP_IE_LEN); |
| 11398 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11399 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11400 | &halUpdateProbeRspTmplParams, |
| 11401 | sizeof(halUpdateProbeRspTmplParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11402 | |
| 11403 | pWDICtx->wdiReqStatusCB = pwdiUpdateProbeRespTmplParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11404 | pWDICtx->pReqStatusUserData = pwdiUpdateProbeRespTmplParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11405 | |
| 11406 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11407 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11408 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11409 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11410 | wdiUpdateProbeRespTmplRspCb, pEventData->pUserData, |
| 11411 | WDI_UPD_PROBE_RSP_TEMPLATE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11412 | }/*WDI_ProcessUpdateProbeRspTemplateReq*/ |
| 11413 | |
| 11414 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11415 | @brief Process NV blob download function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11416 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11417 | |
| 11418 | @param pWDICtx: pointer to the WLAN DAL context |
| 11419 | pEventData: pointer to the event information structure |
| 11420 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11421 | @see |
| 11422 | @return Result of the function call |
| 11423 | */ |
| 11424 | WDI_Status |
| 11425 | WDI_ProcessNvDownloadReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11426 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11427 | WDI_ControlBlockType* pWDICtx, |
| 11428 | WDI_EventInfoType* pEventData |
| 11429 | ) |
| 11430 | { |
| 11431 | |
| 11432 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams = NULL; |
| 11433 | WDI_NvDownloadRspCb wdiNvDownloadRspCb = NULL; |
| 11434 | |
| 11435 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11436 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11437 | -------------------------------------------------------------------------*/ |
| 11438 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11439 | ( NULL == (pwdiNvDownloadReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11440 | (WDI_NvDownloadReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11441 | ( NULL == (wdiNvDownloadRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11442 | (WDI_NvDownloadRspCb)pEventData->pCBfnc))) |
| 11443 | { |
| 11444 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11445 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11446 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11447 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11448 | } |
| 11449 | |
| 11450 | /*Intialize the Nv Blob Info */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11451 | pWDICtx->wdiNvBlobInfo.usTotalFragment = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11452 | TOTALFRAGMENTS(pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize); |
| 11453 | |
| 11454 | /*cache the wdi nv request message here if the the first fragment |
| 11455 | * To issue the request to HAL for the next fragment */ |
| 11456 | if( 0 == pWDICtx->wdiNvBlobInfo.usCurrentFragment) |
| 11457 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11458 | wpalMemoryCopy(&pWDICtx->wdiCachedNvDownloadReq, |
| 11459 | pwdiNvDownloadReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11460 | sizeof(pWDICtx->wdiCachedNvDownloadReq)); |
| 11461 | |
| 11462 | pWDICtx->pfncRspCB = pEventData->pCBfnc; |
| 11463 | pWDICtx->pRspCBUserData = pEventData->pUserData; |
| 11464 | } |
| 11465 | |
| 11466 | return WDI_SendNvBlobReq(pWDICtx,pEventData); |
| 11467 | } |
| 11468 | |
| 11469 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11470 | @brief Process Set Max Tx Power Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11471 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11472 | |
| 11473 | @param pWDICtx: pointer to the WLAN DAL context |
| 11474 | pEventData: pointer to the event information structure |
| 11475 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11476 | @see |
| 11477 | @return Result of the function call |
| 11478 | */ |
| 11479 | WDI_Status WDI_ProcessSetMaxTxPowerReq |
| 11480 | ( |
| 11481 | WDI_ControlBlockType* pWDICtx, |
| 11482 | WDI_EventInfoType* pEventData |
| 11483 | ) |
| 11484 | { |
| 11485 | WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams = NULL; |
| 11486 | WDA_SetMaxTxPowerRspCb wdiSetMaxTxPowerRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11487 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11488 | wpt_uint16 usDataOffset = 0; |
| 11489 | wpt_uint16 usSendSize = 0; |
| 11490 | tSetMaxTxPwrReq halSetMaxTxPower; |
| 11491 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11492 | |
| 11493 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11494 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11495 | -------------------------------------------------------------------------*/ |
| 11496 | if (( NULL == pEventData ) || |
| 11497 | ( NULL == pEventData->pEventData ) || |
| 11498 | ( NULL == pEventData->pCBfnc )) |
| 11499 | { |
| 11500 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11501 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11502 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11503 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11504 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11505 | pwdiSetMaxTxPowerParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11506 | (WDI_SetMaxTxPowerParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11507 | wdiSetMaxTxPowerRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11508 | (WDA_SetMaxTxPowerRspCb)pEventData->pCBfnc; |
| 11509 | |
| 11510 | /*----------------------------------------------------------------------- |
| 11511 | Get message buffer |
| 11512 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11513 | 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] | 11514 | sizeof(halSetMaxTxPower.setMaxTxPwrParams), |
| 11515 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11516 | ( usSendSize < (usDataOffset + sizeof(halSetMaxTxPower.setMaxTxPwrParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11517 | ))) |
| 11518 | { |
| 11519 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11520 | "Unable to get Set Max Tx Power req %x %x %x", |
| 11521 | pEventData, pwdiSetMaxTxPowerParams, wdiSetMaxTxPowerRspCb); |
| 11522 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11523 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11524 | } |
| 11525 | |
| 11526 | wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.bssId, |
| 11527 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macBSSId, |
| 11528 | WDI_MAC_ADDR_LEN); |
| 11529 | |
| 11530 | wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.selfStaMacAddr, |
| 11531 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macSelfStaMacAddr, |
| 11532 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11533 | halSetMaxTxPower.setMaxTxPwrParams.power = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11534 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.ucPower; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11535 | |
| 11536 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11537 | &halSetMaxTxPower.setMaxTxPwrParams, |
| 11538 | sizeof(halSetMaxTxPower.setMaxTxPwrParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11539 | |
| 11540 | pWDICtx->wdiReqStatusCB = pwdiSetMaxTxPowerParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11541 | pWDICtx->pReqStatusUserData = pwdiSetMaxTxPowerParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11542 | |
| 11543 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11544 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11545 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11546 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11547 | wdiSetMaxTxPowerRspCb, pEventData->pUserData, |
| 11548 | WDI_SET_MAX_TX_POWER_RESP); |
| 11549 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11550 | } |
| 11551 | |
| 11552 | #ifdef WLAN_FEATURE_P2P |
| 11553 | |
| 11554 | /** |
| 11555 | @brief Process P2P Notice Of Absence Request function (called when Main FSM |
| 11556 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11557 | |
| 11558 | @param pWDICtx: pointer to the WLAN DAL context |
| 11559 | pEventData: pointer to the event information structure |
| 11560 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11561 | @see |
| 11562 | @return Result of the function call |
| 11563 | */ |
| 11564 | WDI_Status |
| 11565 | WDI_ProcessP2PGONOAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11566 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11567 | WDI_ControlBlockType* pWDICtx, |
| 11568 | WDI_EventInfoType* pEventData |
| 11569 | ) |
| 11570 | { |
| 11571 | WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams; |
| 11572 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11573 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11574 | wpt_uint16 usDataOffset = 0; |
| 11575 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11576 | tSetP2PGONOAParams halSetP2PGONOAParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11577 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11578 | |
| 11579 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11580 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11581 | -------------------------------------------------------------------------*/ |
| 11582 | if (( NULL == pEventData ) || |
| 11583 | ( NULL == pEventData->pEventData) || |
| 11584 | ( NULL == pEventData->pCBfnc)) |
| 11585 | { |
| 11586 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11587 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11588 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11589 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11590 | } |
| 11591 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11592 | pwdiP2PGONOAReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11593 | (WDI_SetP2PGONOAReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11594 | wdiP2PGONOAReqRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11595 | (WDI_SetP2PGONOAReqParamsRspCb)pEventData->pCBfnc; |
| 11596 | /*----------------------------------------------------------------------- |
| 11597 | Get message buffer |
| 11598 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11599 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 11600 | WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11601 | sizeof(halSetP2PGONOAParams), |
| 11602 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11603 | ( usSendSize < (usDataOffset + sizeof(halSetP2PGONOAParams) ))) |
| 11604 | { |
| 11605 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11606 | "Unable to get send buffer in set P2P GO NOA REQ %x %x %x", |
| 11607 | pEventData, pwdiP2PGONOAReqParams, wdiP2PGONOAReqRspCb); |
| 11608 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11609 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11610 | } |
| 11611 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11612 | halSetP2PGONOAParams.opp_ps = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11613 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucOpp_ps; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11614 | halSetP2PGONOAParams.ctWindow = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11615 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uCtWindow; |
| 11616 | halSetP2PGONOAParams.count = pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucCount; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11617 | halSetP2PGONOAParams.duration = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11618 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uDuration; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11619 | halSetP2PGONOAParams.interval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11620 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11621 | halSetP2PGONOAParams.single_noa_duration = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11622 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uSingle_noa_duration; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11623 | halSetP2PGONOAParams.psSelection = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11624 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucPsSelection; |
| 11625 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11626 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11627 | &halSetP2PGONOAParams, |
| 11628 | sizeof(halSetP2PGONOAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11629 | |
| 11630 | pWDICtx->wdiReqStatusCB = pwdiP2PGONOAReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11631 | pWDICtx->pReqStatusUserData = pwdiP2PGONOAReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11632 | |
| 11633 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11634 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11635 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11636 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11637 | wdiP2PGONOAReqRspCb, pEventData->pUserData, |
| 11638 | WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11639 | }/*WDI_ProcessP2PGONOAReq*/ |
| 11640 | |
| 11641 | #endif |
| 11642 | |
| 11643 | |
| 11644 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11645 | @brief Function to handle the ack from DXE once the power |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11646 | state is set. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11647 | @param None |
| 11648 | |
| 11649 | @see |
| 11650 | @return void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11651 | */ |
| 11652 | void |
| 11653 | WDI_SetPowerStateCb |
| 11654 | ( |
| 11655 | wpt_status status, |
| 11656 | unsigned int dxePhyAddr, |
| 11657 | void *pContext |
| 11658 | ) |
| 11659 | { |
| 11660 | wpt_status wptStatus; |
| 11661 | WDI_ControlBlockType *pCB = NULL; |
| 11662 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 11663 | if(eWLAN_PAL_STATUS_E_FAILURE == status ) |
| 11664 | { |
| 11665 | //it shouldn't happen, put an error msg |
| 11666 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11667 | /* |
| 11668 | * Trigger the event to bring the Enter BMPS req function to come |
| 11669 | * out of wait |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11670 | */ |
| 11671 | if( NULL != pContext ) |
| 11672 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11673 | pCB = (WDI_ControlBlockType *)pContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11674 | } |
| 11675 | else |
| 11676 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11677 | //put an error msg |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11678 | pCB = &gWDICb; |
| 11679 | } |
| 11680 | pCB->dxePhyAddr = dxePhyAddr; |
| 11681 | wptStatus = wpalEventSet(&pCB->setPowerStateEvent); |
| 11682 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 11683 | { |
| 11684 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11685 | "Failed to set an event"); |
| 11686 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11687 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11688 | } |
| 11689 | return; |
| 11690 | } |
| 11691 | |
| 11692 | |
| 11693 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11694 | @brief Process Enter IMPS Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11695 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11696 | |
| 11697 | @param pWDICtx: pointer to the WLAN DAL context |
| 11698 | pEventData: pointer to the event information structure |
| 11699 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11700 | @see |
| 11701 | @return Result of the function call |
| 11702 | */ |
| 11703 | WDI_Status |
| 11704 | WDI_ProcessEnterImpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11705 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11706 | WDI_ControlBlockType* pWDICtx, |
| 11707 | WDI_EventInfoType* pEventData |
| 11708 | ) |
| 11709 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11710 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11711 | WDI_EnterImpsRspCb wdiEnterImpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11712 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11713 | wpt_uint16 usDataOffset = 0; |
| 11714 | wpt_uint16 usSendSize = 0; |
| 11715 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11716 | |
| 11717 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11718 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11719 | -------------------------------------------------------------------------*/ |
| 11720 | if (( NULL == pEventData ) || |
| 11721 | ( NULL == (wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pEventData->pCBfnc))) |
| 11722 | { |
| 11723 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11724 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11725 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11726 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11727 | } |
| 11728 | |
| 11729 | /*----------------------------------------------------------------------- |
| 11730 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11731 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11732 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11733 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_IMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11734 | 0, |
| 11735 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11736 | ( usSendSize < (usDataOffset ))) |
| 11737 | { |
| 11738 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11739 | "Unable to get send buffer in Enter IMPS req %x %x", |
| 11740 | pEventData, wdiEnterImpsRspCb); |
| 11741 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11742 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11743 | } |
| 11744 | |
| 11745 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11746 | wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 11747 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11748 | { |
| 11749 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11750 | "WDI Init failed to reset an event"); |
| 11751 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11752 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11753 | return VOS_STATUS_E_FAILURE; |
| 11754 | } |
| 11755 | |
| 11756 | // notify DTS that we are entering IMPS |
| 11757 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_IMPS, WDI_SetPowerStateCb); |
| 11758 | |
| 11759 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11760 | * 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] | 11761 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11762 | wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 11763 | WDI_SET_POWER_STATE_TIMEOUT); |
| 11764 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11765 | { |
| 11766 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11767 | "WDI Init failed to wait on an event"); |
| 11768 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11769 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11770 | return VOS_STATUS_E_FAILURE; |
| 11771 | } |
| 11772 | |
| 11773 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11774 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11775 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11776 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11777 | wdiEnterImpsRspCb, pEventData->pUserData, WDI_ENTER_IMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11778 | }/*WDI_ProcessEnterImpsReq*/ |
| 11779 | |
| 11780 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11781 | @brief Process Exit IMPS Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11782 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11783 | |
| 11784 | @param pWDICtx: pointer to the WLAN DAL context |
| 11785 | pEventData: pointer to the event information structure |
| 11786 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11787 | @see |
| 11788 | @return Result of the function call |
| 11789 | */ |
| 11790 | WDI_Status |
| 11791 | WDI_ProcessExitImpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11792 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11793 | WDI_ControlBlockType* pWDICtx, |
| 11794 | WDI_EventInfoType* pEventData |
| 11795 | ) |
| 11796 | { |
| 11797 | WDI_ExitImpsRspCb wdiExitImpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11798 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11799 | wpt_uint16 usDataOffset = 0; |
| 11800 | wpt_uint16 usSendSize = 0; |
| 11801 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11802 | |
| 11803 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11804 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11805 | -------------------------------------------------------------------------*/ |
| 11806 | if (( NULL == pEventData ) || |
| 11807 | ( NULL == (wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pEventData->pCBfnc))) |
| 11808 | { |
| 11809 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11810 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11811 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11812 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11813 | } |
| 11814 | |
| 11815 | /*----------------------------------------------------------------------- |
| 11816 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11817 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11818 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11819 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_IMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11820 | 0, |
| 11821 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11822 | ( usSendSize < (usDataOffset ))) |
| 11823 | { |
| 11824 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11825 | "Unable to get send buffer in Exit IMPS req %x %x", |
| 11826 | pEventData, wdiExitImpsRspCb); |
| 11827 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11828 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11829 | } |
| 11830 | |
| 11831 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11832 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11833 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11834 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11835 | wdiExitImpsRspCb, pEventData->pUserData, WDI_EXIT_IMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11836 | }/*WDI_ProcessExitImpsReq*/ |
| 11837 | |
| 11838 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11839 | @brief Process Enter BMPS Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11840 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11841 | |
| 11842 | @param pWDICtx: pointer to the WLAN DAL context |
| 11843 | pEventData: pointer to the event information structure |
| 11844 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11845 | @see |
| 11846 | @return Result of the function call |
| 11847 | */ |
| 11848 | WDI_Status |
| 11849 | WDI_ProcessEnterBmpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11850 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11851 | WDI_ControlBlockType* pWDICtx, |
| 11852 | WDI_EventInfoType* pEventData |
| 11853 | ) |
| 11854 | { |
| 11855 | WDI_EnterBmpsReqParamsType* pwdiEnterBmpsReqParams = NULL; |
| 11856 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11857 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11858 | wpt_uint16 usDataOffset = 0; |
| 11859 | wpt_uint16 usSendSize = 0; |
| 11860 | tHalEnterBmpsReqParams enterBmpsReq; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11861 | wpt_status wptStatus; |
| 11862 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11863 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11864 | |
| 11865 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11866 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11867 | -------------------------------------------------------------------------*/ |
| 11868 | if (( NULL == pEventData ) || |
| 11869 | ( NULL == (pwdiEnterBmpsReqParams = (WDI_EnterBmpsReqParamsType*)pEventData->pEventData)) || |
| 11870 | ( NULL == (wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pEventData->pCBfnc))) |
| 11871 | { |
| 11872 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11873 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11874 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11875 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11876 | } |
| 11877 | |
| 11878 | /*----------------------------------------------------------------------- |
| 11879 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11880 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11881 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11882 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_BMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11883 | sizeof(enterBmpsReq), |
| 11884 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11885 | ( usSendSize < (usDataOffset + sizeof(enterBmpsReq) ))) |
| 11886 | { |
| 11887 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11888 | "Unable to get send buffer in Enter BMPS req %x %x %x", |
| 11889 | pEventData, pwdiEnterBmpsReqParams, wdiEnterBmpsRspCb); |
| 11890 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11891 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11892 | } |
| 11893 | |
| 11894 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11895 | wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 11896 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11897 | { |
| 11898 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11899 | "WDI Init failed to reset an event"); |
| 11900 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11901 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11902 | return VOS_STATUS_E_FAILURE; |
| 11903 | } |
| 11904 | |
| 11905 | // notify DTS that we are entering BMPS |
| 11906 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, WDI_SetPowerStateCb); |
| 11907 | |
| 11908 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11909 | * 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] | 11910 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11911 | wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 11912 | WDI_SET_POWER_STATE_TIMEOUT); |
| 11913 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11914 | { |
| 11915 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11916 | "WDI Init failed to wait on an event"); |
| 11917 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11918 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11919 | return VOS_STATUS_E_FAILURE; |
| 11920 | } |
| 11921 | |
| 11922 | pWDICtx->bInBmps = eWLAN_PAL_TRUE; |
| 11923 | |
| 11924 | enterBmpsReq.bssIdx = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucBssIdx; |
| 11925 | enterBmpsReq.tbtt = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.uTbtt; |
| 11926 | enterBmpsReq.dtimCount = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimCount; |
| 11927 | enterBmpsReq.dtimPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimPeriod; |
| 11928 | |
| 11929 | // For CCX and 11R Roaming |
| 11930 | enterBmpsReq.rssiFilterPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.rssiFilterPeriod; |
| 11931 | enterBmpsReq.numBeaconPerRssiAverage = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.numBeaconPerRssiAverage; |
| 11932 | enterBmpsReq.bRssiFilterEnable = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.bRssiFilterEnable; |
| 11933 | |
| 11934 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11935 | &enterBmpsReq, |
| 11936 | sizeof(enterBmpsReq)); |
| 11937 | |
| 11938 | pWDICtx->wdiReqStatusCB = pwdiEnterBmpsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11939 | pWDICtx->pReqStatusUserData = pwdiEnterBmpsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11940 | |
| 11941 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11942 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11943 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11944 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11945 | wdiEnterBmpsRspCb, pEventData->pUserData, WDI_ENTER_BMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11946 | }/*WDI_ProcessEnterBmpsReq*/ |
| 11947 | |
| 11948 | /** |
| 11949 | @brief Process Exit BMPS Request function (called when Main FSM |
| 11950 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11951 | |
| 11952 | @param pWDICtx: pointer to the WLAN DAL context |
| 11953 | pEventData: pointer to the event information structure |
| 11954 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11955 | @see |
| 11956 | @return Result of the function call |
| 11957 | */ |
| 11958 | WDI_Status |
| 11959 | WDI_ProcessExitBmpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11960 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11961 | WDI_ControlBlockType* pWDICtx, |
| 11962 | WDI_EventInfoType* pEventData |
| 11963 | ) |
| 11964 | { |
| 11965 | WDI_ExitBmpsReqParamsType* pwdiExitBmpsReqParams = NULL; |
| 11966 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11967 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11968 | wpt_uint16 usDataOffset = 0; |
| 11969 | wpt_uint16 usSendSize = 0; |
| 11970 | tHalExitBmpsReqParams exitBmpsReq; |
| 11971 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11972 | |
| 11973 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11974 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11975 | -------------------------------------------------------------------------*/ |
| 11976 | if (( NULL == pEventData ) || |
| 11977 | ( NULL == (pwdiExitBmpsReqParams = (WDI_ExitBmpsReqParamsType*)pEventData->pEventData)) || |
| 11978 | ( NULL == (wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pEventData->pCBfnc))) |
| 11979 | { |
| 11980 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11981 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11982 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11983 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11984 | } |
| 11985 | |
| 11986 | /*----------------------------------------------------------------------- |
| 11987 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11988 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11989 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11990 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_BMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11991 | sizeof(exitBmpsReq), |
| 11992 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11993 | ( usSendSize < (usDataOffset + sizeof(exitBmpsReq) ))) |
| 11994 | { |
| 11995 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11996 | "Unable to get send buffer in Exit BMPS req %x %x %x", |
| 11997 | pEventData, pwdiExitBmpsReqParams, wdiExitBmpsRspCb); |
| 11998 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11999 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12000 | } |
| 12001 | exitBmpsReq.sendDataNull = pwdiExitBmpsReqParams->wdiExitBmpsInfo.ucSendDataNull; |
| 12002 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12003 | exitBmpsReq.bssIdx = pwdiExitBmpsReqParams->wdiExitBmpsInfo.bssIdx; |
| 12004 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12005 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12006 | &exitBmpsReq, |
| 12007 | sizeof(exitBmpsReq)); |
| 12008 | |
| 12009 | pWDICtx->wdiReqStatusCB = pwdiExitBmpsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12010 | pWDICtx->pReqStatusUserData = pwdiExitBmpsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12011 | |
| 12012 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12013 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12014 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12015 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12016 | wdiExitBmpsRspCb, pEventData->pUserData, WDI_EXIT_BMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12017 | }/*WDI_ProcessExitBmpsReq*/ |
| 12018 | |
| 12019 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12020 | @brief Process Enter UAPSD Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12021 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12022 | |
| 12023 | @param pWDICtx: pointer to the WLAN DAL context |
| 12024 | pEventData: pointer to the event information structure |
| 12025 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12026 | @see |
| 12027 | @return Result of the function call |
| 12028 | */ |
| 12029 | WDI_Status |
| 12030 | WDI_ProcessEnterUapsdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12031 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12032 | WDI_ControlBlockType* pWDICtx, |
| 12033 | WDI_EventInfoType* pEventData |
| 12034 | ) |
| 12035 | { |
| 12036 | WDI_EnterUapsdReqParamsType* pwdiEnterUapsdReqParams = NULL; |
| 12037 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12038 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12039 | wpt_uint16 usDataOffset = 0; |
| 12040 | wpt_uint16 usSendSize = 0; |
| 12041 | tUapsdReqParams enterUapsdReq; |
| 12042 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12043 | |
| 12044 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12045 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12046 | -------------------------------------------------------------------------*/ |
| 12047 | if (( NULL == pEventData ) || |
| 12048 | ( NULL == (pwdiEnterUapsdReqParams = (WDI_EnterUapsdReqParamsType*)pEventData->pEventData)) || |
| 12049 | ( NULL == (wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pEventData->pCBfnc))) |
| 12050 | { |
| 12051 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12052 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12053 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12054 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12055 | } |
| 12056 | |
| 12057 | /*----------------------------------------------------------------------- |
| 12058 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12059 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12060 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12061 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_UAPSD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12062 | sizeof(enterUapsdReq), |
| 12063 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12064 | ( usSendSize < (usDataOffset + sizeof(enterUapsdReq) ))) |
| 12065 | { |
| 12066 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12067 | "Unable to get send buffer in Enter UAPSD req %x %x %x", |
| 12068 | pEventData, pwdiEnterUapsdReqParams, wdiEnterUapsdRspCb); |
| 12069 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12070 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12071 | } |
| 12072 | |
| 12073 | enterUapsdReq.beDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeDeliveryEnabled; |
| 12074 | enterUapsdReq.beTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeTriggerEnabled; |
| 12075 | enterUapsdReq.bkDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkDeliveryEnabled; |
| 12076 | enterUapsdReq.bkTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkTriggerEnabled; |
| 12077 | enterUapsdReq.viDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViDeliveryEnabled; |
| 12078 | enterUapsdReq.viTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViTriggerEnabled; |
| 12079 | enterUapsdReq.voDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoDeliveryEnabled; |
| 12080 | enterUapsdReq.voTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoTriggerEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12081 | enterUapsdReq.bssIdx = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.bssIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12082 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12083 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12084 | &enterUapsdReq, |
| 12085 | sizeof(enterUapsdReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12086 | |
| 12087 | pWDICtx->wdiReqStatusCB = pwdiEnterUapsdReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12088 | pWDICtx->pReqStatusUserData = pwdiEnterUapsdReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12089 | |
| 12090 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12091 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12092 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12093 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12094 | wdiEnterUapsdRspCb, pEventData->pUserData, WDI_ENTER_UAPSD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12095 | }/*WDI_ProcessEnterUapsdReq*/ |
| 12096 | |
| 12097 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12098 | @brief Process Exit UAPSD Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12099 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12100 | |
| 12101 | @param pWDICtx: pointer to the WLAN DAL context |
| 12102 | pEventData: pointer to the event information structure |
| 12103 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12104 | @see |
| 12105 | @return Result of the function call |
| 12106 | */ |
| 12107 | WDI_Status |
| 12108 | WDI_ProcessExitUapsdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12109 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12110 | WDI_ControlBlockType* pWDICtx, |
| 12111 | WDI_EventInfoType* pEventData |
| 12112 | ) |
| 12113 | { |
| 12114 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12115 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12116 | wpt_uint16 usDataOffset = 0; |
| 12117 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12118 | WDI_ExitUapsdReqParamsType *pExitUapsdparams; |
| 12119 | wpt_uint8 bssIdx = 0; |
| 12120 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12121 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12122 | |
| 12123 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12124 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12125 | -------------------------------------------------------------------------*/ |
| 12126 | if (( NULL == pEventData ) || |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12127 | ( NULL == (pExitUapsdparams = (WDI_ExitUapsdReqParamsType *)pEventData->pEventData)) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12128 | ( NULL == (wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pEventData->pCBfnc))) |
| 12129 | { |
| 12130 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12131 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12132 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12133 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12134 | } |
| 12135 | |
| 12136 | /*----------------------------------------------------------------------- |
| 12137 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12138 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12139 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12140 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_UAPSD_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12141 | sizeof(wpt_uint8), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12142 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12143 | ( usSendSize < (usDataOffset + sizeof(wpt_uint8)))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12144 | { |
| 12145 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12146 | "Unable to get send buffer in Exit UAPSD req %x %x", |
| 12147 | pEventData, wdiExitUapsdRspCb); |
| 12148 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12149 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12150 | } |
| 12151 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12152 | bssIdx = pExitUapsdparams->wdiExitUapsdInfo.bssIdx; |
| 12153 | |
| 12154 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12155 | &bssIdx, |
| 12156 | sizeof(wpt_uint8)); |
| 12157 | |
| 12158 | pWDICtx->wdiReqStatusCB = pExitUapsdparams->wdiReqStatusCB; |
| 12159 | pWDICtx->pReqStatusUserData = pExitUapsdparams->pUserData; |
| 12160 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12161 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12162 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12163 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12164 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12165 | wdiExitUapsdRspCb, pEventData->pUserData, WDI_EXIT_UAPSD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12166 | }/*WDI_ProcessExitUapsdReq*/ |
| 12167 | |
| 12168 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12169 | @brief Process Set UAPSD params Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12170 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12171 | |
| 12172 | @param pWDICtx: pointer to the WLAN DAL context |
| 12173 | pEventData: pointer to the event information structure |
| 12174 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12175 | @see |
| 12176 | @return Result of the function call |
| 12177 | */ |
| 12178 | WDI_Status |
| 12179 | WDI_ProcessSetUapsdAcParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12180 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12181 | WDI_ControlBlockType* pWDICtx, |
| 12182 | WDI_EventInfoType* pEventData |
| 12183 | ) |
| 12184 | { |
| 12185 | WDI_SetUapsdAcParamsReqParamsType* pwdiSetUapsdAcParams = NULL; |
| 12186 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12187 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12188 | wpt_uint16 usDataOffset = 0; |
| 12189 | wpt_uint16 usSendSize = 0; |
| 12190 | tUapsdInfo uapsdAcParamsReq; |
| 12191 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12192 | |
| 12193 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12194 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12195 | -------------------------------------------------------------------------*/ |
| 12196 | if (( NULL == pEventData ) || |
| 12197 | ( NULL == (pwdiSetUapsdAcParams = (WDI_SetUapsdAcParamsReqParamsType*)pEventData->pEventData)) || |
| 12198 | ( NULL == (wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pEventData->pCBfnc))) |
| 12199 | { |
| 12200 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12201 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12202 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12203 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12204 | } |
| 12205 | |
| 12206 | /*----------------------------------------------------------------------- |
| 12207 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12208 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12209 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12210 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_UAPSD_PARAM_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12211 | sizeof(uapsdAcParamsReq), |
| 12212 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12213 | ( usSendSize < (usDataOffset + sizeof(uapsdAcParamsReq) ))) |
| 12214 | { |
| 12215 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12216 | "Unable to get send buffer in Set UAPSD params req %x %x %x", |
| 12217 | pEventData, pwdiSetUapsdAcParams, wdiSetUapsdAcParamsCb); |
| 12218 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12219 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12220 | } |
| 12221 | |
| 12222 | uapsdAcParamsReq.ac = pwdiSetUapsdAcParams->wdiUapsdInfo.ucAc; |
| 12223 | uapsdAcParamsReq.staidx = pwdiSetUapsdAcParams->wdiUapsdInfo.ucSTAIdx; |
| 12224 | uapsdAcParamsReq.up = pwdiSetUapsdAcParams->wdiUapsdInfo.ucUp; |
| 12225 | uapsdAcParamsReq.delayInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uDelayInterval; |
| 12226 | uapsdAcParamsReq.srvInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSrvInterval; |
| 12227 | uapsdAcParamsReq.susInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSusInterval; |
| 12228 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12229 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12230 | &uapsdAcParamsReq, |
| 12231 | sizeof(uapsdAcParamsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12232 | |
| 12233 | pWDICtx->wdiReqStatusCB = pwdiSetUapsdAcParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12234 | pWDICtx->pReqStatusUserData = pwdiSetUapsdAcParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12235 | |
| 12236 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12237 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12238 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12239 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12240 | wdiSetUapsdAcParamsCb, pEventData->pUserData, WDI_SET_UAPSD_PARAM_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12241 | }/*WDI_ProcessSetUapsdAcParamsReq*/ |
| 12242 | |
| 12243 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12244 | @brief Process update UAPSD params Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12245 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12246 | |
| 12247 | @param pWDICtx: pointer to the WLAN DAL context |
| 12248 | pEventData: pointer to the event information structure |
| 12249 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12250 | @see |
| 12251 | @return Result of the function call |
| 12252 | */ |
| 12253 | WDI_Status |
| 12254 | WDI_ProcessUpdateUapsdParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12255 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12256 | WDI_ControlBlockType* pWDICtx, |
| 12257 | WDI_EventInfoType* pEventData |
| 12258 | ) |
| 12259 | { |
| 12260 | WDI_UpdateUapsdReqParamsType* pwdiUpdateUapsdReqParams = NULL; |
| 12261 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12262 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12263 | wpt_uint16 usDataOffset = 0; |
| 12264 | wpt_uint16 usSendSize = 0; |
| 12265 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12266 | |
| 12267 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12268 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12269 | -------------------------------------------------------------------------*/ |
| 12270 | if (( NULL == pEventData ) || |
| 12271 | ( NULL == (pwdiUpdateUapsdReqParams = (WDI_UpdateUapsdReqParamsType*)pEventData->pEventData)) || |
| 12272 | ( NULL == (wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pEventData->pCBfnc))) |
| 12273 | { |
| 12274 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12275 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12276 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12277 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12278 | } |
| 12279 | |
| 12280 | /*----------------------------------------------------------------------- |
| 12281 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12282 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12283 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12284 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_UAPSD_PARAM_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12285 | sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo), |
| 12286 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12287 | ( usSendSize < (usDataOffset + sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo) ))) |
| 12288 | { |
| 12289 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12290 | "Unable to get send buffer in Update UAPSD params req %x %x %x", |
| 12291 | pEventData, pwdiUpdateUapsdReqParams, wdiUpdateUapsdParamsCb); |
| 12292 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12293 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12294 | } |
| 12295 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12296 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12297 | &pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo, |
| 12298 | sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12299 | |
| 12300 | pWDICtx->wdiReqStatusCB = pwdiUpdateUapsdReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12301 | pWDICtx->pReqStatusUserData = pwdiUpdateUapsdReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12302 | |
| 12303 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12304 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12305 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12306 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12307 | wdiUpdateUapsdParamsCb, pEventData->pUserData, WDI_UPDATE_UAPSD_PARAM_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12308 | }/*WDI_ProcessUpdateUapsdParamsReq*/ |
| 12309 | |
| 12310 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12311 | @brief Process Configure RXP filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12312 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12313 | |
| 12314 | @param pWDICtx: pointer to the WLAN DAL context |
| 12315 | pEventData: pointer to the event information structure |
| 12316 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12317 | @see |
| 12318 | @return Result of the function call |
| 12319 | */ |
| 12320 | WDI_Status |
| 12321 | WDI_ProcessConfigureRxpFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12322 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12323 | WDI_ControlBlockType* pWDICtx, |
| 12324 | WDI_EventInfoType* pEventData |
| 12325 | ) |
| 12326 | { |
| 12327 | WDI_ConfigureRxpFilterReqParamsType* pwdiRxpFilterParams = NULL; |
| 12328 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12329 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12330 | wpt_uint16 usDataOffset = 0; |
| 12331 | wpt_uint16 usSendSize = 0; |
| 12332 | tHalConfigureRxpFilterReqParams halRxpFilterParams; |
| 12333 | |
| 12334 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12335 | |
| 12336 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12337 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12338 | -------------------------------------------------------------------------*/ |
| 12339 | if (( NULL == pEventData ) || |
| 12340 | ( NULL == (pwdiRxpFilterParams = (WDI_ConfigureRxpFilterReqParamsType*)pEventData->pEventData)) || |
| 12341 | ( NULL == (wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pEventData->pCBfnc))) |
| 12342 | { |
| 12343 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12344 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12345 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12346 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12347 | } |
| 12348 | |
| 12349 | /*----------------------------------------------------------------------- |
| 12350 | Get message buffer |
| 12351 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12352 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_RXP_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12353 | sizeof(halRxpFilterParams), |
| 12354 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12355 | ( usSendSize < (usDataOffset + sizeof(halRxpFilterParams) ))) |
| 12356 | { |
| 12357 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12358 | "Unable to get send buffer in Set UAPSD params req %x %x %x", |
| 12359 | pEventData, pwdiRxpFilterParams, wdiConfigureRxpFilterCb); |
| 12360 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12361 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12362 | } |
| 12363 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12364 | halRxpFilterParams.setMcstBcstFilterSetting = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12365 | pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12366 | halRxpFilterParams.setMcstBcstFilter = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12367 | pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter; |
| 12368 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12369 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12370 | &halRxpFilterParams, |
| 12371 | sizeof(halRxpFilterParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12372 | |
| 12373 | pWDICtx->wdiReqStatusCB = pwdiRxpFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12374 | pWDICtx->pReqStatusUserData = pwdiRxpFilterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12375 | |
| 12376 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12377 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12378 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12379 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12380 | wdiConfigureRxpFilterCb, pEventData->pUserData, WDI_CONFIGURE_RXP_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12381 | }/*WDI_ProcessConfigureRxpFilterReq*/ |
| 12382 | |
| 12383 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12384 | @brief Process set beacon filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12385 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12386 | |
| 12387 | @param pWDICtx: pointer to the WLAN DAL context |
| 12388 | pEventData: pointer to the event information structure |
| 12389 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12390 | @see |
| 12391 | @return Result of the function call |
| 12392 | */ |
| 12393 | WDI_Status |
| 12394 | WDI_ProcessSetBeaconFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12395 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12396 | WDI_ControlBlockType* pWDICtx, |
| 12397 | WDI_EventInfoType* pEventData |
| 12398 | ) |
| 12399 | { |
| 12400 | WDI_BeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL; |
| 12401 | WDI_SetBeaconFilterCb wdiBeaconFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12402 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12403 | wpt_uint16 usDataOffset = 0; |
| 12404 | wpt_uint16 usSendSize = 0; |
| 12405 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12406 | |
| 12407 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12408 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12409 | -------------------------------------------------------------------------*/ |
| 12410 | if (( NULL == pEventData ) || |
| 12411 | ( NULL == (pwdiBeaconFilterParams = (WDI_BeaconFilterReqParamsType*)pEventData->pEventData)) || |
| 12412 | ( NULL == (wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pEventData->pCBfnc))) |
| 12413 | { |
| 12414 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12415 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12416 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12417 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12418 | } |
| 12419 | |
| 12420 | /*----------------------------------------------------------------------- |
| 12421 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12422 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12423 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12424 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BEACON_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12425 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) + pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe), |
| 12426 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12427 | ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) ))) |
| 12428 | { |
| 12429 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12430 | "Unable to get send buffer in Set beacon filter req %x %x %x", |
| 12431 | pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb); |
| 12432 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12433 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12434 | } |
| 12435 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12436 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12437 | &pwdiBeaconFilterParams->wdiBeaconFilterInfo, |
| 12438 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo)); |
| 12439 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo), |
| 12440 | &pwdiBeaconFilterParams->aFilters[0], |
| 12441 | pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12442 | |
| 12443 | pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12444 | pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12445 | |
| 12446 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12447 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12448 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12449 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12450 | wdiBeaconFilterCb, pEventData->pUserData, WDI_SET_BEACON_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12451 | }/*WDI_ProcessSetBeaconFilterReq*/ |
| 12452 | |
| 12453 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12454 | @brief Process remove beacon filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12455 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12456 | |
| 12457 | @param pWDICtx: pointer to the WLAN DAL context |
| 12458 | pEventData: pointer to the event information structure |
| 12459 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12460 | @see |
| 12461 | @return Result of the function call |
| 12462 | */ |
| 12463 | WDI_Status |
| 12464 | WDI_ProcessRemBeaconFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12465 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12466 | WDI_ControlBlockType* pWDICtx, |
| 12467 | WDI_EventInfoType* pEventData |
| 12468 | ) |
| 12469 | { |
| 12470 | WDI_RemBeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL; |
| 12471 | WDI_RemBeaconFilterCb wdiBeaconFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12472 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12473 | wpt_uint16 usDataOffset = 0; |
| 12474 | wpt_uint16 usSendSize = 0; |
| 12475 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12476 | |
| 12477 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12478 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12479 | -------------------------------------------------------------------------*/ |
| 12480 | if (( NULL == pEventData ) || |
| 12481 | ( NULL == (pwdiBeaconFilterParams = (WDI_RemBeaconFilterReqParamsType*)pEventData->pEventData)) || |
| 12482 | ( NULL == (wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pEventData->pCBfnc))) |
| 12483 | { |
| 12484 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12485 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12486 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12487 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12488 | } |
| 12489 | |
| 12490 | /*----------------------------------------------------------------------- |
| 12491 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12492 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12493 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12494 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_REM_BEACON_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12495 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo), |
| 12496 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12497 | ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) ))) |
| 12498 | { |
| 12499 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12500 | "Unable to get send buffer in remove beacon filter req %x %x %x", |
| 12501 | pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb); |
| 12502 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12503 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12504 | } |
| 12505 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12506 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12507 | &pwdiBeaconFilterParams->wdiBeaconFilterInfo, |
| 12508 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12509 | |
| 12510 | pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12511 | pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12512 | |
| 12513 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12514 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12515 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12516 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12517 | wdiBeaconFilterCb, pEventData->pUserData, WDI_REM_BEACON_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12518 | } |
| 12519 | |
| 12520 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12521 | @brief Process set RSSI thresholds Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12522 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12523 | |
| 12524 | @param pWDICtx: pointer to the WLAN DAL context |
| 12525 | pEventData: pointer to the event information structure |
| 12526 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12527 | @see |
| 12528 | @return Result of the function call |
| 12529 | */ |
| 12530 | WDI_Status |
| 12531 | WDI_ProcessSetRSSIThresholdsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12532 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12533 | WDI_ControlBlockType* pWDICtx, |
| 12534 | WDI_EventInfoType* pEventData |
| 12535 | ) |
| 12536 | { |
| 12537 | WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams = NULL; |
| 12538 | WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12539 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12540 | wpt_uint16 usDataOffset = 0; |
| 12541 | wpt_uint16 usSendSize = 0; |
| 12542 | tHalRSSIThresholds rssiThresholdsReq; |
| 12543 | WDI_Status ret_status = 0; |
| 12544 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12545 | |
| 12546 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12547 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12548 | -------------------------------------------------------------------------*/ |
| 12549 | if (( NULL == pEventData ) || |
| 12550 | ( NULL == (pwdiRSSIThresholdsParams = (WDI_SetRSSIThresholdsReqParamsType*)pEventData->pEventData)) || |
| 12551 | ( NULL == (wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pEventData->pCBfnc))) |
| 12552 | { |
| 12553 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12554 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12555 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12556 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12557 | } |
| 12558 | |
| 12559 | /*----------------------------------------------------------------------- |
| 12560 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12561 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12562 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12563 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_RSSI_THRESHOLDS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12564 | sizeof(rssiThresholdsReq), |
| 12565 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12566 | ( usSendSize < (usDataOffset + sizeof(rssiThresholdsReq) ))) |
| 12567 | { |
| 12568 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12569 | "Unable to get send buffer in remove beacon filter req %x %x %x", |
| 12570 | pEventData, pwdiRSSIThresholdsParams, wdiRSSIThresholdsCb); |
| 12571 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12572 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12573 | } |
| 12574 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12575 | rssiThresholdsReq.bReserved10 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12576 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bReserved10; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12577 | rssiThresholdsReq.bRssiThres1NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12578 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12579 | rssiThresholdsReq.bRssiThres1PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12580 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12581 | rssiThresholdsReq.bRssiThres2NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12582 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12583 | rssiThresholdsReq.bRssiThres2PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12584 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12585 | rssiThresholdsReq.bRssiThres3NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12586 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12587 | rssiThresholdsReq.bRssiThres3PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12588 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12589 | rssiThresholdsReq.ucRssiThreshold1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12590 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12591 | rssiThresholdsReq.ucRssiThreshold2 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12592 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold2; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12593 | rssiThresholdsReq.ucRssiThreshold3 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12594 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold3; |
| 12595 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12596 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12597 | &rssiThresholdsReq, |
| 12598 | sizeof(rssiThresholdsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12599 | |
| 12600 | pWDICtx->wdiReqStatusCB = pwdiRSSIThresholdsParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12601 | pWDICtx->pReqStatusUserData = pwdiRSSIThresholdsParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12602 | |
| 12603 | /*------------------------------------------------------------------------- |
| 12604 | Send Set threshold req to HAL |
| 12605 | -------------------------------------------------------------------------*/ |
| 12606 | if ((ret_status = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12607 | wdiRSSIThresholdsCb, pEventData->pUserData, WDI_SET_RSSI_THRESHOLDS_RESP)) == WDI_STATUS_SUCCESS) |
| 12608 | { |
| 12609 | // When we are in idle state WDI_STARTED_ST and we receive indication for threshold |
| 12610 | // req. Then as a result of processing the threshold cross ind, we trigger |
| 12611 | // a Set threshold req, then we need to indicate to WDI that it needs to |
| 12612 | // go to busy state as a result of the indication as we sent a req in the |
| 12613 | // same WDI context. |
| 12614 | // Hence expected state transition is to busy. |
| 12615 | pWDICtx->ucExpectedStateTransition = WDI_BUSY_ST; |
| 12616 | } |
| 12617 | |
| 12618 | return ret_status; |
| 12619 | } |
| 12620 | |
| 12621 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12622 | @brief Process set RSSI thresholds Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12623 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12624 | |
| 12625 | @param pWDICtx: pointer to the WLAN DAL context |
| 12626 | pEventData: pointer to the event information structure |
| 12627 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12628 | @see |
| 12629 | @return Result of the function call |
| 12630 | */ |
| 12631 | WDI_Status |
| 12632 | WDI_ProcessHostOffloadReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12633 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12634 | WDI_ControlBlockType* pWDICtx, |
| 12635 | WDI_EventInfoType* pEventData |
| 12636 | ) |
| 12637 | { |
| 12638 | WDI_HostOffloadReqParamsType* pwdiHostOffloadParams = NULL; |
| 12639 | WDI_HostOffloadCb wdiHostOffloadCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12640 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12641 | wpt_uint16 usDataOffset = 0; |
| 12642 | wpt_uint16 usSendSize = 0; |
| 12643 | tHalHostOffloadReq hostOffloadParams; |
| 12644 | tHalNSOffloadParams nsOffloadParams; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12645 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 12646 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12647 | |
| 12648 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12649 | |
| 12650 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12651 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12652 | -------------------------------------------------------------------------*/ |
| 12653 | if (( NULL == pEventData ) || |
| 12654 | ( NULL == (pwdiHostOffloadParams = (WDI_HostOffloadReqParamsType*)pEventData->pEventData)) || |
| 12655 | ( NULL == (wdiHostOffloadCb = (WDI_HostOffloadCb)pEventData->pCBfnc))) |
| 12656 | { |
| 12657 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12658 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12659 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12660 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12661 | } |
| 12662 | |
| 12663 | /*----------------------------------------------------------------------- |
| 12664 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12665 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12666 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12667 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HOST_OFFLOAD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12668 | sizeof(hostOffloadParams)+sizeof(nsOffloadParams), |
| 12669 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12670 | ( usSendSize < (usDataOffset + sizeof(hostOffloadParams) + sizeof(nsOffloadParams) ))) |
| 12671 | { |
| 12672 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12673 | "Unable to get send buffer in host offload req %x %x %x", |
| 12674 | pEventData, pwdiHostOffloadParams, wdiHostOffloadCb); |
| 12675 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12676 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12677 | } |
| 12678 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12679 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 12680 | pwdiHostOffloadParams->wdiHostOffloadInfo.bssId, |
| 12681 | &pBSSSes); |
| 12682 | if ( NULL == pBSSSes ) |
| 12683 | { |
| 12684 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12685 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12686 | return WDI_STATUS_E_FAILURE; |
| 12687 | } |
| 12688 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12689 | hostOffloadParams.offloadType = pwdiHostOffloadParams->wdiHostOffloadInfo.ucOffloadType; |
| 12690 | hostOffloadParams.enableOrDisable = pwdiHostOffloadParams->wdiHostOffloadInfo.ucEnableOrDisable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12691 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12692 | if( HAL_IPV4_ARP_REPLY_OFFLOAD == hostOffloadParams.offloadType ) |
| 12693 | { |
| 12694 | // ARP Offload |
| 12695 | wpalMemoryCopy(hostOffloadParams.params.hostIpv4Addr, |
| 12696 | pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv4Addr, |
| 12697 | 4); |
| 12698 | } |
| 12699 | else |
| 12700 | { |
| 12701 | // NS Offload |
| 12702 | wpalMemoryCopy(hostOffloadParams.params.hostIpv6Addr, |
| 12703 | pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv6Addr, |
| 12704 | 16); |
| 12705 | |
| 12706 | #ifdef WLAN_NS_OFFLOAD |
| 12707 | // copy pwdiHostOffloadParams->wdiNsOffloadParams into nsOffloadParams |
| 12708 | wpalMemoryCopy(nsOffloadParams.srcIPv6Addr, |
| 12709 | pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6Addr, |
| 12710 | 16); |
| 12711 | wpalMemoryCopy(nsOffloadParams.selfIPv6Addr, |
| 12712 | pwdiHostOffloadParams->wdiNsOffloadParams.selfIPv6Addr, |
| 12713 | 16); |
| 12714 | wpalMemoryCopy(nsOffloadParams.targetIPv6Addr1, |
| 12715 | pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1, |
| 12716 | 16); |
| 12717 | wpalMemoryCopy(nsOffloadParams.targetIPv6Addr2, |
| 12718 | pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2, |
| 12719 | 16); |
| 12720 | wpalMemoryCopy(nsOffloadParams.selfMacAddr, |
| 12721 | pwdiHostOffloadParams->wdiNsOffloadParams.selfMacAddr, |
| 12722 | 6); |
| 12723 | nsOffloadParams.srcIPv6AddrValid = pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6AddrValid; |
| 12724 | nsOffloadParams.targetIPv6Addr1Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1Valid; |
| 12725 | nsOffloadParams.targetIPv6Addr2Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2Valid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12726 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12727 | #endif // WLAN_NS_OFFLOAD |
| 12728 | } |
| 12729 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12730 | nsOffloadParams.bssIdx = pBSSSes->ucBSSIdx; |
| 12731 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12732 | // copy hostOffloadParams into pSendBuffer |
| 12733 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12734 | &hostOffloadParams, |
| 12735 | sizeof(hostOffloadParams)); |
| 12736 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12737 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12738 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12739 | // copy nsOffloadParams into pSendBuffer |
| 12740 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12741 | &nsOffloadParams, |
| 12742 | sizeof(nsOffloadParams)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12743 | } |
| 12744 | else |
| 12745 | { |
| 12746 | #ifdef WLAN_NS_OFFLOAD |
| 12747 | if( HAL_IPV6_NS_OFFLOAD == hostOffloadParams.offloadType ) |
| 12748 | { |
| 12749 | // copy nsOffloadParams into pSendBuffer |
| 12750 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams), |
| 12751 | &nsOffloadParams, |
| 12752 | sizeof(nsOffloadParams)); |
| 12753 | } |
| 12754 | #endif |
| 12755 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12756 | |
| 12757 | pWDICtx->wdiReqStatusCB = pwdiHostOffloadParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12758 | pWDICtx->pReqStatusUserData = pwdiHostOffloadParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12759 | |
| 12760 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12761 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12762 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12763 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12764 | wdiHostOffloadCb, pEventData->pUserData, WDI_HOST_OFFLOAD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12765 | }/*WDI_ProcessHostOffloadReq*/ |
| 12766 | |
| 12767 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12768 | @brief Process Keep Alive Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12769 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12770 | |
| 12771 | @param pWDICtx: pointer to the WLAN DAL context |
| 12772 | pEventData: pointer to the event information structure |
| 12773 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12774 | @see |
| 12775 | @return Result of the function call |
| 12776 | */ |
| 12777 | WDI_Status |
| 12778 | WDI_ProcessKeepAliveReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12779 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12780 | WDI_ControlBlockType* pWDICtx, |
| 12781 | WDI_EventInfoType* pEventData |
| 12782 | ) |
| 12783 | { |
| 12784 | WDI_KeepAliveReqParamsType* pwdiKeepAliveParams = NULL; |
| 12785 | WDI_KeepAliveCb wdiKeepAliveCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12786 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12787 | wpt_uint16 usDataOffset = 0; |
| 12788 | wpt_uint16 usSendSize = 0; |
| 12789 | tHalKeepAliveReq keepAliveReq; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12790 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 12791 | WDI_BSSSessionType* pBSSSes = NULL; |
| 12792 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12793 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12794 | |
| 12795 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12796 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12797 | -------------------------------------------------------------------------*/ |
| 12798 | if (( NULL == pEventData ) || |
| 12799 | ( NULL == (pwdiKeepAliveParams = (WDI_KeepAliveReqParamsType*)pEventData->pEventData)) || |
| 12800 | ( NULL == (wdiKeepAliveCb = (WDI_KeepAliveCb)pEventData->pCBfnc))) |
| 12801 | { |
| 12802 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 12803 | "Invalid parameters in Keep Alive req"); |
| 12804 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12805 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12806 | } |
| 12807 | |
| 12808 | /*----------------------------------------------------------------------- |
| 12809 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12810 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12811 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12812 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_KEEP_ALIVE_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12813 | sizeof(keepAliveReq), |
| 12814 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12815 | ( usSendSize < (usDataOffset + sizeof(keepAliveReq) ))) |
| 12816 | { |
| 12817 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 12818 | "Unable to get send buffer in keep alive req %x %x %x", |
| 12819 | pEventData, pwdiKeepAliveParams, wdiKeepAliveCb); |
| 12820 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12821 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12822 | } |
| 12823 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12824 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 12825 | pwdiKeepAliveParams->wdiKeepAliveInfo.bssId, |
| 12826 | &pBSSSes); |
| 12827 | if ( NULL == pBSSSes ) |
| 12828 | { |
| 12829 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12830 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12831 | return WDI_STATUS_E_FAILURE; |
| 12832 | } |
| 12833 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12834 | keepAliveReq.packetType = pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType; |
| 12835 | keepAliveReq.timePeriod = pwdiKeepAliveParams->wdiKeepAliveInfo.ucTimePeriod; |
| 12836 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12837 | keepAliveReq.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12838 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12839 | if(pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType == 2) |
| 12840 | { |
| 12841 | wpalMemoryCopy(keepAliveReq.hostIpv4Addr, |
| 12842 | pwdiKeepAliveParams->wdiKeepAliveInfo.aHostIpv4Addr, |
| 12843 | HAL_IPV4_ADDR_LEN); |
| 12844 | wpalMemoryCopy(keepAliveReq.destIpv4Addr, |
| 12845 | pwdiKeepAliveParams->wdiKeepAliveInfo.aDestIpv4Addr, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12846 | HAL_IPV4_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12847 | wpalMemoryCopy(keepAliveReq.destMacAddr, |
| 12848 | pwdiKeepAliveParams->wdiKeepAliveInfo.aDestMacAddr, |
| 12849 | HAL_MAC_ADDR_LEN); |
| 12850 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12851 | |
| 12852 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12853 | &keepAliveReq, |
| 12854 | sizeof(keepAliveReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12855 | |
| 12856 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 12857 | "Process keep alive req %d",sizeof(keepAliveReq)); |
| 12858 | |
| 12859 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 12860 | "Process keep alive req time period %d",keepAliveReq.timePeriod); |
| 12861 | |
| 12862 | pWDICtx->wdiReqStatusCB = pwdiKeepAliveParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12863 | pWDICtx->pReqStatusUserData = pwdiKeepAliveParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12864 | |
| 12865 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 12866 | "Sending keep alive req to HAL"); |
| 12867 | |
| 12868 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12869 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12870 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12871 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12872 | wdiKeepAliveCb, pEventData->pUserData, WDI_KEEP_ALIVE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12873 | }/*WDI_ProcessKeepAliveReq*/ |
| 12874 | |
| 12875 | |
| 12876 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12877 | @brief Process Wowl add bc ptrn Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12878 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12879 | |
| 12880 | @param pWDICtx: pointer to the WLAN DAL context |
| 12881 | pEventData: pointer to the event information structure |
| 12882 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12883 | @see |
| 12884 | @return Result of the function call |
| 12885 | */ |
| 12886 | WDI_Status |
| 12887 | WDI_ProcessWowlAddBcPtrnReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12888 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12889 | WDI_ControlBlockType* pWDICtx, |
| 12890 | WDI_EventInfoType* pEventData |
| 12891 | ) |
| 12892 | { |
| 12893 | WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams = NULL; |
| 12894 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12895 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12896 | wpt_uint16 usDataOffset = 0; |
| 12897 | wpt_uint16 usSendSize = 0; |
| 12898 | tHalWowlAddBcastPtrn wowlAddBcPtrnReq; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12899 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 12900 | WDI_BSSSessionType* pBSSSes = NULL; |
| 12901 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12902 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12903 | |
| 12904 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12905 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12906 | -------------------------------------------------------------------------*/ |
| 12907 | if (( NULL == pEventData ) || |
| 12908 | ( NULL == (pwdiWowlAddBcPtrnParams = (WDI_WowlAddBcPtrnReqParamsType*)pEventData->pEventData)) || |
| 12909 | ( NULL == (wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pEventData->pCBfnc))) |
| 12910 | { |
| 12911 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12912 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12913 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12914 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12915 | } |
| 12916 | |
| 12917 | /*----------------------------------------------------------------------- |
| 12918 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12919 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12920 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12921 | 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] | 12922 | sizeof(wowlAddBcPtrnReq), |
| 12923 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12924 | ( usSendSize < (usDataOffset + sizeof(wowlAddBcPtrnReq) ))) |
| 12925 | { |
| 12926 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12927 | "Unable to get send buffer in Wowl add bc ptrn req %x %x %x", |
| 12928 | pEventData, pwdiWowlAddBcPtrnParams, wdiWowlAddBcPtrnCb); |
| 12929 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12930 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12931 | } |
| 12932 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12933 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 12934 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.bssId, |
| 12935 | &pBSSSes); |
| 12936 | if ( NULL == pBSSSes ) |
| 12937 | { |
| 12938 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12939 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12940 | return WDI_STATUS_E_FAILURE; |
| 12941 | } |
| 12942 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12943 | wowlAddBcPtrnReq.ucPatternId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12944 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12945 | wowlAddBcPtrnReq.ucPatternByteOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12946 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternByteOffset; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12947 | wowlAddBcPtrnReq.ucPatternMaskSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12948 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12949 | wowlAddBcPtrnReq.ucPatternSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12950 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize; |
| 12951 | |
| 12952 | if (pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize <= HAL_WOWL_BCAST_PATTERN_MAX_SIZE) |
| 12953 | { |
| 12954 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 12955 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 12956 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize); |
| 12957 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 12958 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 12959 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize); |
| 12960 | } |
| 12961 | else |
| 12962 | { |
| 12963 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 12964 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 12965 | HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 12966 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 12967 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 12968 | HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 12969 | |
| 12970 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 12971 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 12972 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 12973 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 12974 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 12975 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 12976 | } |
| 12977 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12978 | wowlAddBcPtrnReq.bssIdx = pBSSSes->ucBSSIdx; |
| 12979 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12980 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12981 | &wowlAddBcPtrnReq, |
| 12982 | sizeof(wowlAddBcPtrnReq)); |
| 12983 | |
| 12984 | pWDICtx->wdiReqStatusCB = pwdiWowlAddBcPtrnParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12985 | pWDICtx->pReqStatusUserData = pwdiWowlAddBcPtrnParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12986 | |
| 12987 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12988 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12989 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12990 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12991 | wdiWowlAddBcPtrnCb, pEventData->pUserData, WDI_WOWL_ADD_BC_PTRN_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12992 | }/*WDI_ProcessWowlAddBcPtrnReq*/ |
| 12993 | |
| 12994 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12995 | @brief Process Wowl delete bc ptrn Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12996 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12997 | |
| 12998 | @param pWDICtx: pointer to the WLAN DAL context |
| 12999 | pEventData: pointer to the event information structure |
| 13000 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13001 | @see |
| 13002 | @return Result of the function call |
| 13003 | */ |
| 13004 | WDI_Status |
| 13005 | WDI_ProcessWowlDelBcPtrnReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13006 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13007 | WDI_ControlBlockType* pWDICtx, |
| 13008 | WDI_EventInfoType* pEventData |
| 13009 | ) |
| 13010 | { |
| 13011 | WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams = NULL; |
| 13012 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13013 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13014 | wpt_uint16 usDataOffset = 0; |
| 13015 | wpt_uint16 usSendSize = 0; |
| 13016 | tHalWowlDelBcastPtrn wowlDelBcPtrnReq; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13017 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 13018 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13019 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13020 | |
| 13021 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13022 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13023 | -------------------------------------------------------------------------*/ |
| 13024 | if (( NULL == pEventData ) || |
| 13025 | ( NULL == (pwdiWowlDelBcPtrnParams = (WDI_WowlDelBcPtrnReqParamsType*)pEventData->pEventData)) || |
| 13026 | ( NULL == (wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pEventData->pCBfnc))) |
| 13027 | { |
| 13028 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13029 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13030 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13031 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13032 | } |
| 13033 | |
| 13034 | /*----------------------------------------------------------------------- |
| 13035 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13036 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13037 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13038 | 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] | 13039 | sizeof(wowlDelBcPtrnReq), |
| 13040 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13041 | ( usSendSize < (usDataOffset + sizeof(wowlDelBcPtrnReq) ))) |
| 13042 | { |
| 13043 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13044 | "Unable to get send buffer in Wowl del bc ptrn req %x %x %x", |
| 13045 | pEventData, pwdiWowlDelBcPtrnParams, wdiWowlDelBcPtrnCb); |
| 13046 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13047 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13048 | } |
| 13049 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13050 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 13051 | pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.bssId, |
| 13052 | &pBSSSes); |
| 13053 | if ( NULL == pBSSSes ) |
| 13054 | { |
| 13055 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13056 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13057 | return WDI_STATUS_E_FAILURE; |
| 13058 | } |
| 13059 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13060 | wowlDelBcPtrnReq.ucPatternId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13061 | pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.ucPatternId; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13062 | |
| 13063 | wowlDelBcPtrnReq.bssIdx = pBSSSes->ucBSSIdx; |
| 13064 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13065 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13066 | &wowlDelBcPtrnReq, |
| 13067 | sizeof(wowlDelBcPtrnReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13068 | |
| 13069 | pWDICtx->wdiReqStatusCB = pwdiWowlDelBcPtrnParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13070 | pWDICtx->pReqStatusUserData = pwdiWowlDelBcPtrnParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13071 | |
| 13072 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13073 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13074 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13075 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13076 | wdiWowlDelBcPtrnCb, pEventData->pUserData, WDI_WOWL_DEL_BC_PTRN_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13077 | }/*WDI_ProcessWowlDelBcPtrnReq*/ |
| 13078 | |
| 13079 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13080 | @brief Process Wowl enter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13081 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13082 | |
| 13083 | @param pWDICtx: pointer to the WLAN DAL context |
| 13084 | pEventData: pointer to the event information structure |
| 13085 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13086 | @see |
| 13087 | @return Result of the function call |
| 13088 | */ |
| 13089 | WDI_Status |
| 13090 | WDI_ProcessWowlEnterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13091 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13092 | WDI_ControlBlockType* pWDICtx, |
| 13093 | WDI_EventInfoType* pEventData |
| 13094 | ) |
| 13095 | { |
| 13096 | WDI_WowlEnterReqParamsType* pwdiWowlEnterParams = NULL; |
| 13097 | WDI_WowlEnterReqCb wdiWowlEnterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13098 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13099 | wpt_uint16 usDataOffset = 0; |
| 13100 | wpt_uint16 usSendSize = 0; |
| 13101 | tHalWowlEnterParams wowlEnterReq; |
| 13102 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13103 | |
| 13104 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13105 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13106 | -------------------------------------------------------------------------*/ |
| 13107 | if (( NULL == pEventData ) || |
| 13108 | ( NULL == (pwdiWowlEnterParams = (WDI_WowlEnterReqParamsType*)pEventData->pEventData)) || |
| 13109 | ( NULL == (wdiWowlEnterCb = (WDI_WowlEnterReqCb)pEventData->pCBfnc))) |
| 13110 | { |
| 13111 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13112 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13113 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13114 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13115 | } |
| 13116 | |
| 13117 | /*----------------------------------------------------------------------- |
| 13118 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13119 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13120 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13121 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ENTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13122 | sizeof(wowlEnterReq), |
| 13123 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13124 | ( usSendSize < (usDataOffset + sizeof(wowlEnterReq) ))) |
| 13125 | { |
| 13126 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13127 | "Unable to get send buffer in Wowl enter req %x %x %x", |
| 13128 | pEventData, pwdiWowlEnterParams, wdiWowlEnterCb); |
| 13129 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13130 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13131 | } |
| 13132 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13133 | wowlEnterReq.ucMagicPktEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13134 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucMagicPktEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13135 | wowlEnterReq.ucPatternFilteringEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13136 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucPatternFilteringEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13137 | wowlEnterReq.ucUcastPatternFilteringEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13138 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucUcastPatternFilteringEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13139 | wowlEnterReq.ucWowChnlSwitchRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13140 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowChnlSwitchRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13141 | wowlEnterReq.ucWowDeauthRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13142 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDeauthRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13143 | wowlEnterReq.ucWowDisassocRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13144 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDisassocRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13145 | wowlEnterReq.ucWowMaxMissedBeacons = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13146 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxMissedBeacons; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13147 | wowlEnterReq.ucWowMaxSleepUsec = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13148 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxSleepUsec; |
| 13149 | |
| 13150 | #ifdef WLAN_WAKEUP_EVENTS |
| 13151 | wowlEnterReq.ucWoWEAPIDRequestEnable = |
| 13152 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPIDRequestEnable; |
| 13153 | |
| 13154 | wowlEnterReq.ucWoWEAPOL4WayEnable = |
| 13155 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPOL4WayEnable; |
| 13156 | |
| 13157 | wowlEnterReq.ucWowNetScanOffloadMatch = |
| 13158 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowNetScanOffloadMatch; |
| 13159 | |
| 13160 | wowlEnterReq.ucWowGTKRekeyError = |
| 13161 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowGTKRekeyError; |
| 13162 | |
| 13163 | wowlEnterReq.ucWoWBSSConnLoss = |
| 13164 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWBSSConnLoss; |
| 13165 | #endif // WLAN_WAKEUP_EVENTS |
| 13166 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13167 | wowlEnterReq.bssIdx = pwdiWowlEnterParams->wdiWowlEnterInfo.bssIdx; |
| 13168 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13169 | wpalMemoryCopy(wowlEnterReq.magicPtrn, |
| 13170 | pwdiWowlEnterParams->wdiWowlEnterInfo.magicPtrn, |
| 13171 | sizeof(tSirMacAddr)); |
| 13172 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13173 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13174 | &wowlEnterReq, |
| 13175 | sizeof(wowlEnterReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13176 | |
| 13177 | pWDICtx->wdiReqStatusCB = pwdiWowlEnterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13178 | pWDICtx->pReqStatusUserData = pwdiWowlEnterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13179 | |
| 13180 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13181 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13182 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13183 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13184 | wdiWowlEnterCb, pEventData->pUserData, WDI_WOWL_ENTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13185 | }/*WDI_ProcessWowlEnterReq*/ |
| 13186 | |
| 13187 | /** |
| 13188 | @brief Process Wowl exit Request function (called when Main FSM |
| 13189 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13190 | |
| 13191 | @param pWDICtx: pointer to the WLAN DAL context |
| 13192 | pEventData: pointer to the event information structure |
| 13193 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13194 | @see |
| 13195 | @return Result of the function call |
| 13196 | */ |
| 13197 | WDI_Status |
| 13198 | WDI_ProcessWowlExitReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13199 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13200 | WDI_ControlBlockType* pWDICtx, |
| 13201 | WDI_EventInfoType* pEventData |
| 13202 | ) |
| 13203 | { |
| 13204 | WDI_WowlExitReqCb wdiWowlExitCb = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13205 | WDI_WowlExitReqParamsType* pwdiWowlExitParams = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13206 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13207 | wpt_uint16 usDataOffset = 0; |
| 13208 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13209 | tHalWowlExitParams wowlExitparams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13210 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13211 | |
| 13212 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13213 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13214 | -------------------------------------------------------------------------*/ |
| 13215 | if (( NULL == pEventData ) || |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13216 | ( NULL == (pwdiWowlExitParams = (WDI_WowlExitReqParamsType *)pEventData->pEventData)) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13217 | ( NULL == (wdiWowlExitCb = (WDI_WowlExitReqCb)pEventData->pCBfnc))) |
| 13218 | { |
| 13219 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13220 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13221 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13222 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13223 | } |
| 13224 | |
| 13225 | /*----------------------------------------------------------------------- |
| 13226 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13227 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13228 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13229 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_EXIT_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13230 | sizeof(wowlExitparams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13231 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13232 | ( usSendSize < (usDataOffset + sizeof(wowlExitparams)))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13233 | { |
| 13234 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13235 | "Unable to get send buffer in Wowl Exit req %x %x", |
| 13236 | pEventData, wdiWowlExitCb); |
| 13237 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13238 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13239 | } |
| 13240 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13241 | wowlExitparams.bssIdx = pwdiWowlExitParams->wdiWowlExitInfo.bssIdx; |
| 13242 | |
| 13243 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13244 | &wowlExitparams, |
| 13245 | sizeof(wowlExitparams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13246 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13247 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13248 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13249 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13250 | wdiWowlExitCb, pEventData->pUserData, WDI_WOWL_EXIT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13251 | }/*WDI_ProcessWowlExitReq*/ |
| 13252 | |
| 13253 | /** |
| 13254 | @brief Process Configure Apps Cpu Wakeup State Request function |
| 13255 | (called when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13256 | |
| 13257 | @param pWDICtx: pointer to the WLAN DAL context |
| 13258 | pEventData: pointer to the event information structure |
| 13259 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13260 | @see |
| 13261 | @return Result of the function call |
| 13262 | */ |
| 13263 | WDI_Status |
| 13264 | WDI_ProcessConfigureAppsCpuWakeupStateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13265 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13266 | WDI_ControlBlockType* pWDICtx, |
| 13267 | WDI_EventInfoType* pEventData |
| 13268 | ) |
| 13269 | { |
| 13270 | WDI_ConfigureAppsCpuWakeupStateReqParamsType* pwdiAppsCpuWakeupStateParams = NULL; |
| 13271 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13272 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13273 | wpt_uint16 usDataOffset = 0; |
| 13274 | wpt_uint16 usSendSize = 0; |
| 13275 | tHalConfigureAppsCpuWakeupStateReqParams halCfgAppsCpuWakeupStateReqParams; |
| 13276 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13277 | |
| 13278 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13279 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13280 | -------------------------------------------------------------------------*/ |
| 13281 | if (( NULL == pEventData ) || |
| 13282 | ( NULL == (pwdiAppsCpuWakeupStateParams = (WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEventData->pEventData)) || |
| 13283 | ( NULL == (wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pEventData->pCBfnc))) |
| 13284 | { |
| 13285 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13286 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13287 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13288 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13289 | } |
| 13290 | |
| 13291 | /*----------------------------------------------------------------------- |
| 13292 | Get message buffer |
| 13293 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13294 | 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] | 13295 | sizeof(halCfgAppsCpuWakeupStateReqParams), |
| 13296 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13297 | ( usSendSize < (usDataOffset + sizeof(pwdiAppsCpuWakeupStateParams->bIsAppsAwake) ))) |
| 13298 | { |
| 13299 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13300 | "Unable to get send buffer in Apps CPU Wakeup State req %x %x %x", |
| 13301 | pEventData, pwdiAppsCpuWakeupStateParams, wdiConfigureAppsCpuWakeupStateCb); |
| 13302 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13303 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13304 | } |
| 13305 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13306 | halCfgAppsCpuWakeupStateReqParams.isAppsCpuAwake = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13307 | pwdiAppsCpuWakeupStateParams->bIsAppsAwake; |
| 13308 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13309 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13310 | &halCfgAppsCpuWakeupStateReqParams, |
| 13311 | sizeof(halCfgAppsCpuWakeupStateReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13312 | |
| 13313 | pWDICtx->wdiReqStatusCB = pwdiAppsCpuWakeupStateParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13314 | pWDICtx->pReqStatusUserData = pwdiAppsCpuWakeupStateParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13315 | |
| 13316 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13317 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13318 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13319 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13320 | wdiConfigureAppsCpuWakeupStateCb, pEventData->pUserData, |
| 13321 | WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13322 | }/*WDI_ProcessConfigureAppsCpuWakeupStateReq*/ |
| 13323 | |
| 13324 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 13325 | /** |
| 13326 | @brief Process Aggregated Add TSpec Request function (called when Main FSM |
| 13327 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13328 | |
| 13329 | @param pWDICtx: pointer to the WLAN DAL context |
| 13330 | pEventData: pointer to the event information structure |
| 13331 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13332 | @see |
| 13333 | @return Result of the function call |
| 13334 | */ |
| 13335 | WDI_Status |
| 13336 | WDI_ProcessAggrAddTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13337 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13338 | WDI_ControlBlockType* pWDICtx, |
| 13339 | WDI_EventInfoType* pEventData |
| 13340 | ) |
| 13341 | { |
| 13342 | WDI_AggrAddTSReqParamsType* pwdiAggrAddTSParams; |
| 13343 | WDI_AggrAddTsRspCb wdiAggrAddTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13344 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13345 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13346 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13347 | wpt_uint16 usDataOffset = 0; |
| 13348 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13349 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13350 | wpt_macAddr macBSSID; |
| 13351 | tAggrAddTsReq halAggrAddTsReq; |
| 13352 | int i; |
| 13353 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13354 | |
| 13355 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13356 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13357 | -------------------------------------------------------------------------*/ |
| 13358 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 13359 | ( NULL == pEventData->pCBfnc )) |
| 13360 | { |
| 13361 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13362 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13363 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13364 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13365 | } |
| 13366 | wpalMemoryFill( &halAggrAddTsReq, sizeof(tAggrAddTsReq), 0 ); |
| 13367 | pwdiAggrAddTSParams = (WDI_AggrAddTSReqParamsType*)pEventData->pEventData; |
| 13368 | wdiAggrAddTSRspCb = (WDI_AggrAddTsRspCb)pEventData->pCBfnc; |
| 13369 | /*------------------------------------------------------------------------- |
| 13370 | 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] | 13371 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13372 | -------------------------------------------------------------------------*/ |
| 13373 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 13374 | |
| 13375 | /*------------------------------------------------------------------------ |
| 13376 | Find the BSS for which the request is made and identify WDI session |
| 13377 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13378 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 13379 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13380 | &macBSSID)) |
| 13381 | { |
| 13382 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13383 | "This station does not exist in the WDI Station Table %d"); |
| 13384 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13385 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13386 | } |
| 13387 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13388 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 13389 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13390 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13391 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13392 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 13393 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13394 | |
| 13395 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13396 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13397 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13398 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13399 | /*------------------------------------------------------------------------ |
| 13400 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13401 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13402 | ------------------------------------------------------------------------*/ |
| 13403 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 13404 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13405 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13406 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 13407 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13408 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13409 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13410 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13411 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13412 | } |
| 13413 | |
| 13414 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13415 | /*----------------------------------------------------------------------- |
| 13416 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13417 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13418 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13419 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_AGGR_ADD_TS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13420 | sizeof(tAggrAddTsParams), |
| 13421 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13422 | ( usSendSize < (usDataOffset + sizeof(tAggrAddTsParams) ))) |
| 13423 | { |
| 13424 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13425 | "Unable to get send buffer in set bss key req %x %x %x", |
| 13426 | pEventData, pwdiAggrAddTSParams, wdiAggrAddTSRspCb); |
| 13427 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13428 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13429 | } |
| 13430 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13431 | halAggrAddTsReq.aggrAddTsParam.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13432 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13433 | halAggrAddTsReq.aggrAddTsParam.tspecIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13434 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucTspecIdx; |
| 13435 | |
| 13436 | for( i = 0; i < WLAN_HAL_MAX_AC; i++ ) |
| 13437 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13438 | halAggrAddTsReq.aggrAddTsParam.tspec[i].type = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13439 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13440 | halAggrAddTsReq.aggrAddTsParam.tspec[i].length = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13441 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucLength; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13442 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.ackPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13443 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13444 | ackPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13445 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.accessPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13446 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13447 | accessPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13448 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.userPrio = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13449 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13450 | userPrio; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13451 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.psb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13452 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13453 | psb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13454 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.aggregation = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13455 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13456 | aggregation; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13457 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.direction = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13458 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13459 | direction; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13460 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13461 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13462 | trafficType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13463 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13464 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13465 | trafficType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13466 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.rsvd = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13467 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.rsvd; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13468 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.schedule = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13469 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.schedule; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13470 | |
| 13471 | |
| 13472 | halAggrAddTsReq.aggrAddTsParam.tspec[i].nomMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13473 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usNomMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13474 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13475 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMaxMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13476 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13477 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13478 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13479 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13480 | halAggrAddTsReq.aggrAddTsParam.tspec[i].inactInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13481 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uInactInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13482 | halAggrAddTsReq.aggrAddTsParam.tspec[i].suspendInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13483 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSuspendInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13484 | halAggrAddTsReq.aggrAddTsParam.tspec[i].svcStartTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13485 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSvcStartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13486 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13487 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13488 | halAggrAddTsReq.aggrAddTsParam.tspec[i].meanDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13489 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMeanDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13490 | halAggrAddTsReq.aggrAddTsParam.tspec[i].peakDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13491 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uPeakDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13492 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxBurstSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13493 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxBurstSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13494 | halAggrAddTsReq.aggrAddTsParam.tspec[i].delayBound = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13495 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uDelayBound; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13496 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minPhyRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13497 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinPhyRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13498 | halAggrAddTsReq.aggrAddTsParam.tspec[i].surplusBw = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13499 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usSurplusBw; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13500 | halAggrAddTsReq.aggrAddTsParam.tspec[i].mediumTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13501 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMediumTime; |
| 13502 | } |
| 13503 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13504 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13505 | &halAggrAddTsReq, |
| 13506 | sizeof(halAggrAddTsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13507 | |
| 13508 | pWDICtx->wdiReqStatusCB = pwdiAggrAddTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13509 | pWDICtx->pReqStatusUserData = pwdiAggrAddTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13510 | |
| 13511 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13512 | Send Add TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13513 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13514 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13515 | wdiAggrAddTSRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13516 | WDI_AGGR_ADD_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13517 | }/*WDI_ProcessAggrAddTSpecReq*/ |
| 13518 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 13519 | |
| 13520 | /** |
| 13521 | @brief Process Shutdown Request function (called when Main FSM |
| 13522 | allows it) |
| 13523 | |
| 13524 | @param pWDICtx: pointer to the WLAN DAL context |
| 13525 | pEventData: pointer to the event information structure |
| 13526 | |
| 13527 | @see |
| 13528 | @return Result of the function call |
| 13529 | */ |
| 13530 | WDI_Status |
| 13531 | WDI_ProcessShutdownReq |
| 13532 | ( |
| 13533 | WDI_ControlBlockType* pWDICtx, |
| 13534 | WDI_EventInfoType* pEventData |
| 13535 | ) |
| 13536 | { |
| 13537 | wpt_status wptStatus; |
| 13538 | |
| 13539 | |
| 13540 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13541 | |
| 13542 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13543 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13544 | -------------------------------------------------------------------------*/ |
| 13545 | if ( NULL == pEventData ) |
| 13546 | { |
| 13547 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13548 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13549 | WDI_ASSERT(0); |
| 13550 | return WDI_STATUS_E_FAILURE; |
| 13551 | } |
| 13552 | |
| 13553 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 13554 | |
| 13555 | |
| 13556 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 13557 | /*! TO DO: stop the data services */ |
| 13558 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 13559 | { |
| 13560 | /*Stop the STA Table !UT- check this logic again |
| 13561 | It is safer to do it here than on the response - because a stop is imminent*/ |
| 13562 | WDI_STATableStop(pWDICtx); |
| 13563 | |
| 13564 | /* Stop Transport Driver, DXE */ |
| 13565 | WDTS_Stop(pWDICtx); |
| 13566 | } |
| 13567 | |
| 13568 | /*Clear all pending request*/ |
| 13569 | WDI_ClearPendingRequests(pWDICtx); |
| 13570 | /* Close Data transport*/ |
| 13571 | /* FTM mode does not open Data Path */ |
| 13572 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 13573 | { |
| 13574 | WDTS_Close(pWDICtx); |
| 13575 | } |
| 13576 | /*Close the STA Table !UT- check this logic again*/ |
| 13577 | WDI_STATableClose(pWDICtx); |
| 13578 | /*close the PAL */ |
| 13579 | wptStatus = wpalClose(pWDICtx->pPALContext); |
| 13580 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 13581 | { |
| 13582 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13583 | "Failed to wpal Close %d", wptStatus); |
| 13584 | WDI_ASSERT(0); |
| 13585 | } |
| 13586 | |
| 13587 | /*Transition back to init state*/ |
| 13588 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
| 13589 | |
| 13590 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13591 | |
| 13592 | /*Make sure the expected state is properly defaulted to Init*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13593 | pWDICtx->ucExpectedStateTransition = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13594 | |
| 13595 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13596 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13597 | }/*WDI_ProcessShutdownReq*/ |
| 13598 | |
| 13599 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13600 | Main DAL Control Path Response Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13601 | ========================================================================*/ |
| 13602 | |
| 13603 | /** |
| 13604 | @brief Process Start Response function (called when a response |
| 13605 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13606 | |
| 13607 | @param pWDICtx: pointer to the WLAN DAL context |
| 13608 | pEventData: pointer to the event information structure |
| 13609 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13610 | @see |
| 13611 | @return Result of the function call |
| 13612 | */ |
| 13613 | WDI_Status |
| 13614 | WDI_ProcessStartRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13615 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13616 | WDI_ControlBlockType* pWDICtx, |
| 13617 | WDI_EventInfoType* pEventData |
| 13618 | ) |
| 13619 | { |
| 13620 | WDI_StartRspParamsType wdiRspParams; |
| 13621 | WDI_StartRspCb wdiStartRspCb = NULL; |
| 13622 | |
| 13623 | tHalMacStartRspParams* startRspParams; |
| 13624 | |
| 13625 | #ifndef HAL_SELF_STA_PER_BSS |
| 13626 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 13627 | #endif |
| 13628 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13629 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13630 | wdiStartRspCb = (WDI_StartRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13631 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13632 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13633 | -------------------------------------------------------------------------*/ |
| 13634 | if (( NULL == pEventData ) || |
| 13635 | ( NULL == pEventData->pEventData) || |
| 13636 | ( NULL == wdiStartRspCb )) |
| 13637 | { |
| 13638 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13639 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13640 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13641 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13642 | } |
| 13643 | |
| 13644 | /*------------------------------------------------------------------------- |
| 13645 | Extract response and send it to UMAC |
| 13646 | -------------------------------------------------------------------------*/ |
| 13647 | if ( sizeof(tHalMacStartRspParams) > pEventData->uEventDataSize ) |
| 13648 | { |
| 13649 | // not enough data was received |
| 13650 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 13651 | "Invalid response length in Start Resp Expect %x Rcvd %x", |
| 13652 | sizeof(tHalMacStartRspParams), pEventData->uEventDataSize); |
| 13653 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13654 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13655 | } |
| 13656 | |
| 13657 | /*------------------------------------------------------------------------- |
| 13658 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13659 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13660 | -------------------------------------------------------------------------*/ |
| 13661 | startRspParams = (tHalMacStartRspParams *) pEventData->pEventData; |
| 13662 | |
| 13663 | wdiRspParams.ucMaxBssids = startRspParams->ucMaxBssids; |
| 13664 | wdiRspParams.ucMaxStations = startRspParams->ucMaxStations; |
| 13665 | wdiRspParams.wlanCompiledVersion.major = WLAN_HAL_VER_MAJOR; |
| 13666 | wdiRspParams.wlanCompiledVersion.minor = WLAN_HAL_VER_MINOR; |
| 13667 | wdiRspParams.wlanCompiledVersion.version = WLAN_HAL_VER_VERSION; |
| 13668 | wdiRspParams.wlanCompiledVersion.revision = WLAN_HAL_VER_REVISION; |
| 13669 | wdiRspParams.wlanReportedVersion.major = |
| 13670 | startRspParams->wcnssWlanVersion.major; |
| 13671 | wdiRspParams.wlanReportedVersion.minor = |
| 13672 | startRspParams->wcnssWlanVersion.minor; |
| 13673 | wdiRspParams.wlanReportedVersion.version = |
| 13674 | startRspParams->wcnssWlanVersion.version; |
| 13675 | wdiRspParams.wlanReportedVersion.revision = |
| 13676 | startRspParams->wcnssWlanVersion.revision; |
| 13677 | wpalMemoryCopy(wdiRspParams.wcnssSoftwareVersion, |
| 13678 | startRspParams->wcnssCrmVersionString, |
| 13679 | sizeof(wdiRspParams.wcnssSoftwareVersion)); |
| 13680 | wpalMemoryCopy(wdiRspParams.wcnssHardwareVersion, |
| 13681 | startRspParams->wcnssWlanVersionString, |
| 13682 | sizeof(wdiRspParams.wcnssHardwareVersion)); |
| 13683 | wdiRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(startRspParams->status); |
| 13684 | |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 13685 | /*Save the HAL Version*/ |
| 13686 | pWDICtx->wlanVersion = wdiRspParams.wlanReportedVersion; |
| 13687 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13688 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 13689 | if ( WDI_STATUS_SUCCESS == wdiRspParams.wdiStatus ) |
| 13690 | { |
| 13691 | pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST; |
| 13692 | |
| 13693 | /*Cache the start response for further use*/ |
| 13694 | wpalMemoryCopy( &pWDICtx->wdiCachedStartRspParams , |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13695 | &wdiRspParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13696 | sizeof(pWDICtx->wdiCachedStartRspParams)); |
| 13697 | |
| 13698 | } |
| 13699 | else |
| 13700 | { |
| 13701 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13702 | "Failed to start device with status %s(%d)", |
| 13703 | WDI_getHALStatusMsgString(startRspParams->status), |
| 13704 | startRspParams->status); |
| 13705 | |
| 13706 | /*Set the expected state transition to stopped - because the start has |
| 13707 | failed*/ |
| 13708 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 13709 | |
| 13710 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13711 | |
| 13712 | /*Notify UMAC*/ |
| 13713 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13714 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13715 | WDI_DetectedDeviceError(pWDICtx, wdiRspParams.wdiStatus); |
| 13716 | |
| 13717 | /*Although the response is an error - it was processed by our function |
| 13718 | so as far as the caller is concerned this is a succesful reponse processing*/ |
| 13719 | return WDI_STATUS_SUCCESS; |
| 13720 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13721 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13722 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13723 | |
| 13724 | if(eDRIVER_TYPE_MFG == pWDICtx->driverMode) |
| 13725 | { |
| 13726 | /* FTM mode does not need to execute below */ |
| 13727 | /* Notify UMAC */ |
| 13728 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
| 13729 | return WDI_STATUS_SUCCESS; |
| 13730 | } |
| 13731 | |
| 13732 | /* START the Data transport */ |
| 13733 | WDTS_startTransport(pWDICtx); |
| 13734 | |
| 13735 | /*Start the STA Table !- check this logic again*/ |
| 13736 | WDI_STATableStart(pWDICtx); |
| 13737 | |
| 13738 | #ifndef HAL_SELF_STA_PER_BSS |
| 13739 | /* Store the Self STA Index */ |
| 13740 | pWDICtx->ucSelfStaId = halStartRspMsg.startRspParams.selfStaIdx; |
| 13741 | |
| 13742 | pWDICtx->usSelfStaDpuId = wdiRspParams.usSelfStaDpuId; |
| 13743 | wpalMemoryCopy(pWDICtx->macSelfSta, wdiRspParams.macSelfSta, |
| 13744 | WDI_MAC_ADDR_LEN); |
| 13745 | |
| 13746 | /* At this point add the self-STA */ |
| 13747 | |
| 13748 | /*! TO DO: wdiAddSTAParam.bcastMgmtDpuSignature */ |
| 13749 | /* !TO DO: wdiAddSTAParam.bcastDpuSignature */ |
| 13750 | /*! TO DO: wdiAddSTAParam.dpuSig */ |
| 13751 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 13752 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 13753 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 13754 | |
| 13755 | //all DPU indices are the same for self STA |
| 13756 | wdiAddSTAParam.bcastDpuIndex = wdiRspParams.usSelfStaDpuId; |
| 13757 | wdiAddSTAParam.bcastMgmtDpuIndex = wdiRspParams.usSelfStaDpuId; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 13758 | wdiAddSTAParam.dpuIndex = wdiRspParams.usSelfStaDpuId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13759 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiRspParams.macSelfSta, |
| 13760 | WDI_MAC_ADDR_LEN); |
| 13761 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */ |
| 13762 | wdiAddSTAParam.ucSTAIdx = halStartRspMsg.startRspParams.selfStaIdx; |
| 13763 | |
| 13764 | /* Note: Since we don't get an explicit config STA request for self STA, we |
| 13765 | add the self STA upon receiving the Start response message. But the |
| 13766 | self STA entry in the table is deleted when WDI gets an explicit delete STA |
| 13767 | request */ |
| 13768 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 13769 | #endif |
| 13770 | |
| 13771 | /*Notify UMAC*/ |
| 13772 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
| 13773 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13774 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13775 | }/*WDI_ProcessStartRsp*/ |
| 13776 | |
| 13777 | |
| 13778 | /** |
| 13779 | @brief Process Stop Response function (called when a response |
| 13780 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13781 | |
| 13782 | @param pWDICtx: pointer to the WLAN DAL context |
| 13783 | pEventData: pointer to the event information structure |
| 13784 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13785 | @see |
| 13786 | @return Result of the function call |
| 13787 | */ |
| 13788 | WDI_Status |
| 13789 | WDI_ProcessStopRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13790 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13791 | WDI_ControlBlockType* pWDICtx, |
| 13792 | WDI_EventInfoType* pEventData |
| 13793 | ) |
| 13794 | { |
| 13795 | WDI_Status wdiStatus; |
| 13796 | WDI_StopRspCb wdiStopRspCb = NULL; |
| 13797 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13798 | tHalMacStopRspMsg halMacStopRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13799 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13800 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13801 | wdiStopRspCb = (WDI_StopRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13802 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13803 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13804 | -------------------------------------------------------------------------*/ |
| 13805 | if (( NULL == pEventData ) || |
| 13806 | ( NULL == pEventData->pEventData) || |
| 13807 | ( NULL == wdiStopRspCb )) |
| 13808 | { |
| 13809 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13810 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13811 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13812 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13813 | } |
| 13814 | |
| 13815 | /*------------------------------------------------------------------------- |
| 13816 | Extract response and send it to UMAC |
| 13817 | -------------------------------------------------------------------------*/ |
| 13818 | if ( sizeof(halMacStopRspMsg) < pEventData->uEventDataSize ) |
| 13819 | { |
| 13820 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13821 | "Invalid response length in Stop Resp %x %x", |
| 13822 | pEventData->uEventDataSize); |
| 13823 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13824 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13825 | } |
| 13826 | |
| 13827 | /*------------------------------------------------------------------------- |
| 13828 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13829 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13830 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13831 | wpalMemoryCopy( &halMacStopRspMsg.stopRspParams, |
| 13832 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13833 | sizeof(halMacStopRspMsg.stopRspParams)); |
| 13834 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13835 | wdiStatus = WDI_HAL_2_WDI_STATUS(halMacStopRspMsg.stopRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13836 | |
| 13837 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 13838 | |
| 13839 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13840 | Check to see if the stop went OK |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13841 | --------------------------------------------------------------------------*/ |
| 13842 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 13843 | { |
| 13844 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13845 | "Failed to stop the device with status %s (%d)", |
| 13846 | WDI_getHALStatusMsgString(halMacStopRspMsg.stopRspParams.status), |
| 13847 | halMacStopRspMsg.stopRspParams.status); |
| 13848 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13849 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 13850 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13851 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13852 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13853 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13854 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13855 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 13856 | |
| 13857 | /*Transition now as WDI may get preempted imediately after it sends |
| 13858 | up the Stop Response and it will not get to process the state transition |
| 13859 | from Main Rsp function*/ |
| 13860 | WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition); |
| 13861 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13862 | |
| 13863 | /*! TO DO: - STOP the Data transport */ |
| 13864 | |
| 13865 | /*Notify UMAC*/ |
| 13866 | wdiStopRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 13867 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13868 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13869 | }/*WDI_ProcessStopRsp*/ |
| 13870 | |
| 13871 | /** |
| 13872 | @brief Process Close Rsp function (called when a response |
| 13873 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13874 | |
| 13875 | @param pWDICtx: pointer to the WLAN DAL context |
| 13876 | pEventData: pointer to the event information structure |
| 13877 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13878 | @see |
| 13879 | @return Result of the function call |
| 13880 | */ |
| 13881 | WDI_Status |
| 13882 | WDI_ProcessCloseRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13883 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13884 | WDI_ControlBlockType* pWDICtx, |
| 13885 | WDI_EventInfoType* pEventData |
| 13886 | ) |
| 13887 | { |
| 13888 | /*There is no close response comming from HAL - function just kept for |
| 13889 | simmetry */ |
| 13890 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13891 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13892 | }/*WDI_ProcessCloseRsp*/ |
| 13893 | |
| 13894 | |
| 13895 | /*============================================================================ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13896 | SCAN RESPONSE PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13897 | ============================================================================*/ |
| 13898 | |
| 13899 | /** |
| 13900 | @brief Process Init Scan Rsp function (called when a response |
| 13901 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13902 | |
| 13903 | @param pWDICtx: pointer to the WLAN DAL context |
| 13904 | pEventData: pointer to the event information structure |
| 13905 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13906 | @see |
| 13907 | @return Result of the function call |
| 13908 | */ |
| 13909 | WDI_Status |
| 13910 | WDI_ProcessInitScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13911 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13912 | WDI_ControlBlockType* pWDICtx, |
| 13913 | WDI_EventInfoType* pEventData |
| 13914 | ) |
| 13915 | { |
| 13916 | WDI_Status wdiStatus; |
| 13917 | WDI_InitScanRspCb wdiInitScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13918 | tHalInitScanRspMsg halInitScanRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13919 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13920 | |
| 13921 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13922 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13923 | -------------------------------------------------------------------------*/ |
| 13924 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 13925 | ( NULL == pEventData->pEventData)) |
| 13926 | { |
| 13927 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13928 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13929 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13930 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13931 | } |
| 13932 | |
| 13933 | wdiInitScanRspCb = (WDI_InitScanRspCb)pWDICtx->pfncRspCB; |
| 13934 | if( NULL == wdiInitScanRspCb) |
| 13935 | { |
| 13936 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13937 | "%s: call back function is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13938 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13939 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13940 | } |
| 13941 | |
| 13942 | /*------------------------------------------------------------------------- |
| 13943 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13944 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13945 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13946 | wpalMemoryCopy( &halInitScanRspMsg.initScanRspParams, |
| 13947 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13948 | sizeof(halInitScanRspMsg.initScanRspParams)); |
| 13949 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13950 | wdiStatus = WDI_HAL_2_WDI_STATUS(halInitScanRspMsg.initScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13951 | |
| 13952 | if ( pWDICtx->bInBmps ) |
| 13953 | { |
| 13954 | // notify DTS that we are entering Full power |
| 13955 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 13956 | } |
| 13957 | |
| 13958 | /*Notify UMAC*/ |
| 13959 | wdiInitScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 13960 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13961 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13962 | }/*WDI_ProcessInitScanRsp*/ |
| 13963 | |
| 13964 | |
| 13965 | /** |
| 13966 | @brief Process Start Scan Rsp function (called when a response |
| 13967 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13968 | |
| 13969 | @param pWDICtx: pointer to the WLAN DAL context |
| 13970 | pEventData: pointer to the event information structure |
| 13971 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13972 | @see |
| 13973 | @return Result of the function call |
| 13974 | */ |
| 13975 | WDI_Status |
| 13976 | WDI_ProcessStartScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13977 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13978 | WDI_ControlBlockType* pWDICtx, |
| 13979 | WDI_EventInfoType* pEventData |
| 13980 | ) |
| 13981 | { |
| 13982 | WDI_StartScanRspParamsType wdiStartScanParams; |
| 13983 | WDI_StartScanRspCb wdiStartScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13984 | |
| 13985 | tHalStartScanRspMsg halStartScanRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13986 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13987 | |
| 13988 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13989 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13990 | -------------------------------------------------------------------------*/ |
| 13991 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 13992 | ( NULL == pEventData->pEventData)) |
| 13993 | { |
| 13994 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13995 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13996 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13997 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13998 | } |
| 13999 | |
| 14000 | wdiStartScanRspCb = (WDI_StartScanRspCb)pWDICtx->pfncRspCB; |
| 14001 | if( NULL == wdiStartScanRspCb) |
| 14002 | { |
| 14003 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14004 | "%s: call back function is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14005 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14006 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14007 | } |
| 14008 | |
| 14009 | /*------------------------------------------------------------------------- |
| 14010 | Extract response and send it to UMAC |
| 14011 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14012 | wpalMemoryCopy( &halStartScanRspMsg.startScanRspParams, |
| 14013 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14014 | sizeof(halStartScanRspMsg.startScanRspParams)); |
| 14015 | |
| 14016 | wdiStartScanParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 14017 | halStartScanRspMsg.startScanRspParams.status); |
| 14018 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14019 | wdiStartScanParams.ucTxMgmtPower = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14020 | halStartScanRspMsg.startScanRspParams.txMgmtPower; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14021 | wpalMemoryCopy( wdiStartScanParams.aStartTSF, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14022 | halStartScanRspMsg.startScanRspParams.startTSF, |
| 14023 | 2); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14024 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14025 | |
| 14026 | if ( eHAL_STATUS_SUCCESS != halStartScanRspMsg.startScanRspParams.status ) |
| 14027 | { |
| 14028 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14029 | "Start scan failed with status %s (%d)", |
| 14030 | WDI_getHALStatusMsgString(halStartScanRspMsg.startScanRspParams.status), |
| 14031 | halStartScanRspMsg.startScanRspParams.status); |
| 14032 | /* send the status to UMAC, don't return from here*/ |
| 14033 | } |
| 14034 | |
| 14035 | /*Notify UMAC*/ |
| 14036 | wdiStartScanRspCb( &wdiStartScanParams, pWDICtx->pRspCBUserData); |
| 14037 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14038 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14039 | |
| 14040 | }/*WDI_ProcessStartScanRsp*/ |
| 14041 | |
| 14042 | |
| 14043 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14044 | @brief Process End Scan Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14045 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14046 | |
| 14047 | @param pWDICtx: pointer to the WLAN DAL context |
| 14048 | pEventData: pointer to the event information structure |
| 14049 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14050 | @see |
| 14051 | @return Result of the function call |
| 14052 | */ |
| 14053 | WDI_Status |
| 14054 | WDI_ProcessEndScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14055 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14056 | WDI_ControlBlockType* pWDICtx, |
| 14057 | WDI_EventInfoType* pEventData |
| 14058 | ) |
| 14059 | { |
| 14060 | WDI_Status wdiStatus; |
| 14061 | tHalEndScanRspMsg halEndScanRspMsg; |
| 14062 | WDI_EndScanRspCb wdiEndScanRspCb; |
| 14063 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14064 | |
| 14065 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14066 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14067 | -------------------------------------------------------------------------*/ |
| 14068 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14069 | ( NULL == pEventData->pEventData)) |
| 14070 | { |
| 14071 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14072 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14073 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14074 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14075 | } |
| 14076 | |
| 14077 | wdiEndScanRspCb = (WDI_EndScanRspCb)pWDICtx->pfncRspCB; |
| 14078 | |
| 14079 | /*------------------------------------------------------------------------- |
| 14080 | Extract response and send it to UMAC |
| 14081 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14082 | wpalMemoryCopy( &halEndScanRspMsg.endScanRspParams, |
| 14083 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14084 | sizeof(halEndScanRspMsg.endScanRspParams)); |
| 14085 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14086 | wdiStatus = WDI_HAL_2_WDI_STATUS(halEndScanRspMsg.endScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14087 | |
| 14088 | if ( eHAL_STATUS_SUCCESS != halEndScanRspMsg.endScanRspParams.status ) |
| 14089 | { |
| 14090 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14091 | "End Scan failed with status %s (%d )", |
| 14092 | WDI_getHALStatusMsgString(halEndScanRspMsg.endScanRspParams.status), |
| 14093 | halEndScanRspMsg.endScanRspParams.status); |
| 14094 | /* send the status to UMAC, don't return from here*/ |
| 14095 | } |
| 14096 | |
| 14097 | /*Notify UMAC*/ |
| 14098 | wdiEndScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14099 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14100 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14101 | }/*WDI_ProcessEndScanRsp*/ |
| 14102 | |
| 14103 | |
| 14104 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14105 | @brief Process Finish Scan Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14106 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14107 | |
| 14108 | @param pWDICtx: pointer to the WLAN DAL context |
| 14109 | pEventData: pointer to the event information structure |
| 14110 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14111 | @see |
| 14112 | @return Result of the function call |
| 14113 | */ |
| 14114 | WDI_Status |
| 14115 | WDI_ProcessFinishScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14116 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14117 | WDI_ControlBlockType* pWDICtx, |
| 14118 | WDI_EventInfoType* pEventData |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14119 | ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14120 | { |
| 14121 | WDI_Status wdiStatus; |
| 14122 | WDI_FinishScanRspCb wdiFinishScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14123 | |
| 14124 | tHalFinishScanRspMsg halFinishScanRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14125 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14126 | |
| 14127 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14128 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14129 | -------------------------------------------------------------------------*/ |
| 14130 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14131 | ( NULL == pEventData->pEventData)) |
| 14132 | { |
| 14133 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14134 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14135 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14136 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14137 | } |
| 14138 | |
| 14139 | wdiFinishScanRspCb = (WDI_FinishScanRspCb)pWDICtx->pfncRspCB; |
| 14140 | |
| 14141 | /*------------------------------------------------------------------------- |
| 14142 | Extract response and send it to UMAC |
| 14143 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14144 | wpalMemoryCopy( (void *)&halFinishScanRspMsg.finishScanRspParams.status, |
| 14145 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14146 | sizeof(halFinishScanRspMsg.finishScanRspParams.status)); |
| 14147 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14148 | wdiStatus = WDI_HAL_2_WDI_STATUS(halFinishScanRspMsg.finishScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14149 | |
| 14150 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14151 | "Finish scan response reported status: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14152 | halFinishScanRspMsg.finishScanRspParams.status); |
| 14153 | |
| 14154 | if (( eHAL_STATUS_SUCCESS != halFinishScanRspMsg.finishScanRspParams.status )&& |
| 14155 | ( eHAL_STATUS_NOTIFY_BSS_FAIL != halFinishScanRspMsg.finishScanRspParams.status )) |
| 14156 | { |
| 14157 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14158 | "Finish Scan failed with status %s (%d)", |
| 14159 | WDI_getHALStatusMsgString(halFinishScanRspMsg.finishScanRspParams.status), |
| 14160 | halFinishScanRspMsg.finishScanRspParams.status); |
| 14161 | /* send the status to UMAC, don't return from here*/ |
| 14162 | } |
| 14163 | |
| 14164 | /*Notify UMAC*/ |
| 14165 | wdiFinishScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14166 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14167 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14168 | }/*WDI_ProcessFinishScanRsp*/ |
| 14169 | |
| 14170 | /** |
| 14171 | @brief Process Join Response function (called when a response |
| 14172 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14173 | |
| 14174 | @param pWDICtx: pointer to the WLAN DAL context |
| 14175 | pEventData: pointer to the event information structure |
| 14176 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14177 | @see |
| 14178 | @return Result of the function call |
| 14179 | */ |
| 14180 | WDI_Status |
| 14181 | WDI_ProcessJoinRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14182 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14183 | WDI_ControlBlockType* pWDICtx, |
| 14184 | WDI_EventInfoType* pEventData |
| 14185 | ) |
| 14186 | { |
| 14187 | WDI_Status wdiStatus; |
| 14188 | WDI_JoinRspCb wdiJoinRspCb; |
| 14189 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14190 | |
| 14191 | tHalJoinRspMsg halJoinRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14192 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14193 | |
| 14194 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14195 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14196 | -------------------------------------------------------------------------*/ |
| 14197 | if (( NULL == pWDICtx ) || |
| 14198 | ( NULL == pWDICtx->pfncRspCB ) || |
| 14199 | ( NULL == pEventData ) || |
| 14200 | ( NULL == pEventData->pEventData)) |
| 14201 | { |
| 14202 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14203 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14204 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14205 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14206 | } |
| 14207 | |
| 14208 | wdiJoinRspCb = (WDI_JoinRspCb)pWDICtx->pfncRspCB; |
| 14209 | |
| 14210 | /*------------------------------------------------------------------------- |
| 14211 | Extract response and send it to UMAC |
| 14212 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14213 | wpalMemoryCopy( &halJoinRspMsg.joinRspParams, |
| 14214 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14215 | sizeof(halJoinRspMsg.joinRspParams)); |
| 14216 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14217 | wdiStatus = WDI_HAL_2_WDI_STATUS(halJoinRspMsg.joinRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14218 | |
| 14219 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14220 | |
| 14221 | /*----------------------------------------------------------------------- |
| 14222 | Join response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14223 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14224 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14225 | if (( !WDI_VALID_SESSION_IDX(pWDICtx->ucCurrentBSSSesIdx )) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14226 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 14227 | { |
| 14228 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14229 | "%s: Association sequence for this BSS does not yet exist (bssIdx %d) or " |
| 14230 | "association no longer in progress %d - mysterious HAL response", |
| 14231 | __func__, pWDICtx->ucCurrentBSSSesIdx, pWDICtx->bAssociationInProgress); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14232 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14233 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14234 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14235 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14236 | } |
| 14237 | |
| 14238 | pBSSSes = &pWDICtx->aBSSSessions[pWDICtx->ucCurrentBSSSesIdx]; |
| 14239 | |
| 14240 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14241 | Join Response is only allowed in init state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14242 | -----------------------------------------------------------------------*/ |
| 14243 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 14244 | { |
| 14245 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14246 | "Join only allowed in Joining state - failure state is %d " |
| 14247 | "strange HAL response", pBSSSes->wdiAssocState); |
| 14248 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14249 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14250 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14251 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14252 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14253 | } |
| 14254 | |
| 14255 | |
| 14256 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14257 | If assoc has failed the current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14258 | -----------------------------------------------------------------------*/ |
| 14259 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 14260 | { |
| 14261 | /*Association was failed by HAL - remove session*/ |
| 14262 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 14263 | |
| 14264 | /*Association no longer in progress */ |
| 14265 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 14266 | |
| 14267 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 14268 | WDI_DequeueAssocRequest(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14269 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14270 | } |
| 14271 | else |
| 14272 | { |
| 14273 | /*Transition to state Joining - this may be redundant as we are supposed |
| 14274 | to be in this state already - but just to be safe*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14275 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14276 | } |
| 14277 | |
| 14278 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14279 | |
| 14280 | /*Notify UMAC*/ |
| 14281 | wdiJoinRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14282 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14283 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14284 | }/*WDI_ProcessJoinRsp*/ |
| 14285 | |
| 14286 | |
| 14287 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14288 | @brief Process Config BSS Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14289 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14290 | |
| 14291 | @param pWDICtx: pointer to the WLAN DAL context |
| 14292 | pEventData: pointer to the event information structure |
| 14293 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14294 | @see |
| 14295 | @return Result of the function call |
| 14296 | */ |
| 14297 | WDI_Status |
| 14298 | WDI_ProcessConfigBSSRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14299 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14300 | WDI_ControlBlockType* pWDICtx, |
| 14301 | WDI_EventInfoType* pEventData |
| 14302 | ) |
| 14303 | { |
| 14304 | WDI_ConfigBSSRspParamsType wdiConfigBSSParams; |
| 14305 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14306 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14307 | WDI_BSSSessionType* pBSSSes = NULL; |
| 14308 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14309 | tConfigBssRspMsg halConfigBssRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14310 | WDI_AddStaParams wdiBcastAddSTAParam = {0}; |
| 14311 | WDI_AddStaParams wdiAddSTAParam = {0}; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14312 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14313 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14314 | |
| 14315 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14316 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14317 | -------------------------------------------------------------------------*/ |
| 14318 | if (( NULL == pEventData ) || |
| 14319 | ( NULL == pEventData->pEventData)) |
| 14320 | { |
| 14321 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14322 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14323 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14324 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14325 | } |
| 14326 | |
| 14327 | wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pWDICtx->pfncRspCB; |
| 14328 | |
| 14329 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14330 | Extract response and send it to UMAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14331 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14332 | wpalMemoryCopy( &halConfigBssRspMsg.configBssRspParams, |
| 14333 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14334 | sizeof(halConfigBssRspMsg.configBssRspParams)); |
| 14335 | |
| 14336 | wdiConfigBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 14337 | halConfigBssRspMsg.configBssRspParams.status); |
| 14338 | if(WDI_STATUS_SUCCESS == wdiConfigBSSParams.wdiStatus) |
| 14339 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14340 | wpalMemoryCopy( wdiConfigBSSParams.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14341 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.macBSSID, |
| 14342 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14343 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14344 | wdiConfigBSSParams.ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14345 | |
| 14346 | wdiConfigBSSParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14347 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14348 | |
| 14349 | wdiConfigBSSParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14350 | halConfigBssRspMsg.configBssRspParams.ucastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14351 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14352 | wdiConfigBSSParams.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14353 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14354 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14355 | wdiConfigBSSParams.ucTxMgmtPower = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14356 | halConfigBssRspMsg.configBssRspParams.txMgmtPower; |
| 14357 | #endif |
| 14358 | wpalMemoryCopy( wdiConfigBSSParams.macSTA, |
| 14359 | halConfigBssRspMsg.configBssRspParams.staMac, |
| 14360 | WDI_MAC_ADDR_LEN ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14361 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14362 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14363 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14364 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14365 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14366 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 14367 | wdiConfigBSSParams.macBSSID, |
| 14368 | &pBSSSes); |
| 14369 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14370 | /*----------------------------------------------------------------------- |
| 14371 | Config BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14372 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14373 | -----------------------------------------------------------------------*/ |
| 14374 | if ( NULL == pBSSSes ) |
| 14375 | { |
| 14376 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14377 | "Association sequence for this BSS does not yet exist " |
| 14378 | "- mysterious HAL response"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14379 | |
| 14380 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14381 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14382 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14383 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14384 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14385 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14386 | /*Save data for this BSS*/ |
| 14387 | pBSSSes->wdiBssType = pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiBSSType; |
| 14388 | pBSSSes->ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14389 | pBSSSes->bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14390 | halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14391 | pBSSSes->bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14392 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14393 | pBSSSes->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 | pBSSSes->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 | pBSSSes->ucRmfEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14398 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled; |
| 14399 | pBSSSes->bcastStaIdx = |
| 14400 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14401 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14402 | /* !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] | 14403 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14404 | /*------------------------------------------------------------------------- |
| 14405 | Add Peer STA |
| 14406 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14407 | wdiAddSTAParam.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14408 | wdiAddSTAParam.dpuIndex = halConfigBssRspMsg.configBssRspParams.dpuDescIndx; |
| 14409 | wdiAddSTAParam.dpuSig = halConfigBssRspMsg.configBssRspParams.ucastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14410 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14411 | /*This info can be retrieved from the cached initial request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14412 | wdiAddSTAParam.ucWmmEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14413 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucWMMEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14414 | wdiAddSTAParam.ucHTCapable = |
| 14415 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucHTCapable; |
| 14416 | wdiAddSTAParam.ucStaType = |
| 14417 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.wdiSTAType; |
| 14418 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14419 | /* MAC Address of STA */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14420 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, |
| 14421 | halConfigBssRspMsg.configBssRspParams.staMac, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14422 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14423 | |
| 14424 | wpalMemoryCopy(wdiAddSTAParam.macBSSID, |
| 14425 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.macBSSID , |
| 14426 | WDI_MAC_ADDR_LEN); |
| 14427 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14428 | /*Add BSS specific parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14429 | wdiAddSTAParam.bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14430 | halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14431 | wdiAddSTAParam.bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14432 | halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14433 | wdiAddSTAParam.bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14434 | halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14435 | wdiAddSTAParam.bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14436 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14437 | wdiAddSTAParam.ucRmfEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14438 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14439 | wdiAddSTAParam.ucBSSIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14440 | halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14441 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14442 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 14443 | "Add STA to the table index: %d", wdiAddSTAParam.ucSTAIdx ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14444 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14445 | WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 14446 | /*------------------------------------------------------------------------- |
| 14447 | Add Broadcast STA only in AP mode |
| 14448 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14449 | if( pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucOperMode == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14450 | WDI_BSS_OPERATIONAL_MODE_AP ) |
| 14451 | { |
| 14452 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 14453 | "Add BCAST STA to table for index: %d", |
| 14454 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14455 | |
| 14456 | wpalMemoryCopy( &wdiBcastAddSTAParam, &wdiAddSTAParam, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14457 | sizeof(WDI_AddStaParams) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14458 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14459 | WDI_AddBcastSTAtoSTATable( pWDICtx, &wdiBcastAddSTAParam, |
| 14460 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx ); |
| 14461 | } |
| 14462 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14463 | } |
| 14464 | else |
| 14465 | { |
| 14466 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14467 | "Config BSS RSP failed with status : %s(%d)", |
| 14468 | WDI_getHALStatusMsgString( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14469 | halConfigBssRspMsg.configBssRspParams.status), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14470 | halConfigBssRspMsg.configBssRspParams.status); |
| 14471 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14472 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14473 | /*Association was failed by HAL - remove session*/ |
| 14474 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 14475 | |
| 14476 | /*Association no longer in progress */ |
| 14477 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 14478 | |
| 14479 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 14480 | WDI_DequeueAssocRequest(pWDICtx); |
| 14481 | |
| 14482 | } |
| 14483 | |
| 14484 | /*Notify UMAC*/ |
| 14485 | wdiConfigBSSRspCb( &wdiConfigBSSParams, pWDICtx->pRspCBUserData); |
| 14486 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14487 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14488 | }/*WDI_ProcessConfigBSSRsp*/ |
| 14489 | |
| 14490 | |
| 14491 | /** |
| 14492 | @brief Process Del BSS Response function (called when a response |
| 14493 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14494 | |
| 14495 | @param pWDICtx: pointer to the WLAN DAL context |
| 14496 | pEventData: pointer to the event information structure |
| 14497 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14498 | @see |
| 14499 | @return Result of the function call |
| 14500 | */ |
| 14501 | WDI_Status |
| 14502 | WDI_ProcessDelBSSRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14503 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14504 | WDI_ControlBlockType* pWDICtx, |
| 14505 | WDI_EventInfoType* pEventData |
| 14506 | ) |
| 14507 | { |
| 14508 | WDI_DelBSSRspParamsType wdiDelBSSParams; |
| 14509 | WDI_DelBSSRspCb wdiDelBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14510 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14511 | WDI_BSSSessionType* pBSSSes = NULL; |
| 14512 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14513 | tDeleteBssRspMsg halDelBssRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14514 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14515 | |
| 14516 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14517 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14518 | -------------------------------------------------------------------------*/ |
| 14519 | if (( NULL == pEventData ) || |
| 14520 | ( NULL == pEventData->pEventData)) |
| 14521 | { |
| 14522 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14523 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14524 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14525 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14526 | } |
| 14527 | |
| 14528 | wdiDelBSSRspCb = (WDI_DelBSSRspCb)pWDICtx->pfncRspCB; |
| 14529 | |
| 14530 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14531 | Extract response and send it to UMAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14532 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14533 | wpalMemoryCopy( &halDelBssRspMsg.deleteBssRspParams, |
| 14534 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14535 | sizeof(halDelBssRspMsg.deleteBssRspParams)); |
| 14536 | |
| 14537 | |
| 14538 | wdiDelBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14539 | halDelBssRspMsg.deleteBssRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14540 | |
| 14541 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14542 | |
| 14543 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14544 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14545 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14546 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 14547 | halDelBssRspMsg.deleteBssRspParams.bssIdx, |
| 14548 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14549 | |
| 14550 | /*----------------------------------------------------------------------- |
| 14551 | Del BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14552 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14553 | -----------------------------------------------------------------------*/ |
| 14554 | if ( NULL == pBSSSes ) |
| 14555 | { |
| 14556 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14557 | "Association sequence for this BSS does not yet exist or " |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 14558 | "association no longer in progress - mysterious HAL response"); |
| 14559 | |
| 14560 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14561 | |
| 14562 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14563 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14564 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 14565 | |
| 14566 | /*Extract BSSID for the response to UMAC*/ |
| 14567 | wpalMemoryCopy(wdiDelBSSParams.macBSSID, |
| 14568 | pBSSSes->macBSSID, WDI_MAC_ADDR_LEN); |
| 14569 | |
| 14570 | wdiDelBSSParams.ucBssIdx = halDelBssRspMsg.deleteBssRspParams.bssIdx; |
| 14571 | |
| 14572 | /*----------------------------------------------------------------------- |
| 14573 | The current session will be deleted |
| 14574 | -----------------------------------------------------------------------*/ |
| 14575 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 14576 | |
| 14577 | |
| 14578 | /* Delete the BCAST STA entry from the STA table if SAP/GO session is deleted */ |
| 14579 | if(WDI_INFRA_AP_MODE == pBSSSes->wdiBssType) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14580 | { |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 14581 | (void)WDI_STATableDelSta( pWDICtx, pBSSSes->bcastStaIdx ); |
Madan Mohan Koyyalamudi | f371f17 | 2012-10-31 16:35:43 -0700 | [diff] [blame] | 14582 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 14583 | |
| 14584 | /* Delete the STA's in this BSS */ |
| 14585 | WDI_STATableBSSDelSta(pWDICtx, halDelBssRspMsg.deleteBssRspParams.bssIdx); |
| 14586 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14587 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14588 | |
| 14589 | /*Notify UMAC*/ |
| 14590 | wdiDelBSSRspCb( &wdiDelBSSParams, pWDICtx->pRspCBUserData); |
| 14591 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14592 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14593 | }/*WDI_ProcessDelBSSRsp*/ |
| 14594 | |
| 14595 | /** |
| 14596 | @brief Process Post Assoc Rsp function (called when a response |
| 14597 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14598 | |
| 14599 | @param pWDICtx: pointer to the WLAN DAL context |
| 14600 | pEventData: pointer to the event information structure |
| 14601 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14602 | @see |
| 14603 | @return Result of the function call |
| 14604 | */ |
| 14605 | WDI_Status |
| 14606 | WDI_ProcessPostAssocRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14607 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14608 | WDI_ControlBlockType* pWDICtx, |
| 14609 | WDI_EventInfoType* pEventData |
| 14610 | ) |
| 14611 | { |
| 14612 | WDI_PostAssocRspParamsType wdiPostAssocParams; |
| 14613 | WDI_PostAssocRspCb wdiPostAssocRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14614 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14615 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14616 | tPostAssocRspMsg halPostAssocRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14617 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14618 | |
| 14619 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14620 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14621 | -------------------------------------------------------------------------*/ |
| 14622 | if (( NULL == pEventData ) || |
| 14623 | ( NULL == pEventData->pEventData)) |
| 14624 | { |
| 14625 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14626 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14627 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14628 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14629 | } |
| 14630 | |
| 14631 | wdiPostAssocRspCb = (WDI_PostAssocRspCb)pWDICtx->pfncRspCB; |
| 14632 | |
| 14633 | /*------------------------------------------------------------------------- |
| 14634 | Extract response and send it to UMAC |
| 14635 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14636 | wpalMemoryCopy( &halPostAssocRspMsg.postAssocRspParams, |
| 14637 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14638 | sizeof(halPostAssocRspMsg.postAssocRspParams)); |
| 14639 | |
| 14640 | /*Extract the Post Assoc STA Params */ |
| 14641 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14642 | wdiPostAssocParams.staParams.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14643 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.staIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14644 | wdiPostAssocParams.staParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14645 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14646 | wdiPostAssocParams.staParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14647 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig; |
| 14648 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14649 | wdiPostAssocParams.wdiStatus = |
| 14650 | WDI_HAL_2_WDI_STATUS(halPostAssocRspMsg.postAssocRspParams.configStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14651 | |
| 14652 | /*Copy the MAC addresses from the cached storage in the WDI CB as they are not |
| 14653 | included in the response */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14654 | wpalMemoryCopy( wdiPostAssocParams.staParams.macSTA, |
| 14655 | pWDICtx->wdiCachedPostAssocReq.wdiSTAParams.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14656 | WDI_MAC_ADDR_LEN); |
| 14657 | |
| 14658 | /* Extract Post Assoc BSS Params */ |
| 14659 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14660 | wpalMemoryCopy( wdiPostAssocParams.bssParams.macBSSID, |
| 14661 | pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.macBSSID, |
| 14662 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14663 | |
| 14664 | /*Copy the MAC addresses from the cached storage in the WDI CB as they are not |
| 14665 | included in the response */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14666 | wpalMemoryCopy( wdiPostAssocParams.bssParams.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14667 | pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.wdiSTAContext |
| 14668 | .macSTA, WDI_MAC_ADDR_LEN); |
| 14669 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14670 | wdiPostAssocParams.bssParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14671 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig; |
| 14672 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14673 | wdiPostAssocParams.bssParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14674 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig; |
| 14675 | |
| 14676 | wdiPostAssocParams.bssParams.ucBSSIdx = |
| 14677 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx; |
| 14678 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14679 | wdiPostAssocParams.bssParams.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14680 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssStaIdx; |
| 14681 | |
| 14682 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14683 | |
| 14684 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14685 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14686 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14687 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14688 | wdiPostAssocParams.bssParams. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14689 | macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14690 | |
| 14691 | /*----------------------------------------------------------------------- |
| 14692 | Post assoc response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14693 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14694 | -----------------------------------------------------------------------*/ |
| 14695 | if (( NULL == pBSSSes ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14696 | ( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14697 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 14698 | { |
| 14699 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14700 | "Association sequence for this BSS does not yet exist or " |
| 14701 | "association no longer in progress - mysterious HAL response"); |
| 14702 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14703 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14704 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14705 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14706 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14707 | } |
| 14708 | |
| 14709 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14710 | Post Assoc Request is only allowed in Joining state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14711 | -----------------------------------------------------------------------*/ |
| 14712 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 14713 | { |
| 14714 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14715 | "Post Assoc not allowed before JOIN - failing request " |
| 14716 | "strange HAL response"); |
| 14717 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14718 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14719 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14720 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14721 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14722 | } |
| 14723 | |
| 14724 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14725 | If assoc has failed the current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14726 | -----------------------------------------------------------------------*/ |
| 14727 | if ( WDI_STATUS_SUCCESS != wdiPostAssocParams.wdiStatus ) |
| 14728 | { |
| 14729 | /*Association was failed by HAL - remove session*/ |
| 14730 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 14731 | } |
| 14732 | else |
| 14733 | { |
| 14734 | /*Transition to state POST Assoc*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14735 | pBSSSes->wdiAssocState = WDI_ASSOC_POST_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14736 | |
| 14737 | /*Save DPU Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14738 | pBSSSes->bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14739 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14740 | pBSSSes->bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14741 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14742 | pBSSSes->bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14743 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14744 | pBSSSes->bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14745 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuSignature; |
| 14746 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14747 | pBSSSes->ucBSSIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14748 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx; |
| 14749 | } |
| 14750 | |
| 14751 | /*Association no longer in progress */ |
| 14752 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 14753 | |
| 14754 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 14755 | WDI_DequeueAssocRequest(pWDICtx); |
| 14756 | |
| 14757 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14758 | |
| 14759 | /*Notify UMAC*/ |
| 14760 | wdiPostAssocRspCb( &wdiPostAssocParams, pWDICtx->pRspCBUserData); |
| 14761 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14762 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14763 | }/*WDI_ProcessPostAssocRsp*/ |
| 14764 | |
| 14765 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14766 | @brief Process Del STA Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14767 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14768 | |
| 14769 | @param pWDICtx: pointer to the WLAN DAL context |
| 14770 | pEventData: pointer to the event information structure |
| 14771 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14772 | @see |
| 14773 | @return Result of the function call |
| 14774 | */ |
| 14775 | WDI_Status |
| 14776 | WDI_ProcessDelSTARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14777 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14778 | WDI_ControlBlockType* pWDICtx, |
| 14779 | WDI_EventInfoType* pEventData |
| 14780 | ) |
| 14781 | { |
| 14782 | WDI_DelSTARspParamsType wdiDelSTARsp; |
| 14783 | WDI_DelSTARspCb wdiDelSTARspCb; |
| 14784 | wpt_uint8 staType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14785 | tDeleteStaRspMsg halDelStaRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14786 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14787 | |
| 14788 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14789 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14790 | -------------------------------------------------------------------------*/ |
| 14791 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14792 | ( NULL == pEventData->pEventData)) |
| 14793 | { |
| 14794 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14795 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14796 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14797 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14798 | } |
| 14799 | |
| 14800 | wdiDelSTARspCb = (WDI_DelSTARspCb)pWDICtx->pfncRspCB; |
| 14801 | |
| 14802 | /*------------------------------------------------------------------------- |
| 14803 | Extract response and send it to UMAC |
| 14804 | -------------------------------------------------------------------------*/ |
| 14805 | wpalMemoryCopy( &halDelStaRspMsg.delStaRspParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14806 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14807 | sizeof(halDelStaRspMsg.delStaRspParams)); |
| 14808 | |
| 14809 | wdiDelSTARsp.ucSTAIdx = halDelStaRspMsg.delStaRspParams.staId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14810 | wdiDelSTARsp.wdiStatus = |
| 14811 | WDI_HAL_2_WDI_STATUS(halDelStaRspMsg.delStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14812 | |
| 14813 | WDI_STATableGetStaType(pWDICtx, wdiDelSTARsp.ucSTAIdx, &staType); |
| 14814 | |
| 14815 | /* If the DEL STA request is for self STA do not delete it - Really weird!!What happens in concurrency */ |
| 14816 | if(staType == WDI_STA_ENTRY_SELF) |
| 14817 | { |
| 14818 | WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable; |
| 14819 | |
| 14820 | /* At this point add the self-STA */ |
| 14821 | |
| 14822 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 14823 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 14824 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 14825 | |
| 14826 | #define WDI_DPU_SELF_STA_DEFAULT_IDX 0 |
| 14827 | #define WDI_DPU_SELF_STA_DEFAULT_SIG 0 |
| 14828 | |
| 14829 | //all DPU indices are the same for self STA |
| 14830 | pSTATable[wdiDelSTARsp.ucSTAIdx].dpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 14831 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 14832 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 14833 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG; |
| 14834 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG; |
| 14835 | pSTATable[wdiDelSTARsp.ucSTAIdx].dpuSig = WDI_DPU_SELF_STA_DEFAULT_SIG; |
Madan Mohan Koyyalamudi | 15a48f0 | 2012-10-05 17:13:53 -0700 | [diff] [blame] | 14836 | |
| 14837 | pSTATable[wdiDelSTARsp.ucSTAIdx].bssIdx = WDI_BSS_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14838 | } |
| 14839 | else |
| 14840 | { |
| 14841 | //Delete the station in the table |
| 14842 | WDI_STATableDelSta( pWDICtx, wdiDelSTARsp.ucSTAIdx); |
| 14843 | } |
| 14844 | |
| 14845 | /*Notify UMAC*/ |
| 14846 | wdiDelSTARspCb( &wdiDelSTARsp, pWDICtx->pRspCBUserData); |
| 14847 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14848 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14849 | }/*WDI_ProcessDelSTARsp*/ |
| 14850 | |
| 14851 | |
| 14852 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14853 | Security Response Processing Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14854 | ==========================================================================*/ |
| 14855 | |
| 14856 | /** |
| 14857 | @brief Process Set BSS Key Rsp function (called when a response |
| 14858 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14859 | |
| 14860 | @param pWDICtx: pointer to the WLAN DAL context |
| 14861 | pEventData: pointer to the event information structure |
| 14862 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14863 | @see |
| 14864 | @return Result of the function call |
| 14865 | */ |
| 14866 | WDI_Status |
| 14867 | WDI_ProcessSetBssKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14868 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14869 | WDI_ControlBlockType* pWDICtx, |
| 14870 | WDI_EventInfoType* pEventData |
| 14871 | ) |
| 14872 | { |
| 14873 | WDI_Status wdiStatus; |
| 14874 | eHalStatus halStatus; |
| 14875 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb; |
| 14876 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14877 | |
| 14878 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14879 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14880 | -------------------------------------------------------------------------*/ |
| 14881 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14882 | ( NULL == pEventData->pEventData)) |
| 14883 | { |
| 14884 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14885 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14886 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14887 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14888 | } |
| 14889 | |
| 14890 | wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pWDICtx->pfncRspCB; |
| 14891 | |
| 14892 | /*------------------------------------------------------------------------- |
| 14893 | Extract response and send it to UMAC |
| 14894 | -------------------------------------------------------------------------*/ |
| 14895 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14896 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14897 | |
| 14898 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 14899 | { |
| 14900 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14901 | "Set BSS Key failed with status %s (%d)", |
| 14902 | WDI_getHALStatusMsgString(halStatus), |
| 14903 | halStatus); |
| 14904 | /* send the status to UMAC, don't return from here*/ |
| 14905 | } |
| 14906 | |
| 14907 | /*Notify UMAC*/ |
| 14908 | wdiSetBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14909 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14910 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14911 | }/*WDI_ProcessSetBssKeyRsp*/ |
| 14912 | |
| 14913 | /** |
| 14914 | @brief Process Remove BSS Key Rsp function (called when a response |
| 14915 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14916 | |
| 14917 | @param pWDICtx: pointer to the WLAN DAL context |
| 14918 | pEventData: pointer to the event information structure |
| 14919 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14920 | @see |
| 14921 | @return Result of the function call |
| 14922 | */ |
| 14923 | WDI_Status |
| 14924 | WDI_ProcessRemoveBssKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14925 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14926 | WDI_ControlBlockType* pWDICtx, |
| 14927 | WDI_EventInfoType* pEventData |
| 14928 | ) |
| 14929 | { |
| 14930 | WDI_Status wdiStatus; |
| 14931 | eHalStatus halStatus; |
| 14932 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb; |
| 14933 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14934 | |
| 14935 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14936 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14937 | -------------------------------------------------------------------------*/ |
| 14938 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14939 | ( NULL == pEventData->pEventData)) |
| 14940 | { |
| 14941 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14942 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14943 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14944 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14945 | } |
| 14946 | |
| 14947 | wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pWDICtx->pfncRspCB; |
| 14948 | |
| 14949 | /*------------------------------------------------------------------------- |
| 14950 | Extract response and send it to UMAC |
| 14951 | -------------------------------------------------------------------------*/ |
| 14952 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14953 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14954 | |
| 14955 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 14956 | { |
| 14957 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14958 | "Remove BSS Key failed with status %s (%d )", |
| 14959 | WDI_getHALStatusMsgString(halStatus), |
| 14960 | halStatus); |
| 14961 | /* send the status to UMAC, don't return from here*/ |
| 14962 | } |
| 14963 | |
| 14964 | /*Notify UMAC*/ |
| 14965 | wdiRemoveBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14966 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14967 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14968 | }/*WDI_ProcessSetBssKeyRsp*/ |
| 14969 | |
| 14970 | |
| 14971 | /** |
| 14972 | @brief Process Set STA Key Rsp function (called when a response |
| 14973 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14974 | |
| 14975 | @param pWDICtx: pointer to the WLAN DAL context |
| 14976 | pEventData: pointer to the event information structure |
| 14977 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14978 | @see |
| 14979 | @return Result of the function call |
| 14980 | */ |
| 14981 | WDI_Status |
| 14982 | WDI_ProcessSetStaKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14983 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14984 | WDI_ControlBlockType* pWDICtx, |
| 14985 | WDI_EventInfoType* pEventData |
| 14986 | ) |
| 14987 | { |
| 14988 | WDI_Status wdiStatus; |
| 14989 | eHalStatus halStatus; |
| 14990 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 14991 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14992 | |
| 14993 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14994 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14995 | -------------------------------------------------------------------------*/ |
| 14996 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14997 | ( NULL == pEventData->pEventData)) |
| 14998 | { |
| 14999 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15000 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15001 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15002 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15003 | } |
| 15004 | |
| 15005 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15006 | |
| 15007 | /*------------------------------------------------------------------------- |
| 15008 | Extract response and send it to UMAC |
| 15009 | -------------------------------------------------------------------------*/ |
| 15010 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15011 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15012 | |
| 15013 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15014 | { |
| 15015 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15016 | "Set STA Key failed with status %s (%d)", |
| 15017 | WDI_getHALStatusMsgString(halStatus), |
| 15018 | halStatus); |
| 15019 | /* send the status to UMAC, don't return from here*/ |
| 15020 | } |
| 15021 | |
| 15022 | /*Notify UMAC*/ |
| 15023 | wdiSetSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15024 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15025 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15026 | }/*WDI_ProcessSetSTAKeyRsp*/ |
| 15027 | |
| 15028 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15029 | @brief Process Remove STA Key Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15030 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15031 | |
| 15032 | @param pWDICtx: pointer to the WLAN DAL context |
| 15033 | pEventData: pointer to the event information structure |
| 15034 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15035 | @see |
| 15036 | @return Result of the function call |
| 15037 | */ |
| 15038 | WDI_Status |
| 15039 | WDI_ProcessRemoveStaKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15040 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15041 | WDI_ControlBlockType* pWDICtx, |
| 15042 | WDI_EventInfoType* pEventData |
| 15043 | ) |
| 15044 | { |
| 15045 | WDI_Status wdiStatus; |
| 15046 | eHalStatus halStatus; |
| 15047 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 15048 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15049 | |
| 15050 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15051 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15052 | -------------------------------------------------------------------------*/ |
| 15053 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15054 | ( NULL == pEventData->pEventData)) |
| 15055 | { |
| 15056 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15057 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15058 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15059 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15060 | } |
| 15061 | |
| 15062 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15063 | |
| 15064 | /*------------------------------------------------------------------------- |
| 15065 | Extract response and send it to UMAC |
| 15066 | -------------------------------------------------------------------------*/ |
| 15067 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15068 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15069 | |
| 15070 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15071 | { |
| 15072 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15073 | "Remove STA Key failed with status %s (%d)", |
| 15074 | WDI_getHALStatusMsgString(halStatus), |
| 15075 | halStatus); |
| 15076 | /* send the status to UMAC, don't return from here*/ |
| 15077 | } |
| 15078 | |
| 15079 | /*Notify UMAC*/ |
| 15080 | wdiRemoveSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15081 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15082 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15083 | }/*WDI_ProcessRemoveStaKeyRsp*/ |
| 15084 | |
| 15085 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15086 | @brief Process Set STA Bcast Key Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15087 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15088 | |
| 15089 | @param pWDICtx: pointer to the WLAN DAL context |
| 15090 | pEventData: pointer to the event information structure |
| 15091 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15092 | @see |
| 15093 | @return Result of the function call |
| 15094 | */ |
| 15095 | WDI_Status |
| 15096 | WDI_ProcessSetStaBcastKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15097 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15098 | WDI_ControlBlockType* pWDICtx, |
| 15099 | WDI_EventInfoType* pEventData |
| 15100 | ) |
| 15101 | { |
| 15102 | WDI_Status wdiStatus; |
| 15103 | eHalStatus halStatus; |
| 15104 | WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb; |
| 15105 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15106 | |
| 15107 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15108 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15109 | -------------------------------------------------------------------------*/ |
| 15110 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15111 | ( NULL == pEventData->pEventData)) |
| 15112 | { |
| 15113 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15114 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15115 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15116 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15117 | } |
| 15118 | |
| 15119 | wdiSetSTABcastKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15120 | |
| 15121 | /*------------------------------------------------------------------------- |
| 15122 | Extract response and send it to UMAC |
| 15123 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15124 | wpalMemoryCopy( &halStatus, |
| 15125 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15126 | sizeof(halStatus)); |
| 15127 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15128 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15129 | |
| 15130 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15131 | { |
| 15132 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15133 | "Set STA Key failed with status %s (%d)", |
| 15134 | WDI_getHALStatusMsgString(halStatus), |
| 15135 | halStatus); |
| 15136 | /* send the status to UMAC, don't return from here*/ |
| 15137 | } |
| 15138 | |
| 15139 | /*Notify UMAC*/ |
| 15140 | wdiSetSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15141 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15142 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15143 | }/*WDI_ProcessSetSTABcastKeyRsp*/ |
| 15144 | |
| 15145 | /** |
| 15146 | @brief Process Remove STA Bcast Key Rsp function (called when a |
| 15147 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15148 | |
| 15149 | @param pWDICtx: pointer to the WLAN DAL context |
| 15150 | pEventData: pointer to the event information structure |
| 15151 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15152 | @see |
| 15153 | @return Result of the function call |
| 15154 | */ |
| 15155 | WDI_Status |
| 15156 | WDI_ProcessRemoveStaBcastKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15157 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15158 | WDI_ControlBlockType* pWDICtx, |
| 15159 | WDI_EventInfoType* pEventData |
| 15160 | ) |
| 15161 | { |
| 15162 | WDI_Status wdiStatus; |
| 15163 | eHalStatus halStatus; |
| 15164 | WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb; |
| 15165 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15166 | |
| 15167 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15168 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15169 | -------------------------------------------------------------------------*/ |
| 15170 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15171 | ( NULL == pEventData->pEventData)) |
| 15172 | { |
| 15173 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15174 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15175 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15176 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15177 | } |
| 15178 | |
| 15179 | wdiRemoveSTABcastKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15180 | |
| 15181 | /*------------------------------------------------------------------------- |
| 15182 | Extract response and send it to UMAC |
| 15183 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15184 | wpalMemoryCopy( &halStatus, |
| 15185 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15186 | sizeof(halStatus)); |
| 15187 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15188 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15189 | |
| 15190 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15191 | { |
| 15192 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15193 | "Remove STA Key failed with status %s (%d)", |
| 15194 | WDI_getHALStatusMsgString(halStatus), |
| 15195 | halStatus); |
| 15196 | /* send the status to UMAC, don't return from here*/ |
| 15197 | } |
| 15198 | |
| 15199 | /*Notify UMAC*/ |
| 15200 | wdiRemoveSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15201 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15202 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15203 | }/*WDI_ProcessRemoveStaBcastKeyRsp*/ |
| 15204 | |
| 15205 | |
| 15206 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15207 | QoS and BA Response Processing Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15208 | ==========================================================================*/ |
| 15209 | |
| 15210 | /** |
| 15211 | @brief Process Add TSpec Rsp function (called when a response |
| 15212 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15213 | |
| 15214 | @param pWDICtx: pointer to the WLAN DAL context |
| 15215 | pEventData: pointer to the event information structure |
| 15216 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15217 | @see |
| 15218 | @return Result of the function call |
| 15219 | */ |
| 15220 | WDI_Status |
| 15221 | WDI_ProcessAddTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15222 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15223 | WDI_ControlBlockType* pWDICtx, |
| 15224 | WDI_EventInfoType* pEventData |
| 15225 | ) |
| 15226 | { |
| 15227 | WDI_Status wdiStatus; |
| 15228 | eHalStatus halStatus; |
| 15229 | WDI_AddTsRspCb wdiAddTsRspCb; |
| 15230 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15231 | |
| 15232 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15233 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15234 | -------------------------------------------------------------------------*/ |
| 15235 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15236 | ( NULL == pEventData->pEventData)) |
| 15237 | { |
| 15238 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15239 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15240 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15241 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15242 | } |
| 15243 | |
| 15244 | wdiAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB; |
| 15245 | |
| 15246 | /*------------------------------------------------------------------------- |
| 15247 | Extract response and send it to UMAC |
| 15248 | -------------------------------------------------------------------------*/ |
| 15249 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15250 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15251 | |
| 15252 | /*Notify UMAC*/ |
| 15253 | wdiAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15254 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15255 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15256 | }/*WDI_ProcessAddTSpecRsp*/ |
| 15257 | |
| 15258 | |
| 15259 | /** |
| 15260 | @brief Process Del TSpec Rsp function (called when a response |
| 15261 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15262 | |
| 15263 | @param pWDICtx: pointer to the WLAN DAL context |
| 15264 | pEventData: pointer to the event information structure |
| 15265 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15266 | @see |
| 15267 | @return Result of the function call |
| 15268 | */ |
| 15269 | WDI_Status |
| 15270 | WDI_ProcessDelTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15271 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15272 | WDI_ControlBlockType* pWDICtx, |
| 15273 | WDI_EventInfoType* pEventData |
| 15274 | ) |
| 15275 | { |
| 15276 | WDI_Status wdiStatus; |
| 15277 | eHalStatus halStatus; |
| 15278 | WDI_DelTsRspCb wdiDelTsRspCb; |
| 15279 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15280 | |
| 15281 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15282 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15283 | -------------------------------------------------------------------------*/ |
| 15284 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15285 | ( NULL == pEventData->pEventData)) |
| 15286 | { |
| 15287 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15288 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15289 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15290 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15291 | } |
| 15292 | |
| 15293 | wdiDelTsRspCb = (WDI_DelTsRspCb)pWDICtx->pfncRspCB; |
| 15294 | |
| 15295 | /*------------------------------------------------------------------------- |
| 15296 | Extract response and send it to UMAC |
| 15297 | -------------------------------------------------------------------------*/ |
| 15298 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15299 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15300 | |
| 15301 | /*Notify UMAC*/ |
| 15302 | wdiDelTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15303 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15304 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15305 | }/*WDI_ProcessDelTSpecRsp*/ |
| 15306 | |
| 15307 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15308 | @brief Process Update EDCA Parameters Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15309 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15310 | |
| 15311 | @param pWDICtx: pointer to the WLAN DAL context |
| 15312 | pEventData: pointer to the event information structure |
| 15313 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15314 | @see |
| 15315 | @return Result of the function call |
| 15316 | */ |
| 15317 | WDI_Status |
| 15318 | WDI_ProcessUpdateEDCAParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15319 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15320 | WDI_ControlBlockType* pWDICtx, |
| 15321 | WDI_EventInfoType* pEventData |
| 15322 | ) |
| 15323 | { |
| 15324 | WDI_Status wdiStatus; |
| 15325 | eHalStatus halStatus; |
| 15326 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb; |
| 15327 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15328 | |
| 15329 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15330 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15331 | -------------------------------------------------------------------------*/ |
| 15332 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15333 | ( NULL == pEventData->pEventData)) |
| 15334 | { |
| 15335 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15336 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15337 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15338 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15339 | } |
| 15340 | |
| 15341 | wdiUpdateEDCAParamsRspCb = (WDI_UpdateEDCAParamsRspCb)pWDICtx->pfncRspCB; |
| 15342 | |
| 15343 | /*------------------------------------------------------------------------- |
| 15344 | Extract response and send it to UMAC |
| 15345 | -------------------------------------------------------------------------*/ |
| 15346 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15347 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15348 | |
| 15349 | /*Notify UMAC*/ |
| 15350 | wdiUpdateEDCAParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15351 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15352 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15353 | }/*WDI_ProcessUpdateEDCAParamsRsp*/ |
| 15354 | |
| 15355 | |
| 15356 | /** |
| 15357 | @brief Process Add BA Rsp function (called when a response |
| 15358 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15359 | |
| 15360 | @param pWDICtx: pointer to the WLAN DAL context |
| 15361 | pEventData: pointer to the event information structure |
| 15362 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15363 | @see |
| 15364 | @return Result of the function call |
| 15365 | */ |
| 15366 | WDI_Status |
| 15367 | WDI_ProcessAddBASessionRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15368 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15369 | WDI_ControlBlockType* pWDICtx, |
| 15370 | WDI_EventInfoType* pEventData |
| 15371 | ) |
| 15372 | { |
| 15373 | WDI_AddBASessionRspCb wdiAddBASessionRspCb; |
| 15374 | |
| 15375 | tAddBASessionRspParams halBASessionRsp; |
| 15376 | WDI_AddBASessionRspParamsType wdiBASessionRsp; |
| 15377 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15378 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15379 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15380 | |
| 15381 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15382 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15383 | -------------------------------------------------------------------------*/ |
| 15384 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15385 | ( NULL == pEventData->pEventData)) |
| 15386 | { |
| 15387 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15388 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15389 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15390 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15391 | } |
| 15392 | |
| 15393 | wdiAddBASessionRspCb = (WDI_AddBASessionRspCb)pWDICtx->pfncRspCB; |
| 15394 | |
| 15395 | /*------------------------------------------------------------------------- |
| 15396 | Extract response and send it to UMAC |
| 15397 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15398 | wpalMemoryCopy( &halBASessionRsp, |
| 15399 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15400 | sizeof(halBASessionRsp)); |
| 15401 | |
| 15402 | wdiBASessionRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halBASessionRsp.status); |
| 15403 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 15404 | if ( WDI_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15405 | { |
| 15406 | wdiBASessionRsp.ucBaDialogToken = halBASessionRsp.baDialogToken; |
| 15407 | wdiBASessionRsp.ucBaTID = halBASessionRsp.baTID; |
| 15408 | wdiBASessionRsp.ucBaBufferSize = halBASessionRsp.baBufferSize; |
| 15409 | wdiBASessionRsp.usBaSessionID = halBASessionRsp.baSessionID; |
| 15410 | wdiBASessionRsp.ucWinSize = halBASessionRsp.winSize; |
| 15411 | wdiBASessionRsp.ucSTAIdx = halBASessionRsp.STAID; |
| 15412 | wdiBASessionRsp.usBaSSN = halBASessionRsp.SSN; |
| 15413 | } |
| 15414 | |
| 15415 | /*Notify UMAC*/ |
| 15416 | wdiAddBASessionRspCb( &wdiBASessionRsp, pWDICtx->pRspCBUserData); |
| 15417 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15418 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15419 | }/*WDI_ProcessAddSessionBARsp*/ |
| 15420 | |
| 15421 | |
| 15422 | /** |
| 15423 | @brief Process Del BA Rsp function (called when a response |
| 15424 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15425 | |
| 15426 | @param pWDICtx: pointer to the WLAN DAL context |
| 15427 | pEventData: pointer to the event information structure |
| 15428 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15429 | @see |
| 15430 | @return Result of the function call |
| 15431 | */ |
| 15432 | WDI_Status |
| 15433 | WDI_ProcessDelBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15434 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15435 | WDI_ControlBlockType* pWDICtx, |
| 15436 | WDI_EventInfoType* pEventData |
| 15437 | ) |
| 15438 | { |
| 15439 | WDI_Status wdiStatus; |
| 15440 | eHalStatus halStatus; |
| 15441 | WDI_DelBARspCb wdiDelBARspCb; |
| 15442 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15443 | |
| 15444 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15445 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15446 | -------------------------------------------------------------------------*/ |
| 15447 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15448 | ( NULL == pEventData->pEventData)) |
| 15449 | { |
| 15450 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15451 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15452 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15453 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15454 | } |
| 15455 | |
| 15456 | wdiDelBARspCb = (WDI_DelBARspCb)pWDICtx->pfncRspCB; |
| 15457 | |
| 15458 | /*------------------------------------------------------------------------- |
| 15459 | Extract response and send it to UMAC |
| 15460 | -------------------------------------------------------------------------*/ |
| 15461 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15462 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15463 | |
| 15464 | if ( eHAL_STATUS_SUCCESS == halStatus ) |
| 15465 | { |
| 15466 | /*! TO DO: I should notify the DAL Data Path that the BA was deleted*/ |
| 15467 | } |
| 15468 | |
| 15469 | /*Notify UMAC*/ |
| 15470 | wdiDelBARspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15471 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15472 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15473 | }/*WDI_ProcessDelBARsp*/ |
| 15474 | |
| 15475 | #ifdef FEATURE_WLAN_CCX |
| 15476 | /** |
| 15477 | @brief Process TSM Stats Rsp function (called when a response |
| 15478 | is being received over the bus from HAL) |
| 15479 | |
| 15480 | @param pWDICtx: pointer to the WLAN DAL context |
| 15481 | pEventData: pointer to the event information structure |
| 15482 | |
| 15483 | @see |
| 15484 | @return Result of the function call |
| 15485 | */ |
| 15486 | WDI_Status |
| 15487 | WDI_ProcessTsmStatsRsp |
| 15488 | ( |
| 15489 | WDI_ControlBlockType* pWDICtx, |
| 15490 | WDI_EventInfoType* pEventData |
| 15491 | ) |
| 15492 | { |
| 15493 | WDI_TsmRspCb wdiTsmStatsRspCb; |
| 15494 | tTsmStatsRspMsg halTsmStatsRspMsg; |
| 15495 | WDI_TSMStatsRspParamsType wdiTsmStatsRspParams; |
| 15496 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15497 | |
| 15498 | /*------------------------------------------------------------------------- |
| 15499 | Sanity check |
| 15500 | -------------------------------------------------------------------------*/ |
| 15501 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15502 | ( NULL == pEventData->pEventData)) |
| 15503 | { |
| 15504 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15505 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15506 | WDI_ASSERT(0); |
| 15507 | return WDI_STATUS_E_FAILURE; |
| 15508 | } |
| 15509 | |
| 15510 | wdiTsmStatsRspCb = (WDI_TsmRspCb)pWDICtx->pfncRspCB; |
| 15511 | |
| 15512 | /*------------------------------------------------------------------------- |
| 15513 | Unpack HAL Response Message - the header was already extracted by the |
| 15514 | main Response Handling procedure |
| 15515 | -------------------------------------------------------------------------*/ |
| 15516 | wpalMemoryCopy( &halTsmStatsRspMsg.tsmStatsRspParams, |
| 15517 | pEventData->pEventData, |
| 15518 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams)); |
| 15519 | |
| 15520 | wdiTsmStatsRspParams.UplinkPktQueueDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDly; |
| 15521 | wpalMemoryCopy( wdiTsmStatsRspParams.UplinkPktQueueDlyHist, |
| 15522 | halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist, |
| 15523 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist)/ |
| 15524 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist[0])); |
| 15525 | wdiTsmStatsRspParams.UplinkPktTxDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktTxDly; |
| 15526 | wdiTsmStatsRspParams.UplinkPktLoss = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktLoss; |
| 15527 | wdiTsmStatsRspParams.UplinkPktCount = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktCount; |
| 15528 | wdiTsmStatsRspParams.RoamingCount = halTsmStatsRspMsg.tsmStatsRspParams.RoamingCount; |
| 15529 | wdiTsmStatsRspParams.RoamingDly = halTsmStatsRspMsg.tsmStatsRspParams.RoamingDly; |
| 15530 | wdiTsmStatsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 15531 | halTsmStatsRspMsg.tsmStatsRspParams.status); |
| 15532 | |
| 15533 | /*Notify UMAC*/ |
| 15534 | wdiTsmStatsRspCb( &wdiTsmStatsRspParams, pWDICtx->pRspCBUserData); |
| 15535 | |
| 15536 | return WDI_STATUS_SUCCESS; |
| 15537 | }/*WDI_ProcessTsmStatsRsp*/ |
| 15538 | |
| 15539 | #endif |
| 15540 | |
| 15541 | |
| 15542 | |
| 15543 | /** |
| 15544 | @brief Process Flush AC Rsp function (called when a response |
| 15545 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15546 | |
| 15547 | @param pWDICtx: pointer to the WLAN DAL context |
| 15548 | pEventData: pointer to the event information structure |
| 15549 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15550 | @see |
| 15551 | @return Result of the function call |
| 15552 | */ |
| 15553 | WDI_Status |
| 15554 | WDI_ProcessFlushAcRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15555 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15556 | WDI_ControlBlockType* pWDICtx, |
| 15557 | WDI_EventInfoType* pEventData |
| 15558 | ) |
| 15559 | { |
| 15560 | WDI_Status wdiStatus; |
| 15561 | eHalStatus halStatus; |
| 15562 | WDI_FlushAcRspCb wdiFlushAcRspCb; |
| 15563 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15564 | |
| 15565 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15566 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15567 | -------------------------------------------------------------------------*/ |
| 15568 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15569 | ( NULL == pEventData->pEventData)) |
| 15570 | { |
| 15571 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15572 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15573 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15574 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15575 | } |
| 15576 | |
| 15577 | wdiFlushAcRspCb = (WDI_FlushAcRspCb)pWDICtx->pfncRspCB; |
| 15578 | |
| 15579 | /*------------------------------------------------------------------------- |
| 15580 | Extract response and send it to UMAC |
| 15581 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15582 | wpalMemoryCopy( &halStatus, |
| 15583 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15584 | sizeof(halStatus)); |
| 15585 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15586 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15587 | |
| 15588 | /*Notify UMAC*/ |
| 15589 | wdiFlushAcRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15590 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15591 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15592 | }/*WDI_ProcessFlushAcRsp*/ |
| 15593 | |
| 15594 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15595 | @brief Process BT AMP event Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15596 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15597 | |
| 15598 | @param pWDICtx: pointer to the WLAN DAL context |
| 15599 | pEventData: pointer to the event information structure |
| 15600 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15601 | @see |
| 15602 | @return Result of the function call |
| 15603 | */ |
| 15604 | WDI_Status |
| 15605 | WDI_ProcessBtAmpEventRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15606 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15607 | WDI_ControlBlockType* pWDICtx, |
| 15608 | WDI_EventInfoType* pEventData |
| 15609 | ) |
| 15610 | { |
| 15611 | WDI_Status wdiStatus; |
| 15612 | eHalStatus halStatus; |
| 15613 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb; |
| 15614 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15615 | |
| 15616 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15617 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15618 | -------------------------------------------------------------------------*/ |
| 15619 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15620 | ( NULL == pEventData->pEventData)) |
| 15621 | { |
| 15622 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15623 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15624 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15625 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15626 | } |
| 15627 | |
| 15628 | wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pWDICtx->pfncRspCB; |
| 15629 | |
| 15630 | /*------------------------------------------------------------------------- |
| 15631 | Extract response and send it to UMAC |
| 15632 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15633 | wpalMemoryCopy( &halStatus, |
| 15634 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15635 | sizeof(halStatus)); |
| 15636 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15637 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15638 | |
| 15639 | /*Notify UMAC*/ |
| 15640 | wdiBtAmpEventRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15641 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15642 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15643 | }/*WDI_ProcessBtAmpEventRsp*/ |
| 15644 | |
| 15645 | |
| 15646 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15647 | @brief Process ADD STA SELF Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15648 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15649 | |
| 15650 | @param pWDICtx: pointer to the WLAN DAL context |
| 15651 | pEventData: pointer to the event information structure |
| 15652 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15653 | @see |
| 15654 | @return Result of the function call |
| 15655 | */ |
| 15656 | WDI_Status |
| 15657 | WDI_ProcessAddSTASelfRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15658 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15659 | WDI_ControlBlockType* pWDICtx, |
| 15660 | WDI_EventInfoType* pEventData |
| 15661 | ) |
| 15662 | { |
| 15663 | WDI_AddSTASelfRspParamsType wdiAddSTASelfParams; |
| 15664 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb; |
| 15665 | tAddStaSelfRspMsg halAddStaSelfRsp; |
| 15666 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 15667 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15668 | |
| 15669 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15670 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15671 | -------------------------------------------------------------------------*/ |
| 15672 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15673 | ( NULL == pEventData->pEventData)) |
| 15674 | { |
| 15675 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15676 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15677 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15678 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15679 | } |
| 15680 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15681 | wdiAddSTASelfReqParamsRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15682 | (WDI_AddSTASelfParamsRspCb)pWDICtx->pfncRspCB; |
| 15683 | |
| 15684 | /*------------------------------------------------------------------------- |
| 15685 | Extract response and send it to UMAC |
| 15686 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15687 | wpalMemoryCopy( &halAddStaSelfRsp.addStaSelfRspParams, |
| 15688 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15689 | sizeof(halAddStaSelfRsp.addStaSelfRspParams)); |
| 15690 | |
| 15691 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15692 | wdiAddSTASelfParams.wdiStatus = |
| 15693 | WDI_HAL_2_WDI_STATUS(halAddStaSelfRsp.addStaSelfRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15694 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15695 | wdiAddSTASelfParams.ucSTASelfIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15696 | halAddStaSelfRsp.addStaSelfRspParams.selfStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15697 | wdiAddSTASelfParams.dpuIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15698 | halAddStaSelfRsp.addStaSelfRspParams.dpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15699 | wdiAddSTASelfParams.dpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15700 | halAddStaSelfRsp.addStaSelfRspParams.dpuSignature; |
| 15701 | |
| 15702 | wpalMemoryCopy(wdiAddSTASelfParams.macSelfSta, |
| 15703 | pWDICtx->wdiCacheAddSTASelfReq.wdiAddSTASelfInfo.selfMacAddr, |
| 15704 | WDI_MAC_ADDR_LEN); |
| 15705 | |
| 15706 | |
| 15707 | #ifdef HAL_SELF_STA_PER_BSS |
| 15708 | |
| 15709 | /* At this point add the self-STA */ |
| 15710 | |
| 15711 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 15712 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 15713 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 15714 | |
| 15715 | //all DPU indices are the same for self STA |
| 15716 | |
| 15717 | /*DPU Information*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15718 | wdiAddSTAParam.dpuIndex = wdiAddSTASelfParams.dpuIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15719 | wdiAddSTAParam.dpuSig = wdiAddSTASelfParams.dpuSignature; |
| 15720 | wdiAddSTAParam.bcastDpuSignature = wdiAddSTASelfParams.dpuSignature; |
| 15721 | wdiAddSTAParam.bcastMgmtDpuSignature = wdiAddSTASelfParams.dpuSignature; |
| 15722 | wdiAddSTAParam.bcastDpuIndex = wdiAddSTASelfParams.dpuIdx; |
| 15723 | wdiAddSTAParam.bcastMgmtDpuIndex = wdiAddSTASelfParams.dpuIdx; |
| 15724 | |
| 15725 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiAddSTASelfParams.macSelfSta, |
| 15726 | WDI_MAC_ADDR_LEN); |
| 15727 | |
| 15728 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */ |
| 15729 | wdiAddSTAParam.ucSTAIdx = wdiAddSTASelfParams.ucSTASelfIdx; |
| 15730 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15731 | if(halAddStaSelfRsp.addStaSelfRspParams.status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15732 | != eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO) |
| 15733 | { |
| 15734 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 15735 | } |
| 15736 | #endif |
| 15737 | |
| 15738 | /*Notify UMAC*/ |
| 15739 | wdiAddSTASelfReqParamsRspCb( &wdiAddSTASelfParams, pWDICtx->pRspCBUserData); |
| 15740 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15741 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15742 | }/*WDI_ProcessAddSTASelfRsp*/ |
| 15743 | |
| 15744 | |
| 15745 | |
| 15746 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15747 | @brief WDI_ProcessDelSTASelfRsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15748 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15749 | |
| 15750 | @param pWDICtx: pointer to the WLAN DAL context |
| 15751 | pEventData: pointer to the event information structure |
| 15752 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15753 | @see |
| 15754 | @return Result of the function call |
| 15755 | */ |
| 15756 | WDI_Status |
| 15757 | WDI_ProcessDelSTASelfRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15758 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15759 | WDI_ControlBlockType* pWDICtx, |
| 15760 | WDI_EventInfoType* pEventData |
| 15761 | ) |
| 15762 | { |
| 15763 | WDI_DelSTASelfRspParamsType wdiDelStaSelfRspParams; |
| 15764 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb; |
| 15765 | tDelStaSelfRspParams delStaSelfRspParams; |
| 15766 | wpt_uint8 ucStaIdx; |
| 15767 | |
| 15768 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15769 | |
| 15770 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15771 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15772 | -------------------------------------------------------------------------*/ |
| 15773 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15774 | ( NULL == pEventData->pEventData)) |
| 15775 | { |
| 15776 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15777 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15778 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15779 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15780 | } |
| 15781 | |
| 15782 | wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pWDICtx->pfncRspCB; |
| 15783 | |
| 15784 | /*------------------------------------------------------------------------- |
| 15785 | Extract response and send it to UMAC |
| 15786 | -------------------------------------------------------------------------*/ |
| 15787 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15788 | wpalMemoryCopy( &delStaSelfRspParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15789 | (wpt_uint8*)pEventData->pEventData, |
| 15790 | sizeof(tDelStaSelfRspParams)); |
| 15791 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15792 | wdiDelStaSelfRspParams.wdiStatus = |
| 15793 | WDI_HAL_2_WDI_STATUS(delStaSelfRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15794 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15795 | /* delStaSelfRspParams.status is not |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15796 | eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO*/ |
| 15797 | if( eHAL_STATUS_SUCCESS == delStaSelfRspParams.status ) |
| 15798 | { |
| 15799 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15800 | wdiStatus = WDI_STATableFindStaidByAddr(pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15801 | delStaSelfRspParams.selfMacAddr, |
| 15802 | &ucStaIdx); |
| 15803 | if(WDI_STATUS_E_FAILURE == wdiStatus) |
| 15804 | { |
| 15805 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15806 | "%s: Unable to extract the STA Idx ", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15807 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15808 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15809 | } |
| 15810 | WDI_STATableDelSta(pWDICtx, ucStaIdx); |
| 15811 | } |
| 15812 | |
| 15813 | /*Notify UMAC*/ |
| 15814 | wdiDelStaSelfRspCb(&wdiDelStaSelfRspParams, (void*) pWDICtx->pRspCBUserData); |
| 15815 | |
| 15816 | return WDI_STATUS_SUCCESS; |
| 15817 | } |
| 15818 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15819 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 15820 | /** |
| 15821 | @brief Start Oem Data Rsp function (called when a |
| 15822 | response is being received over the bus from HAL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15823 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15824 | @param pWDICtx: pointer to the WLAN DAL context |
| 15825 | pEventData: pointer to the event information structure |
| 15826 | |
| 15827 | @see |
| 15828 | @return Result of the function call |
| 15829 | */ |
| 15830 | #define OFFSET_OF(structType,fldName) (&((structType*)0)->fldName) |
| 15831 | |
| 15832 | WDI_Status |
| 15833 | WDI_ProcessStartOemDataRsp |
| 15834 | ( |
| 15835 | WDI_ControlBlockType* pWDICtx, |
| 15836 | WDI_EventInfoType* pEventData |
| 15837 | ) |
| 15838 | { |
| 15839 | WDI_oemDataRspCb wdiOemDataRspCb; |
| 15840 | WDI_oemDataRspParamsType* wdiOemDataRspParams; |
| 15841 | tStartOemDataRspParams* halStartOemDataRspParams; |
| 15842 | |
| 15843 | /*------------------------------------------------------------------------- |
| 15844 | Sanity check |
| 15845 | -------------------------------------------------------------------------*/ |
| 15846 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15847 | ( NULL == pEventData->pEventData)) |
| 15848 | { |
| 15849 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15850 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15851 | WDI_ASSERT(0); |
| 15852 | return WDI_STATUS_E_FAILURE; |
| 15853 | } |
| 15854 | |
| 15855 | wdiOemDataRspCb = (WDI_oemDataRspCb)pWDICtx->pfncRspCB; |
| 15856 | |
| 15857 | /*------------------------------------------------------------------------- |
| 15858 | Extract response and send it to UMAC |
| 15859 | -------------------------------------------------------------------------*/ |
| 15860 | halStartOemDataRspParams = (tStartOemDataRspParams *)pEventData->pEventData; |
| 15861 | |
| 15862 | |
| 15863 | //It is the responsibility of the application code to check for failure |
| 15864 | //conditions! |
| 15865 | |
| 15866 | //Allocate memory for WDI OEM DATA RSP structure |
| 15867 | wdiOemDataRspParams = wpalMemoryAllocate(sizeof(WDI_oemDataRspParamsType)) ; |
| 15868 | |
| 15869 | if(NULL == wdiOemDataRspParams) |
| 15870 | { |
| 15871 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15872 | "Failed to allocate memory in OEM DATA Response %x %x %x ", |
| 15873 | pWDICtx, pEventData, pEventData->pEventData); |
| 15874 | WDI_ASSERT(0); |
| 15875 | return WDI_STATUS_E_FAILURE; |
| 15876 | } |
| 15877 | |
| 15878 | /* Populate WDI structure members */ |
| 15879 | wpalMemoryCopy(wdiOemDataRspParams->oemDataRsp, halStartOemDataRspParams->oemDataRsp, OEM_DATA_RSP_SIZE); |
| 15880 | |
| 15881 | /*Notify UMAC*/ |
| 15882 | wdiOemDataRspCb(wdiOemDataRspParams, pWDICtx->pRspCBUserData); |
| 15883 | |
| 15884 | //Free memory allocated for WDI OEM_DATA MEAS RSP structure |
| 15885 | wpalMemoryFree(wdiOemDataRspParams); |
| 15886 | |
| 15887 | return WDI_STATUS_SUCCESS; |
| 15888 | }/*WDI_PrcoessStartOemDataRsp*/ |
| 15889 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15890 | |
| 15891 | /*=========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15892 | Miscellaneous Control Response Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15893 | ===========================================================================*/ |
| 15894 | |
| 15895 | /** |
| 15896 | @brief Process Channel Switch Rsp function (called when a response |
| 15897 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15898 | |
| 15899 | @param pWDICtx: pointer to the WLAN DAL context |
| 15900 | pEventData: pointer to the event information structure |
| 15901 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15902 | @see |
| 15903 | @return Result of the function call |
| 15904 | */ |
| 15905 | WDI_Status |
| 15906 | WDI_ProcessChannelSwitchRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15907 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15908 | WDI_ControlBlockType* pWDICtx, |
| 15909 | WDI_EventInfoType* pEventData |
| 15910 | ) |
| 15911 | { |
| 15912 | WDI_SwitchCHRspParamsType wdiSwitchChRsp; |
| 15913 | WDI_SwitchChRspCb wdiChSwitchRspCb; |
| 15914 | tSwitchChannelRspParams halSwitchChannelRsp; |
| 15915 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15916 | |
| 15917 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15918 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15919 | -------------------------------------------------------------------------*/ |
| 15920 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15921 | ( NULL == pEventData->pEventData)) |
| 15922 | { |
| 15923 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15924 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15925 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15926 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15927 | } |
| 15928 | |
| 15929 | wdiChSwitchRspCb = (WDI_SwitchChRspCb)pWDICtx->pfncRspCB; |
| 15930 | |
| 15931 | /*------------------------------------------------------------------------- |
| 15932 | Extract response and send it to UMAC |
| 15933 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15934 | wpalMemoryCopy( &halSwitchChannelRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15935 | (wpt_uint8*)pEventData->pEventData, |
| 15936 | sizeof(halSwitchChannelRsp)); |
| 15937 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15938 | wdiSwitchChRsp.wdiStatus = |
| 15939 | WDI_HAL_2_WDI_STATUS(halSwitchChannelRsp.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15940 | wdiSwitchChRsp.ucChannel = halSwitchChannelRsp.channelNumber; |
| 15941 | |
| 15942 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15943 | wdiSwitchChRsp.ucTxMgmtPower = halSwitchChannelRsp.txMgmtPower; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15944 | #endif |
| 15945 | |
| 15946 | /*Notify UMAC*/ |
| 15947 | wdiChSwitchRspCb( &wdiSwitchChRsp, pWDICtx->pRspCBUserData); |
| 15948 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15949 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15950 | }/*WDI_ProcessChannelSwitchRsp*/ |
| 15951 | |
| 15952 | |
| 15953 | /** |
| 15954 | @brief Process Config STA Rsp function (called when a response |
| 15955 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15956 | |
| 15957 | @param pWDICtx: pointer to the WLAN DAL context |
| 15958 | pEventData: pointer to the event information structure |
| 15959 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15960 | @see |
| 15961 | @return Result of the function call |
| 15962 | */ |
| 15963 | WDI_Status |
| 15964 | WDI_ProcessConfigStaRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15965 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15966 | WDI_ControlBlockType* pWDICtx, |
| 15967 | WDI_EventInfoType* pEventData |
| 15968 | ) |
| 15969 | { |
| 15970 | WDI_ConfigSTARspParamsType wdiCfgSTAParams; |
| 15971 | WDI_ConfigSTARspCb wdiConfigSTARspCb; |
| 15972 | WDI_AddStaParams wdiAddSTAParam; |
| 15973 | |
| 15974 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15975 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15976 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15977 | tConfigStaRspMsg halConfigStaRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15978 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15979 | |
| 15980 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15981 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15982 | -------------------------------------------------------------------------*/ |
| 15983 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15984 | ( NULL == pEventData->pEventData)) |
| 15985 | { |
| 15986 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15987 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15988 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15989 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15990 | } |
| 15991 | |
| 15992 | wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pWDICtx->pfncRspCB; |
| 15993 | |
| 15994 | /*------------------------------------------------------------------------- |
| 15995 | Extract response and send it to UMAC |
| 15996 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15997 | wpalMemoryCopy( &halConfigStaRsp.configStaRspParams, |
| 15998 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15999 | sizeof(halConfigStaRsp.configStaRspParams)); |
| 16000 | |
| 16001 | |
| 16002 | wdiCfgSTAParams.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx; |
| 16003 | wdiCfgSTAParams.ucBssIdx = halConfigStaRsp.configStaRspParams.bssIdx; |
| 16004 | wdiCfgSTAParams.ucUcastSig = halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 16005 | wdiCfgSTAParams.ucBcastSig = halConfigStaRsp.configStaRspParams.ucBcastSig; |
| 16006 | wdiCfgSTAParams.ucMgmtSig = halConfigStaRsp.configStaRspParams.ucMgmtSig; |
| 16007 | |
| 16008 | /* MAC Address of STA - take from cache as it does not come back in the |
| 16009 | response*/ |
| 16010 | wpalMemoryCopy( wdiCfgSTAParams.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16011 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16012 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16013 | |
| 16014 | wdiCfgSTAParams.wdiStatus = |
| 16015 | WDI_HAL_2_WDI_STATUS(halConfigStaRsp.configStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16016 | |
| 16017 | wdiCfgSTAParams.ucDpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex; |
| 16018 | wdiCfgSTAParams.ucBcastDpuIndex = halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
| 16019 | wdiCfgSTAParams.ucBcastMgmtDpuIdx = halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
| 16020 | |
| 16021 | if ( WDI_STATUS_SUCCESS == wdiCfgSTAParams.wdiStatus ) |
| 16022 | { |
| 16023 | if ( WDI_ADD_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction ) |
| 16024 | { |
| 16025 | /* ADD STA to table */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16026 | wdiAddSTAParam.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16027 | wdiAddSTAParam.dpuSig = halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 16028 | wdiAddSTAParam.dpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16029 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16030 | /*This info can be retrieved from the cached initial request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16031 | wdiAddSTAParam.ucWmmEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16032 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucWMMEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16033 | wdiAddSTAParam.ucHTCapable = |
| 16034 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucHTCapable; |
| 16035 | wdiAddSTAParam.ucStaType = |
| 16036 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiSTAType; |
| 16037 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16038 | /* MAC Address of STA */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16039 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, |
| 16040 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16041 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16042 | |
| 16043 | wpalMemoryCopy(wdiAddSTAParam.macBSSID, |
| 16044 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID , |
| 16045 | WDI_MAC_ADDR_LEN); |
| 16046 | |
| 16047 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 16048 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID, |
| 16049 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16050 | |
| 16051 | if ( NULL == pBSSSes ) |
| 16052 | { |
| 16053 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 16054 | "Association for this BSSID is not in place"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16055 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16056 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16057 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16058 | } |
| 16059 | |
| 16060 | /*Add BSS specific parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16061 | wdiAddSTAParam.bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16062 | halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16063 | wdiAddSTAParam.bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16064 | halConfigStaRsp.configStaRspParams.ucMgmtSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16065 | wdiAddSTAParam.bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16066 | halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16067 | wdiAddSTAParam.bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16068 | halConfigStaRsp.configStaRspParams.ucBcastSig; |
| 16069 | wdiAddSTAParam.ucRmfEnabled = pBSSSes->ucRmfEnabled; |
| 16070 | wdiAddSTAParam.ucBSSIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16071 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16072 | WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 16073 | } |
| 16074 | if( WDI_UPDATE_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction ) |
| 16075 | { |
| 16076 | WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable; |
| 16077 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16078 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16079 | halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16080 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16081 | halConfigStaRsp.configStaRspParams.ucBcastSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16082 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16083 | halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16084 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16085 | halConfigStaRsp.configStaRspParams.ucMgmtSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16086 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16087 | halConfigStaRsp.configStaRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16088 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16089 | halConfigStaRsp.configStaRspParams.dpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16090 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16091 | halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 16092 | } |
| 16093 | } |
| 16094 | |
| 16095 | /*Notify UMAC*/ |
| 16096 | wdiConfigSTARspCb( &wdiCfgSTAParams, pWDICtx->pRspCBUserData); |
| 16097 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16098 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16099 | }/*WDI_ProcessConfigStaRsp*/ |
| 16100 | |
| 16101 | |
| 16102 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16103 | @brief Process Set Link State Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16104 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16105 | |
| 16106 | @param pWDICtx: pointer to the WLAN DAL context |
| 16107 | pEventData: pointer to the event information structure |
| 16108 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16109 | @see |
| 16110 | @return Result of the function call |
| 16111 | */ |
| 16112 | WDI_Status |
| 16113 | WDI_ProcessSetLinkStateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16114 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16115 | WDI_ControlBlockType* pWDICtx, |
| 16116 | WDI_EventInfoType* pEventData |
| 16117 | ) |
| 16118 | { |
| 16119 | WDI_Status wdiStatus; |
| 16120 | eHalStatus halStatus; |
| 16121 | WDI_SetLinkStateRspCb wdiSetLinkStateRspCb; |
| 16122 | |
| 16123 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16124 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16125 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16126 | |
| 16127 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16128 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16129 | -------------------------------------------------------------------------*/ |
| 16130 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16131 | ( NULL == pEventData->pEventData)) |
| 16132 | { |
| 16133 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16134 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16135 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16136 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16137 | } |
| 16138 | |
| 16139 | wdiSetLinkStateRspCb = (WDI_SetLinkStateRspCb)pWDICtx->pfncRspCB; |
| 16140 | |
| 16141 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 16142 | |
| 16143 | /*If the link is being transitioned to idle - the BSS is to be deleted |
| 16144 | - this type of ending a session is possible when UMAC has failed an |
| 16145 | - association session during Join*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16146 | if ( WDI_LINK_IDLE_STATE == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16147 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState ) |
| 16148 | { |
| 16149 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16150 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16151 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16152 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 16153 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.macBSSID, |
| 16154 | &pBSSSes); |
| 16155 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16156 | /*----------------------------------------------------------------------- |
| 16157 | Del BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16158 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16159 | -----------------------------------------------------------------------*/ |
| 16160 | if ( NULL == pBSSSes ) |
| 16161 | { |
| 16162 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 16163 | "Set link response received outside association session"); |
| 16164 | } |
| 16165 | else |
| 16166 | { |
| 16167 | /* For BT AMP roles no need to delete the sessions if assoc fails. There |
| 16168 | will be del BSS coming after this to stop the beaconing & cleaning up the |
| 16169 | sessions*/ |
| 16170 | if(( WDI_BTAMP_STA_MODE != pBSSSes->wdiBssType )&& |
| 16171 | ( WDI_BTAMP_AP_MODE != pBSSSes->wdiBssType )) |
| 16172 | { |
| 16173 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16174 | The current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16175 | -----------------------------------------------------------------------*/ |
| 16176 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 16177 | |
| 16178 | /*----------------------------------------------------------------------- |
| 16179 | Check to see if this association is in progress - if so disable the |
| 16180 | flag as this has ended |
| 16181 | -----------------------------------------------------------------------*/ |
| 16182 | if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16183 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16184 | /*Association no longer in progress */ |
| 16185 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 16186 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 16187 | WDI_DequeueAssocRequest(pWDICtx); |
| 16188 | } |
| 16189 | } |
| 16190 | } |
| 16191 | } |
| 16192 | /* If the link state has been set to POST ASSOC, reset the "association in |
| 16193 | progress" flag */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16194 | if ( WDI_LINK_POSTASSOC_STATE == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16195 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState ) |
| 16196 | { |
| 16197 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 16198 | WDI_DequeueAssocRequest(pWDICtx); |
| 16199 | } |
| 16200 | |
| 16201 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 16202 | |
| 16203 | /*------------------------------------------------------------------------- |
| 16204 | Extract response and send it to UMAC |
| 16205 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16206 | wpalMemoryCopy( &halStatus, |
| 16207 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16208 | sizeof(halStatus)); |
| 16209 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16210 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16211 | |
| 16212 | /*Notify UMAC*/ |
| 16213 | wdiSetLinkStateRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16214 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16215 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16216 | }/*WDI_ProcessSetLinkStateRsp*/ |
| 16217 | |
| 16218 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16219 | @brief Process Get Stats Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16220 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16221 | |
| 16222 | @param pWDICtx: pointer to the WLAN DAL context |
| 16223 | pEventData: pointer to the event information structure |
| 16224 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16225 | @see |
| 16226 | @return Result of the function call |
| 16227 | */ |
| 16228 | WDI_Status |
| 16229 | WDI_ProcessGetStatsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16230 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16231 | WDI_ControlBlockType* pWDICtx, |
| 16232 | WDI_EventInfoType* pEventData |
| 16233 | ) |
| 16234 | { |
| 16235 | WDI_GetStatsRspParamsType *wdiGetStatsRsp; |
| 16236 | WDI_GetStatsRspCb wdiGetStatsRspCb; |
| 16237 | tHalStatsRspParams* pHalStatsRspParams; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16238 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16239 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16240 | |
| 16241 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16242 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16243 | -------------------------------------------------------------------------*/ |
| 16244 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16245 | ( NULL == pEventData->pEventData)) |
| 16246 | { |
| 16247 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16248 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16249 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16250 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16251 | } |
| 16252 | |
| 16253 | /*------------------------------------------------------------------------- |
| 16254 | Extract response and send it to UMAC |
| 16255 | -------------------------------------------------------------------------*/ |
| 16256 | pHalStatsRspParams = (tHalStatsRspParams *)pEventData->pEventData; |
| 16257 | |
| 16258 | /*allocate the stats response buffer */ |
| 16259 | wdiGetStatsRsp = (WDI_GetStatsRspParamsType *)wpalMemoryAllocate( |
| 16260 | pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams) |
| 16261 | + sizeof(WDI_GetStatsRspParamsType)); |
| 16262 | |
| 16263 | if(NULL == wdiGetStatsRsp) |
| 16264 | { |
| 16265 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 16266 | "Failed to allocate memory in Get Stats Response %x %x %x ", |
| 16267 | pWDICtx, pEventData, pEventData->pEventData); |
| 16268 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16269 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16270 | } |
| 16271 | |
| 16272 | wdiGetStatsRspCb = (WDI_GetStatsRspCb)pWDICtx->pfncRspCB; |
| 16273 | |
| 16274 | wpalMemoryZero(wdiGetStatsRsp, pHalStatsRspParams->msgLen); |
| 16275 | wdiGetStatsRsp->usMsgType = pHalStatsRspParams->msgType; |
| 16276 | wdiGetStatsRsp->usMsgLen = pHalStatsRspParams->msgLen; |
| 16277 | wdiGetStatsRsp->wdiStatus = WDI_HAL_2_WDI_STATUS(pHalStatsRspParams->status); |
| 16278 | wdiGetStatsRsp->ucSTAIdx = pHalStatsRspParams->staId; |
| 16279 | wdiGetStatsRsp->uStatsMask = pHalStatsRspParams->statsMask; |
| 16280 | |
| 16281 | /* copy the stats from buffer at the end of the tHalStatsRspParams message */ |
| 16282 | wpalMemoryCopy(wdiGetStatsRsp + 1, |
| 16283 | (wpt_uint8*)pEventData->pEventData + sizeof(tHalStatsRspParams), |
| 16284 | pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams)); |
| 16285 | |
| 16286 | /*Notify UMAC*/ |
| 16287 | wdiGetStatsRspCb( wdiGetStatsRsp, pWDICtx->pRspCBUserData); |
| 16288 | |
| 16289 | wpalMemoryFree(wdiGetStatsRsp); |
| 16290 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16291 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16292 | }/*WDI_ProcessGetStatsRsp*/ |
| 16293 | |
| 16294 | |
| 16295 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16296 | @brief Process Update Cfg Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16297 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16298 | |
| 16299 | @param pWDICtx: pointer to the WLAN DAL context |
| 16300 | pEventData: pointer to the event information structure |
| 16301 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16302 | @see |
| 16303 | @return Result of the function call |
| 16304 | */ |
| 16305 | WDI_Status |
| 16306 | WDI_ProcessUpdateCfgRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16307 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16308 | WDI_ControlBlockType* pWDICtx, |
| 16309 | WDI_EventInfoType* pEventData |
| 16310 | ) |
| 16311 | { |
| 16312 | WDI_Status wdiStatus; |
| 16313 | eHalStatus halStatus; |
| 16314 | WDI_UpdateCfgRspCb wdiUpdateCfgRspCb; |
| 16315 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16316 | |
| 16317 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16318 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16319 | -------------------------------------------------------------------------*/ |
| 16320 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16321 | ( NULL == pEventData->pEventData)) |
| 16322 | { |
| 16323 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16324 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16325 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16326 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16327 | } |
| 16328 | |
| 16329 | wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pWDICtx->pfncRspCB; |
| 16330 | |
| 16331 | /*------------------------------------------------------------------------- |
| 16332 | Extract response and send it to UMAC |
| 16333 | -------------------------------------------------------------------------*/ |
| 16334 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16335 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16336 | |
| 16337 | /*Notify UMAC*/ |
| 16338 | wdiUpdateCfgRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16339 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16340 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16341 | }/*WDI_ProcessUpdateCfgRsp*/ |
| 16342 | |
| 16343 | |
| 16344 | |
| 16345 | /** |
| 16346 | @brief Process Add BA Rsp function (called when a response |
| 16347 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16348 | |
| 16349 | @param pWDICtx: pointer to the WLAN DAL context |
| 16350 | pEventData: pointer to the event information structure |
| 16351 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16352 | @see |
| 16353 | @return Result of the function call |
| 16354 | */ |
| 16355 | WDI_Status |
| 16356 | WDI_ProcessAddBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16357 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16358 | WDI_ControlBlockType* pWDICtx, |
| 16359 | WDI_EventInfoType* pEventData |
| 16360 | ) |
| 16361 | { |
| 16362 | WDI_AddBARspCb wdiAddBARspCb; |
| 16363 | |
| 16364 | tAddBARspParams halAddBARsp; |
| 16365 | WDI_AddBARspinfoType wdiAddBARsp; |
| 16366 | |
| 16367 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16368 | |
| 16369 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16370 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16371 | -------------------------------------------------------------------------*/ |
| 16372 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16373 | ( NULL == pEventData->pEventData)) |
| 16374 | { |
| 16375 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16376 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16377 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16378 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16379 | } |
| 16380 | |
| 16381 | wdiAddBARspCb = (WDI_AddBARspCb)pWDICtx->pfncRspCB; |
| 16382 | |
| 16383 | /*------------------------------------------------------------------------- |
| 16384 | Extract response and send it to UMAC |
| 16385 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16386 | wpalMemoryCopy( &halAddBARsp, |
| 16387 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16388 | sizeof(halAddBARsp)); |
| 16389 | |
| 16390 | wdiAddBARsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halAddBARsp.status); |
| 16391 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 16392 | if ( WDI_STATUS_SUCCESS == wdiAddBARsp.wdiStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16393 | { |
| 16394 | wdiAddBARsp.ucBaDialogToken = halAddBARsp.baDialogToken; |
| 16395 | } |
| 16396 | |
| 16397 | /*Notify UMAC*/ |
| 16398 | wdiAddBARspCb( &wdiAddBARsp, pWDICtx->pRspCBUserData); |
| 16399 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16400 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16401 | }/*WDI_ProcessAddSessionBARsp*/ |
| 16402 | |
| 16403 | /** |
| 16404 | @brief Process Add BA Rsp function (called when a response |
| 16405 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16406 | |
| 16407 | @param pWDICtx: pointer to the WLAN DAL context |
| 16408 | pEventData: pointer to the event information structure |
| 16409 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16410 | @see |
| 16411 | @return Result of the function call |
| 16412 | */ |
| 16413 | WDI_Status |
| 16414 | WDI_ProcessTriggerBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16415 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16416 | WDI_ControlBlockType* pWDICtx, |
| 16417 | WDI_EventInfoType* pEventData |
| 16418 | ) |
| 16419 | { |
| 16420 | WDI_TriggerBARspCb wdiTriggerBARspCb; |
| 16421 | |
| 16422 | tTriggerBARspParams* halTriggerBARsp; |
| 16423 | tTriggerBaRspCandidate* halBaCandidate; |
| 16424 | WDI_TriggerBARspParamsType* wdiTriggerBARsp; |
| 16425 | WDI_TriggerBARspCandidateType* wdiTriggerBARspCandidate; |
| 16426 | wpt_uint16 index; |
| 16427 | wpt_uint16 TidIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16428 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16429 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16430 | |
| 16431 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16432 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16433 | -------------------------------------------------------------------------*/ |
| 16434 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16435 | ( NULL == pEventData->pEventData)) |
| 16436 | { |
| 16437 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16438 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16439 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16440 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16441 | } |
| 16442 | |
| 16443 | wdiTriggerBARspCb = (WDI_TriggerBARspCb)pWDICtx->pfncRspCB; |
| 16444 | |
| 16445 | /*------------------------------------------------------------------------- |
| 16446 | Extract response and send it to UMAC |
| 16447 | -------------------------------------------------------------------------*/ |
| 16448 | halTriggerBARsp = (tTriggerBARspParams *)pEventData->pEventData; |
| 16449 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16450 | wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType) + |
| 16451 | halTriggerBARsp->baCandidateCnt * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16452 | sizeof(WDI_TriggerBARspCandidateType)); |
| 16453 | if(NULL == wdiTriggerBARsp) |
| 16454 | { |
| 16455 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16456 | "Failed to allocate memory in Trigger BA Response %x %x %x ", |
| 16457 | pWDICtx, pEventData, pEventData->pEventData); |
| 16458 | wpalMemoryFree(halTriggerBARsp); |
| 16459 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16460 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16461 | } |
| 16462 | |
| 16463 | wdiTriggerBARsp->wdiStatus = WDI_HAL_2_WDI_STATUS(halTriggerBARsp->status); |
| 16464 | |
| 16465 | if ( WDI_STATUS_SUCCESS == wdiTriggerBARsp->wdiStatus) |
| 16466 | { |
| 16467 | wdiTriggerBARsp->usBaCandidateCnt = halTriggerBARsp->baCandidateCnt; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16468 | wpalMemoryCopy(wdiTriggerBARsp->macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16469 | halTriggerBARsp->bssId , WDI_MAC_ADDR_LEN); |
| 16470 | |
| 16471 | wdiTriggerBARspCandidate = (WDI_TriggerBARspCandidateType*)(wdiTriggerBARsp + 1); |
| 16472 | halBaCandidate = (tTriggerBaRspCandidate*)(halTriggerBARsp + 1); |
| 16473 | |
| 16474 | for(index = 0; index < wdiTriggerBARsp->usBaCandidateCnt; index++) |
| 16475 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16476 | wpalMemoryCopy(wdiTriggerBARspCandidate->macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16477 | halBaCandidate->staAddr, WDI_MAC_ADDR_LEN); |
| 16478 | for(TidIndex = 0; TidIndex < STA_MAX_TC; TidIndex++) |
| 16479 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16480 | wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].fBaEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16481 | halBaCandidate->baInfo[TidIndex].fBaEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16482 | wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].startingSeqNum = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16483 | halBaCandidate->baInfo[TidIndex].startingSeqNum; |
| 16484 | } |
| 16485 | wdiTriggerBARspCandidate++; |
| 16486 | halBaCandidate++; |
| 16487 | } |
| 16488 | } |
| 16489 | |
| 16490 | /*Notify UMAC*/ |
| 16491 | wdiTriggerBARspCb( wdiTriggerBARsp, pWDICtx->pRspCBUserData); |
| 16492 | |
| 16493 | wpalMemoryFree(wdiTriggerBARsp); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16494 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16495 | }/*WDI_ProcessAddSessionBARsp*/ |
| 16496 | |
| 16497 | /** |
| 16498 | @brief Process Update Beacon Params Rsp function (called when a response |
| 16499 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16500 | |
| 16501 | @param pWDICtx: pointer to the WLAN DAL context |
| 16502 | pEventData: pointer to the event information structure |
| 16503 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16504 | @see |
| 16505 | @return Result of the function call |
| 16506 | */ |
| 16507 | WDI_Status |
| 16508 | WDI_ProcessUpdateBeaconParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16509 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16510 | WDI_ControlBlockType* pWDICtx, |
| 16511 | WDI_EventInfoType* pEventData |
| 16512 | ) |
| 16513 | { |
| 16514 | WDI_Status wdiStatus; |
| 16515 | eHalStatus halStatus; |
| 16516 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb; |
| 16517 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16518 | |
| 16519 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16520 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16521 | -------------------------------------------------------------------------*/ |
| 16522 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16523 | ( NULL == pEventData->pEventData)) |
| 16524 | { |
| 16525 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16526 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16527 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16528 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16529 | } |
| 16530 | |
| 16531 | wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pWDICtx->pfncRspCB; |
| 16532 | |
| 16533 | /*------------------------------------------------------------------------- |
| 16534 | Extract response and send it to UMAC |
| 16535 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16536 | wpalMemoryCopy( &halStatus, |
| 16537 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16538 | sizeof(halStatus)); |
| 16539 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16540 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16541 | |
| 16542 | /*Notify UMAC*/ |
| 16543 | wdiUpdateBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16544 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16545 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16546 | }/*WDI_ProcessUpdateBeaconParamsRsp*/ |
| 16547 | |
| 16548 | /** |
| 16549 | @brief Process Send Beacon template Rsp function (called when a response |
| 16550 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16551 | |
| 16552 | @param pWDICtx: pointer to the WLAN DAL context |
| 16553 | pEventData: pointer to the event information structure |
| 16554 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16555 | @see |
| 16556 | @return Result of the function call |
| 16557 | */ |
| 16558 | WDI_Status |
| 16559 | WDI_ProcessSendBeaconParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16560 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16561 | WDI_ControlBlockType* pWDICtx, |
| 16562 | WDI_EventInfoType* pEventData |
| 16563 | ) |
| 16564 | { |
| 16565 | WDI_Status wdiStatus; |
| 16566 | eHalStatus halStatus; |
| 16567 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb; |
| 16568 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16569 | |
| 16570 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16571 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16572 | -------------------------------------------------------------------------*/ |
| 16573 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16574 | ( NULL == pEventData->pEventData)) |
| 16575 | { |
| 16576 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16577 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16578 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16579 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16580 | } |
| 16581 | |
| 16582 | wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pWDICtx->pfncRspCB; |
| 16583 | |
| 16584 | /*------------------------------------------------------------------------- |
| 16585 | Extract response and send it to UMAC |
| 16586 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16587 | wpalMemoryCopy( &halStatus, |
| 16588 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16589 | sizeof(halStatus)); |
| 16590 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16591 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16592 | |
| 16593 | /*Notify UMAC*/ |
| 16594 | wdiSendBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16595 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16596 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16597 | }/*WDI_ProcessSendBeaconParamsRsp*/ |
| 16598 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16599 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16600 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16601 | @brief Process Update Probe Resp Template Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16602 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16603 | |
| 16604 | @param pWDICtx: pointer to the WLAN DAL context |
| 16605 | pEventData: pointer to the event information structure |
| 16606 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16607 | @see |
| 16608 | @return Result of the function call |
| 16609 | */ |
| 16610 | WDI_Status |
| 16611 | WDI_ProcessUpdateProbeRspTemplateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16612 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16613 | WDI_ControlBlockType* pWDICtx, |
| 16614 | WDI_EventInfoType* pEventData |
| 16615 | ) |
| 16616 | { |
| 16617 | WDI_Status wdiStatus; |
| 16618 | eHalStatus halStatus; |
| 16619 | WDI_UpdateProbeRspTemplateRspCb wdiUpdProbeRspTemplRspCb; |
| 16620 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16621 | |
| 16622 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16623 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16624 | -------------------------------------------------------------------------*/ |
| 16625 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16626 | ( NULL == pEventData->pEventData)) |
| 16627 | { |
| 16628 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16629 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16630 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16631 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16632 | } |
| 16633 | |
| 16634 | wdiUpdProbeRspTemplRspCb = (WDI_UpdateProbeRspTemplateRspCb)pWDICtx->pfncRspCB; |
| 16635 | |
| 16636 | /*------------------------------------------------------------------------- |
| 16637 | Extract response and send it to UMAC |
| 16638 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16639 | wpalMemoryCopy( &halStatus, |
| 16640 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16641 | sizeof(halStatus)); |
| 16642 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16643 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16644 | |
| 16645 | /*Notify UMAC*/ |
| 16646 | wdiUpdProbeRspTemplRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16647 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16648 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16649 | }/*WDI_ProcessUpdateProbeRspTemplateRsp*/ |
| 16650 | |
| 16651 | /** |
| 16652 | @brief Process Set Max Tx Power Rsp function (called when a response |
| 16653 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16654 | |
| 16655 | @param pWDICtx: pointer to the WLAN DAL context |
| 16656 | pEventData: pointer to the event information structure |
| 16657 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16658 | @see |
| 16659 | @return Result of the function call |
| 16660 | */ |
| 16661 | WDI_Status |
| 16662 | WDI_ProcessSetMaxTxPowerRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16663 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16664 | WDI_ControlBlockType* pWDICtx, |
| 16665 | WDI_EventInfoType* pEventData |
| 16666 | ) |
| 16667 | { |
| 16668 | tSetMaxTxPwrRspMsg halTxpowerrsp; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16669 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16670 | WDI_SetMaxTxPowerRspMsg wdiSetMaxTxPowerRspMsg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16671 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16672 | WDA_SetMaxTxPowerRspCb wdiReqStatusCb; |
| 16673 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16674 | |
| 16675 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16676 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16677 | -------------------------------------------------------------------------*/ |
| 16678 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16679 | ( NULL == pEventData->pEventData)) |
| 16680 | { |
| 16681 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16682 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16683 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16684 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16685 | } |
| 16686 | |
| 16687 | wdiReqStatusCb = (WDA_SetMaxTxPowerRspCb)pWDICtx->pfncRspCB; |
| 16688 | |
| 16689 | /*------------------------------------------------------------------------- |
| 16690 | Extract response and send it to UMAC |
| 16691 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16692 | wpalMemoryCopy( &halTxpowerrsp.setMaxTxPwrRspParams, |
| 16693 | pEventData->pEventData, |
| 16694 | sizeof(halTxpowerrsp.setMaxTxPwrRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16695 | |
| 16696 | if ( eHAL_STATUS_SUCCESS != halTxpowerrsp.setMaxTxPwrRspParams.status ) |
| 16697 | { |
| 16698 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 16699 | "Error status returned in Set Max Tx Power Response "); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16700 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 16701 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16702 | } |
| 16703 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16704 | wdiSetMaxTxPowerRspMsg.wdiStatus = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16705 | WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setMaxTxPwrRspParams.status); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16706 | wdiSetMaxTxPowerRspMsg.ucPower = halTxpowerrsp.setMaxTxPwrRspParams.power; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16707 | |
| 16708 | /*Notify UMAC*/ |
| 16709 | wdiReqStatusCb( &wdiSetMaxTxPowerRspMsg, pWDICtx->pRspCBUserData); |
| 16710 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16711 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16712 | } |
| 16713 | |
| 16714 | #ifdef WLAN_FEATURE_P2P |
| 16715 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16716 | @brief Process P2P Group Owner Notice Of Absense Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16717 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16718 | |
| 16719 | @param pWDICtx: pointer to the WLAN DAL context |
| 16720 | pEventData: pointer to the event information structure |
| 16721 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16722 | @see |
| 16723 | @return Result of the function call |
| 16724 | */ |
| 16725 | WDI_Status |
| 16726 | WDI_ProcessP2PGONOARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16727 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16728 | WDI_ControlBlockType* pWDICtx, |
| 16729 | WDI_EventInfoType* pEventData |
| 16730 | ) |
| 16731 | { |
| 16732 | WDI_Status wdiStatus; |
| 16733 | eHalStatus halStatus; |
| 16734 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb; |
| 16735 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16736 | |
| 16737 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16738 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16739 | -------------------------------------------------------------------------*/ |
| 16740 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16741 | ( NULL == pEventData->pEventData)) |
| 16742 | { |
| 16743 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16744 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16745 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16746 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16747 | } |
| 16748 | |
| 16749 | wdiP2PGONOAReqParamsRspCb = (WDI_SetP2PGONOAReqParamsRspCb)pWDICtx->pfncRspCB; |
| 16750 | |
| 16751 | /*------------------------------------------------------------------------- |
| 16752 | Extract response and send it to UMAC |
| 16753 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16754 | wpalMemoryCopy( &halStatus, |
| 16755 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16756 | sizeof(halStatus)); |
| 16757 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16758 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16759 | |
| 16760 | /*Notify UMAC*/ |
| 16761 | wdiP2PGONOAReqParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16762 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16763 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16764 | }/*WDI_ProcessP2PGONOARsp*/ |
| 16765 | #endif |
| 16766 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16767 | @brief Process Enter IMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16768 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16769 | |
| 16770 | @param pWDICtx: pointer to the WLAN DAL context |
| 16771 | pEventData: pointer to the event information structure |
| 16772 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16773 | @see |
| 16774 | @return Result of the function call |
| 16775 | */ |
| 16776 | WDI_Status |
| 16777 | WDI_ProcessEnterImpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16778 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16779 | WDI_ControlBlockType* pWDICtx, |
| 16780 | WDI_EventInfoType* pEventData |
| 16781 | ) |
| 16782 | { |
| 16783 | WDI_Status wdiStatus; |
| 16784 | eHalStatus halStatus; |
| 16785 | WDI_EnterImpsRspCb wdiEnterImpsRspCb; |
| 16786 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16787 | |
| 16788 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16789 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16790 | -------------------------------------------------------------------------*/ |
| 16791 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16792 | ( NULL == pEventData->pEventData)) |
| 16793 | { |
| 16794 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16795 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16796 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16797 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16798 | } |
| 16799 | |
| 16800 | wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pWDICtx->pfncRspCB; |
| 16801 | |
| 16802 | /*------------------------------------------------------------------------- |
| 16803 | Extract response and send it to UMAC |
| 16804 | -------------------------------------------------------------------------*/ |
| 16805 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 16806 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16807 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16808 | |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 16809 | /* If IMPS req failed, riva is not power collapsed Put the DXE in FULL state. |
| 16810 | * Other module states are taken care by PMC. |
| 16811 | * TODO: How do we take care of the case where IMPS is success, but riva power collapse fails?? |
| 16812 | */ |
| 16813 | if (wdiStatus != WDI_STATUS_SUCCESS) { |
| 16814 | |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 16815 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 16816 | "WDI Process Enter IMPS RSP failed With HAL Status Code: %d", |
| 16817 | halStatus); |
| 16818 | /* Call Back is not required as we are putting the DXE in FULL |
| 16819 | * and riva is already in full (IMPS RSP Failed)*/ |
| 16820 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 16821 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16822 | /*Notify UMAC*/ |
| 16823 | wdiEnterImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16824 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16825 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16826 | }/*WDI_ProcessEnterImpsRsp*/ |
| 16827 | |
| 16828 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16829 | @brief Process Exit IMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16830 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16831 | |
| 16832 | @param pWDICtx: pointer to the WLAN DAL context |
| 16833 | pEventData: pointer to the event information structure |
| 16834 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16835 | @see |
| 16836 | @return Result of the function call |
| 16837 | */ |
| 16838 | WDI_Status |
| 16839 | WDI_ProcessExitImpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16840 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16841 | WDI_ControlBlockType* pWDICtx, |
| 16842 | WDI_EventInfoType* pEventData |
| 16843 | ) |
| 16844 | { |
| 16845 | WDI_Status wdiStatus; |
| 16846 | eHalStatus halStatus; |
| 16847 | WDI_ExitImpsRspCb wdiExitImpsRspCb; |
| 16848 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16849 | |
| 16850 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16851 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16852 | -------------------------------------------------------------------------*/ |
| 16853 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16854 | ( NULL == pEventData->pEventData)) |
| 16855 | { |
| 16856 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16857 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16858 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16859 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16860 | } |
| 16861 | |
| 16862 | wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pWDICtx->pfncRspCB; |
| 16863 | |
| 16864 | /*------------------------------------------------------------------------- |
| 16865 | Extract response and send it to UMAC |
| 16866 | -------------------------------------------------------------------------*/ |
| 16867 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16868 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16869 | |
| 16870 | // notify DTS that we are entering Full power |
| 16871 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 16872 | |
| 16873 | /*Notify UMAC*/ |
| 16874 | wdiExitImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16875 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16876 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16877 | }/*WDI_ProcessExitImpsRsp*/ |
| 16878 | |
| 16879 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16880 | @brief Process Enter BMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16881 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16882 | |
| 16883 | @param pWDICtx: pointer to the WLAN DAL context |
| 16884 | pEventData: pointer to the event information structure |
| 16885 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16886 | @see |
| 16887 | @return Result of the function call |
| 16888 | */ |
| 16889 | WDI_Status |
| 16890 | WDI_ProcessEnterBmpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16891 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16892 | WDI_ControlBlockType* pWDICtx, |
| 16893 | WDI_EventInfoType* pEventData |
| 16894 | ) |
| 16895 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16896 | eHalStatus halStatus = eHAL_STATUS_FAILURE; |
| 16897 | tHalEnterBmpsRspParams halEnterBmpsRsp; |
| 16898 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb; |
| 16899 | WDI_EnterBmpsRspParamsType wdiEnterBmpsRspparams; |
| 16900 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16901 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16902 | |
| 16903 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16904 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16905 | -------------------------------------------------------------------------*/ |
| 16906 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16907 | ( NULL == pEventData->pEventData)) |
| 16908 | { |
| 16909 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16910 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16911 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16912 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16913 | } |
| 16914 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16915 | /*------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16916 | Extract response and send it to UMAC |
| 16917 | -------------------------------------------------------------------------*/ |
| 16918 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 16919 | { |
| 16920 | wpalMemoryCopy( &halEnterBmpsRsp, |
| 16921 | pEventData->pEventData, |
| 16922 | sizeof(halEnterBmpsRsp)); |
| 16923 | |
| 16924 | //Used to print debug message |
| 16925 | halStatus = halEnterBmpsRsp.status; |
| 16926 | wdiEnterBmpsRspparams.wdiStatus = WDI_HAL_2_WDI_STATUS(halEnterBmpsRsp.status); |
| 16927 | wdiEnterBmpsRspparams.bssIdx = halEnterBmpsRsp.bssIdx; |
| 16928 | } |
| 16929 | else |
| 16930 | { |
| 16931 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 16932 | wdiEnterBmpsRspparams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 16933 | } |
| 16934 | |
| 16935 | wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16936 | |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 16937 | /* If BMPS req failed, riva is not power collapsed put the DXE in FULL state. |
| 16938 | * Other module states are taken care by PMC. |
| 16939 | * TODO: How do we take care of the case where BMPS is success, but riva power collapse fails?? |
| 16940 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16941 | if (wdiEnterBmpsRspparams.wdiStatus != WDI_STATUS_SUCCESS) |
| 16942 | { |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 16943 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16944 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 16945 | "WDI Process Enter BMPS RSP failed With HAL Status Code: %d", |
| 16946 | halStatus); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16947 | /* Call Back is not required as we are putting the DXE in FULL |
| 16948 | * and riva is already in FULL (BMPS RSP Failed)*/ |
| 16949 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 16950 | pWDICtx->bInBmps = eWLAN_PAL_FALSE; |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 16951 | } |
| 16952 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16953 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16954 | wdiEnterBmpsRspCb( &wdiEnterBmpsRspparams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16955 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16956 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16957 | }/*WDI_ProcessEnterBmpsRsp*/ |
| 16958 | |
| 16959 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16960 | @brief Process Exit BMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16961 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16962 | |
| 16963 | @param pWDICtx: pointer to the WLAN DAL context |
| 16964 | pEventData: pointer to the event information structure |
| 16965 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16966 | @see |
| 16967 | @return Result of the function call |
| 16968 | */ |
| 16969 | WDI_Status |
| 16970 | WDI_ProcessExitBmpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16971 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16972 | WDI_ControlBlockType* pWDICtx, |
| 16973 | WDI_EventInfoType* pEventData |
| 16974 | ) |
| 16975 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16976 | eHalStatus halStatus; |
| 16977 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16978 | tHalExitBmpsRspParams halExitBmpsRsp; |
| 16979 | WDI_ExitBmpsRspParamsType wdiExitBmpsRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16980 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16981 | |
| 16982 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16983 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16984 | -------------------------------------------------------------------------*/ |
| 16985 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16986 | ( NULL == pEventData->pEventData)) |
| 16987 | { |
| 16988 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16989 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16990 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16991 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16992 | } |
| 16993 | |
| 16994 | wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pWDICtx->pfncRspCB; |
| 16995 | |
| 16996 | /*------------------------------------------------------------------------- |
| 16997 | Extract response and send it to UMAC |
| 16998 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 16999 | |
| 17000 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17001 | { |
| 17002 | wpalMemoryCopy( &halExitBmpsRsp, |
| 17003 | pEventData->pEventData, |
| 17004 | sizeof(halExitBmpsRsp)); |
| 17005 | |
| 17006 | wdiExitBmpsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halExitBmpsRsp.status); |
| 17007 | wdiExitBmpsRspParams.bssIdx = halExitBmpsRsp.bssIdx; |
| 17008 | } |
| 17009 | else |
| 17010 | { |
| 17011 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17012 | wdiExitBmpsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17013 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17014 | |
| 17015 | // notify DTS that we are entering Full power |
| 17016 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 17017 | |
| 17018 | pWDICtx->bInBmps = eWLAN_PAL_FALSE; |
| 17019 | |
| 17020 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17021 | wdiExitBmpsRspCb( &wdiExitBmpsRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17022 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17023 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17024 | }/*WDI_ProcessExitBmpsRsp*/ |
| 17025 | |
| 17026 | /** |
| 17027 | @brief Process Enter UAPSD Rsp function (called when a response |
| 17028 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17029 | |
| 17030 | @param pWDICtx: pointer to the WLAN DAL context |
| 17031 | pEventData: pointer to the event information structure |
| 17032 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17033 | @see |
| 17034 | @return Result of the function call |
| 17035 | */ |
| 17036 | WDI_Status |
| 17037 | WDI_ProcessEnterUapsdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17038 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17039 | WDI_ControlBlockType* pWDICtx, |
| 17040 | WDI_EventInfoType* pEventData |
| 17041 | ) |
| 17042 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17043 | eHalStatus halStatus; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17044 | tUapsdRspParams halEnterUapsdRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17045 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17046 | WDI_EnterUapsdRspParamsType wdiEnterUapsdRspParams; |
| 17047 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17048 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17049 | |
| 17050 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17051 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17052 | -------------------------------------------------------------------------*/ |
| 17053 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17054 | ( NULL == pEventData->pEventData)) |
| 17055 | { |
| 17056 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17057 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17058 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17059 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17060 | } |
| 17061 | |
| 17062 | wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pWDICtx->pfncRspCB; |
| 17063 | |
| 17064 | /*------------------------------------------------------------------------- |
| 17065 | Extract response and send it to UMAC |
| 17066 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17067 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17068 | { |
| 17069 | wpalMemoryCopy( &halEnterUapsdRsp, |
| 17070 | pEventData->pEventData, |
| 17071 | sizeof(halEnterUapsdRsp)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17072 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17073 | wdiEnterUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halEnterUapsdRsp.status); |
| 17074 | wdiEnterUapsdRspParams.bssIdx = halEnterUapsdRsp.bssIdx; |
| 17075 | } |
| 17076 | else |
| 17077 | { |
| 17078 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17079 | wdiEnterUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17080 | } |
| 17081 | |
| 17082 | if(WDI_STATUS_SUCCESS == wdiEnterUapsdRspParams.wdiStatus) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17083 | { |
| 17084 | // Set the DPU routing flag to the FW WQ, all the TX frames would be now pushed |
| 17085 | // from DPU to the FW-WQ (5) in UAPSD. FW would be in data path, monitoring |
| 17086 | // the traffic to decide when to suspend the trigger frames when there is no traffic |
| 17087 | // activity on the trigger enabled ACs |
| 17088 | pWDICtx->ucDpuRF = BMUWQ_FW_DPU_TX; |
| 17089 | |
| 17090 | #ifdef WLAN_PERF |
| 17091 | // Increment the BD signature to refresh the fast path BD utilization |
| 17092 | pWDICtx->uBdSigSerialNum++; |
| 17093 | #endif |
| 17094 | } |
| 17095 | |
| 17096 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17097 | wdiEnterUapsdRspCb( &wdiEnterUapsdRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17098 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17099 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17100 | }/*WDI_ProcessEnterUapsdRsp*/ |
| 17101 | |
| 17102 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17103 | @brief Process Exit UAPSD Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17104 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17105 | |
| 17106 | @param pWDICtx: pointer to the WLAN DAL context |
| 17107 | pEventData: pointer to the event information structure |
| 17108 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17109 | @see |
| 17110 | @return Result of the function call |
| 17111 | */ |
| 17112 | WDI_Status |
| 17113 | WDI_ProcessExitUapsdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17114 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17115 | WDI_ControlBlockType* pWDICtx, |
| 17116 | WDI_EventInfoType* pEventData |
| 17117 | ) |
| 17118 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17119 | eHalStatus halStatus; |
| 17120 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17121 | tHalExitUapsdRspParams halExitUapsdRsp; |
| 17122 | WDI_ExitUapsdRspParamsType wdiExitUapsdRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17123 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17124 | |
| 17125 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17126 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17127 | -------------------------------------------------------------------------*/ |
| 17128 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17129 | ( NULL == pEventData->pEventData)) |
| 17130 | { |
| 17131 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17132 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17133 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17134 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17135 | } |
| 17136 | |
| 17137 | wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pWDICtx->pfncRspCB; |
| 17138 | |
| 17139 | /*------------------------------------------------------------------------- |
| 17140 | Extract response and send it to UMAC |
| 17141 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17142 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17143 | { |
| 17144 | wpalMemoryCopy( &halExitUapsdRsp, |
| 17145 | pEventData->pEventData, |
| 17146 | sizeof(halExitUapsdRsp)); |
| 17147 | |
| 17148 | wdiExitUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halExitUapsdRsp.status); |
| 17149 | wdiExitUapsdRspParams.bssIdx = halExitUapsdRsp.bssIdx; |
| 17150 | } |
| 17151 | else |
| 17152 | { |
| 17153 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17154 | wdiExitUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17155 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17156 | // Restore back the DPU routing flag in the TxBD, for DPU to push the TxBDs to BTQM |
| 17157 | // directly instead of the FW WQ. |
| 17158 | pWDICtx->ucDpuRF = BMUWQ_BTQM_TX_MGMT; |
| 17159 | |
| 17160 | #ifdef WLAN_PERF |
| 17161 | // Increment the BD signature to refresh the fast path BD utilization |
| 17162 | pWDICtx->uBdSigSerialNum++; |
| 17163 | #endif |
| 17164 | |
| 17165 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17166 | wdiExitUapsdRspCb( &wdiExitUapsdRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17167 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17168 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17169 | }/*WDI_ProcessExitUapsdRsp*/ |
| 17170 | |
| 17171 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17172 | @brief Process set UAPSD params Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17173 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17174 | |
| 17175 | @param pWDICtx: pointer to the WLAN DAL context |
| 17176 | pEventData: pointer to the event information structure |
| 17177 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17178 | @see |
| 17179 | @return Result of the function call |
| 17180 | */ |
| 17181 | WDI_Status |
| 17182 | WDI_ProcessSetUapsdAcParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17183 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17184 | WDI_ControlBlockType* pWDICtx, |
| 17185 | WDI_EventInfoType* pEventData |
| 17186 | ) |
| 17187 | { |
| 17188 | WDI_Status wdiStatus; |
| 17189 | eHalStatus halStatus; |
| 17190 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb; |
| 17191 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17192 | |
| 17193 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17194 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17195 | -------------------------------------------------------------------------*/ |
| 17196 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17197 | ( NULL == pEventData->pEventData)) |
| 17198 | { |
| 17199 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17200 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17201 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17202 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17203 | } |
| 17204 | |
| 17205 | wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pWDICtx->pfncRspCB; |
| 17206 | |
| 17207 | /*------------------------------------------------------------------------- |
| 17208 | Extract response and send it to UMAC |
| 17209 | -------------------------------------------------------------------------*/ |
| 17210 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17211 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17212 | |
| 17213 | /*Notify UMAC*/ |
| 17214 | wdiSetUapsdAcParamsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17215 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17216 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17217 | }/*WDI_ProcessSetUapsdAcParamsRsp*/ |
| 17218 | |
| 17219 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17220 | @brief Process update UAPSD params Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17221 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17222 | |
| 17223 | @param pWDICtx: pointer to the WLAN DAL context |
| 17224 | pEventData: pointer to the event information structure |
| 17225 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17226 | @see |
| 17227 | @return Result of the function call |
| 17228 | */ |
| 17229 | WDI_Status |
| 17230 | WDI_ProcessUpdateUapsdParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17231 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17232 | WDI_ControlBlockType* pWDICtx, |
| 17233 | WDI_EventInfoType* pEventData |
| 17234 | ) |
| 17235 | { |
| 17236 | WDI_Status wdiStatus; |
| 17237 | eHalStatus halStatus; |
| 17238 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb; |
| 17239 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17240 | |
| 17241 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17242 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17243 | -------------------------------------------------------------------------*/ |
| 17244 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17245 | ( NULL == pEventData->pEventData)) |
| 17246 | { |
| 17247 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17248 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17249 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17250 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17251 | } |
| 17252 | |
| 17253 | wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pWDICtx->pfncRspCB; |
| 17254 | |
| 17255 | /*------------------------------------------------------------------------- |
| 17256 | Extract response and send it to UMAC |
| 17257 | -------------------------------------------------------------------------*/ |
| 17258 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17259 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17260 | |
| 17261 | /*Notify UMAC*/ |
| 17262 | wdiUpdateUapsdParamsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17263 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17264 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17265 | }/*WDI_ProcessUpdateUapsdParamsRsp*/ |
| 17266 | |
| 17267 | /** |
| 17268 | @brief Process Configure RXP filter Rsp function (called when a |
| 17269 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17270 | |
| 17271 | @param pWDICtx: pointer to the WLAN DAL context |
| 17272 | pEventData: pointer to the event information structure |
| 17273 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17274 | @see |
| 17275 | @return Result of the function call |
| 17276 | */ |
| 17277 | WDI_Status |
| 17278 | WDI_ProcessConfigureRxpFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17279 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17280 | WDI_ControlBlockType* pWDICtx, |
| 17281 | WDI_EventInfoType* pEventData |
| 17282 | ) |
| 17283 | { |
| 17284 | WDI_Status wdiStatus; |
| 17285 | eHalStatus halStatus; |
| 17286 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb; |
| 17287 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17288 | |
| 17289 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17290 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17291 | -------------------------------------------------------------------------*/ |
| 17292 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17293 | ( NULL == pEventData->pEventData)) |
| 17294 | { |
| 17295 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17296 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17297 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17298 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17299 | } |
| 17300 | |
| 17301 | wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pWDICtx->pfncRspCB; |
| 17302 | |
| 17303 | /*------------------------------------------------------------------------- |
| 17304 | Extract response and send it to UMAC |
| 17305 | -------------------------------------------------------------------------*/ |
| 17306 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17307 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17308 | |
| 17309 | /*Notify UMAC*/ |
| 17310 | wdiConfigureRxpFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17311 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17312 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17313 | }/*WDI_ProcessConfigureRxpFilterRsp*/ |
| 17314 | |
| 17315 | /** |
| 17316 | @brief Process Set beacon filter Rsp function (called when a |
| 17317 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17318 | |
| 17319 | @param pWDICtx: pointer to the WLAN DAL context |
| 17320 | pEventData: pointer to the event information structure |
| 17321 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17322 | @see |
| 17323 | @return Result of the function call |
| 17324 | */ |
| 17325 | WDI_Status |
| 17326 | WDI_ProcessSetBeaconFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17327 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17328 | WDI_ControlBlockType* pWDICtx, |
| 17329 | WDI_EventInfoType* pEventData |
| 17330 | ) |
| 17331 | { |
| 17332 | WDI_Status wdiStatus; |
| 17333 | eHalStatus halStatus; |
| 17334 | WDI_SetBeaconFilterCb wdiBeaconFilterCb; |
| 17335 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17336 | |
| 17337 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17338 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17339 | -------------------------------------------------------------------------*/ |
| 17340 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17341 | ( NULL == pEventData->pEventData)) |
| 17342 | { |
| 17343 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17344 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17345 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17346 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17347 | } |
| 17348 | |
| 17349 | wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pWDICtx->pfncRspCB; |
| 17350 | |
| 17351 | /*------------------------------------------------------------------------- |
| 17352 | Extract response and send it to UMAC |
| 17353 | -------------------------------------------------------------------------*/ |
| 17354 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17355 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17356 | |
| 17357 | /*Notify UMAC*/ |
| 17358 | wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17359 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17360 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17361 | }/*WDI_ProcessSetBeaconFilterRsp*/ |
| 17362 | |
| 17363 | /** |
| 17364 | @brief Process remove beacon filter Rsp function (called when a |
| 17365 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17366 | |
| 17367 | @param pWDICtx: pointer to the WLAN DAL context |
| 17368 | pEventData: pointer to the event information structure |
| 17369 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17370 | @see |
| 17371 | @return Result of the function call |
| 17372 | */ |
| 17373 | WDI_Status |
| 17374 | WDI_ProcessRemBeaconFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17375 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17376 | WDI_ControlBlockType* pWDICtx, |
| 17377 | WDI_EventInfoType* pEventData |
| 17378 | ) |
| 17379 | { |
| 17380 | WDI_Status wdiStatus; |
| 17381 | eHalStatus halStatus; |
| 17382 | WDI_RemBeaconFilterCb wdiBeaconFilterCb; |
| 17383 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17384 | |
| 17385 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17386 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17387 | -------------------------------------------------------------------------*/ |
| 17388 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17389 | ( NULL == pEventData->pEventData)) |
| 17390 | { |
| 17391 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17392 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17393 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17394 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17395 | } |
| 17396 | |
| 17397 | wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pWDICtx->pfncRspCB; |
| 17398 | |
| 17399 | /*------------------------------------------------------------------------- |
| 17400 | Extract response and send it to UMAC |
| 17401 | -------------------------------------------------------------------------*/ |
| 17402 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17403 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17404 | |
| 17405 | /*Notify UMAC*/ |
| 17406 | wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17407 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17408 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17409 | }/*WDI_ProcessRemBeaconFilterRsp*/ |
| 17410 | |
| 17411 | /** |
| 17412 | @brief Process set RSSI thresholds Rsp function (called when a |
| 17413 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17414 | |
| 17415 | @param pWDICtx: pointer to the WLAN DAL context |
| 17416 | pEventData: pointer to the event information structure |
| 17417 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17418 | @see |
| 17419 | @return Result of the function call |
| 17420 | */ |
| 17421 | WDI_Status |
| 17422 | WDI_ProcessSetRSSIThresoldsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17423 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17424 | WDI_ControlBlockType* pWDICtx, |
| 17425 | WDI_EventInfoType* pEventData |
| 17426 | ) |
| 17427 | { |
| 17428 | WDI_Status wdiStatus; |
| 17429 | eHalStatus halStatus; |
| 17430 | WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb; |
| 17431 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17432 | |
| 17433 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17434 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17435 | -------------------------------------------------------------------------*/ |
| 17436 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17437 | ( NULL == pEventData->pEventData)) |
| 17438 | { |
| 17439 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17440 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17441 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17442 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17443 | } |
| 17444 | |
| 17445 | wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pWDICtx->pfncRspCB; |
| 17446 | |
| 17447 | /*------------------------------------------------------------------------- |
| 17448 | Extract response and send it to UMAC |
| 17449 | -------------------------------------------------------------------------*/ |
| 17450 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17451 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17452 | |
| 17453 | /*Notify UMAC*/ |
| 17454 | wdiRSSIThresholdsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17455 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17456 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17457 | }/*WDI_ProcessSetRSSIThresoldsRsp*/ |
| 17458 | |
| 17459 | /** |
| 17460 | @brief Process host offload Rsp function (called when a |
| 17461 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17462 | |
| 17463 | @param pWDICtx: pointer to the WLAN DAL context |
| 17464 | pEventData: pointer to the event information structure |
| 17465 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17466 | @see |
| 17467 | @return Result of the function call |
| 17468 | */ |
| 17469 | WDI_Status |
| 17470 | WDI_ProcessHostOffloadRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17471 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17472 | WDI_ControlBlockType* pWDICtx, |
| 17473 | WDI_EventInfoType* pEventData |
| 17474 | ) |
| 17475 | { |
| 17476 | WDI_Status wdiStatus; |
| 17477 | eHalStatus halStatus; |
| 17478 | WDI_HostOffloadCb wdiHostOffloadCb; |
| 17479 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17480 | |
| 17481 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17482 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17483 | -------------------------------------------------------------------------*/ |
| 17484 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17485 | ( NULL == pEventData->pEventData)) |
| 17486 | { |
| 17487 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17488 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17489 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17490 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17491 | } |
| 17492 | |
| 17493 | wdiHostOffloadCb = (WDI_HostOffloadCb)pWDICtx->pfncRspCB; |
| 17494 | |
| 17495 | /*------------------------------------------------------------------------- |
| 17496 | Extract response and send it to UMAC |
| 17497 | -------------------------------------------------------------------------*/ |
| 17498 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17499 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17500 | |
| 17501 | /*Notify UMAC*/ |
| 17502 | wdiHostOffloadCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17503 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17504 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17505 | }/*WDI_ProcessHostOffloadRsp*/ |
| 17506 | |
| 17507 | /** |
| 17508 | @brief Process keep alive Rsp function (called when a |
| 17509 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17510 | |
| 17511 | @param pWDICtx: pointer to the WLAN DAL context |
| 17512 | pEventData: pointer to the event information structure |
| 17513 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17514 | @see |
| 17515 | @return Result of the function call |
| 17516 | */ |
| 17517 | WDI_Status |
| 17518 | WDI_ProcessKeepAliveRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17519 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17520 | WDI_ControlBlockType* pWDICtx, |
| 17521 | WDI_EventInfoType* pEventData |
| 17522 | ) |
| 17523 | { |
| 17524 | WDI_Status wdiStatus; |
| 17525 | eHalStatus halStatus; |
| 17526 | WDI_KeepAliveCb wdiKeepAliveCb; |
| 17527 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17528 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 17529 | "Received WDI_ProcessKeepAliveRsp Callback from HAL"); |
| 17530 | |
| 17531 | |
| 17532 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17533 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17534 | -------------------------------------------------------------------------*/ |
| 17535 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17536 | ( NULL == pEventData->pEventData)) |
| 17537 | { |
| 17538 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17539 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17540 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17541 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17542 | } |
| 17543 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17544 | wdiKeepAliveCb = (WDI_KeepAliveCb)pWDICtx->pfncRspCB; |
| 17545 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17546 | /*------------------------------------------------------------------------- |
| 17547 | Extract response and send it to UMAC |
| 17548 | -------------------------------------------------------------------------*/ |
| 17549 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17550 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17551 | |
| 17552 | /*Notify UMAC*/ |
| 17553 | wdiKeepAliveCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17554 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17555 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17556 | }/*WDI_ProcessKeepAliveRsp*/ |
| 17557 | |
| 17558 | /** |
| 17559 | @brief Process wowl add ptrn Rsp function (called when a |
| 17560 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17561 | |
| 17562 | @param pWDICtx: pointer to the WLAN DAL context |
| 17563 | pEventData: pointer to the event information structure |
| 17564 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17565 | @see |
| 17566 | @return Result of the function call |
| 17567 | */ |
| 17568 | WDI_Status |
| 17569 | WDI_ProcessWowlAddBcPtrnRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17570 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17571 | WDI_ControlBlockType* pWDICtx, |
| 17572 | WDI_EventInfoType* pEventData |
| 17573 | ) |
| 17574 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17575 | eHalStatus halStatus; |
| 17576 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17577 | tHalAddWowlBcastPtrnRspParams halAddWowlBcastPtrRsp; |
| 17578 | WDI_WowlAddBcPtrnRspParamsType wdiWowlAddBcPtrRsp; |
| 17579 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17580 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17581 | |
| 17582 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17583 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17584 | -------------------------------------------------------------------------*/ |
| 17585 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17586 | ( NULL == pEventData->pEventData)) |
| 17587 | { |
| 17588 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17589 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17590 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17591 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17592 | } |
| 17593 | |
| 17594 | wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pWDICtx->pfncRspCB; |
| 17595 | |
| 17596 | /*------------------------------------------------------------------------- |
| 17597 | Extract response and send it to UMAC |
| 17598 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17599 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17600 | { |
| 17601 | wpalMemoryCopy( &halAddWowlBcastPtrRsp, |
| 17602 | pEventData->pEventData, |
| 17603 | sizeof(halAddWowlBcastPtrRsp)); |
| 17604 | |
| 17605 | wdiWowlAddBcPtrRsp.wdiStatus = |
| 17606 | WDI_HAL_2_WDI_STATUS(halAddWowlBcastPtrRsp.status); |
| 17607 | } |
| 17608 | else |
| 17609 | { |
| 17610 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17611 | wdiWowlAddBcPtrRsp.wdiStatus = |
| 17612 | WDI_HAL_2_WDI_STATUS(halStatus); |
| 17613 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17614 | |
| 17615 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17616 | wdiWowlAddBcPtrnCb( &wdiWowlAddBcPtrRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17617 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17618 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17619 | }/*WDI_ProcessWowlAddBcPtrnRsp*/ |
| 17620 | |
| 17621 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17622 | @brief Process wowl delete ptrn Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17623 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17624 | |
| 17625 | @param pWDICtx: pointer to the WLAN DAL context |
| 17626 | pEventData: pointer to the event information structure |
| 17627 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17628 | @see |
| 17629 | @return Result of the function call |
| 17630 | */ |
| 17631 | WDI_Status |
| 17632 | WDI_ProcessWowlDelBcPtrnRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17633 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17634 | WDI_ControlBlockType* pWDICtx, |
| 17635 | WDI_EventInfoType* pEventData |
| 17636 | ) |
| 17637 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17638 | eHalStatus halStatus; |
| 17639 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17640 | tHalDelWowlBcastPtrnRspParams halDelWowlBcastPtrRsp; |
| 17641 | WDI_WowlDelBcPtrnRspParamsType wdiWowlDelBcstPtrRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17642 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17643 | |
| 17644 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17645 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17646 | -------------------------------------------------------------------------*/ |
| 17647 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17648 | ( NULL == pEventData->pEventData)) |
| 17649 | { |
| 17650 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17651 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17652 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17653 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17654 | } |
| 17655 | |
| 17656 | wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pWDICtx->pfncRspCB; |
| 17657 | |
| 17658 | /*------------------------------------------------------------------------- |
| 17659 | Extract response and send it to UMAC |
| 17660 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17661 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17662 | { |
| 17663 | wpalMemoryCopy( &halDelWowlBcastPtrRsp, |
| 17664 | pEventData->pEventData, |
| 17665 | sizeof(halDelWowlBcastPtrRsp)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17666 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17667 | wdiWowlDelBcstPtrRsp.wdiStatus = |
| 17668 | WDI_HAL_2_WDI_STATUS(halDelWowlBcastPtrRsp.status); |
| 17669 | } |
| 17670 | else |
| 17671 | { |
| 17672 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17673 | wdiWowlDelBcstPtrRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17674 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17675 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17676 | wdiWowlDelBcPtrnCb( &wdiWowlDelBcstPtrRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17677 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17678 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17679 | }/*WDI_ProcessWowlDelBcPtrnRsp*/ |
| 17680 | |
| 17681 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17682 | @brief Process wowl enter Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17683 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17684 | |
| 17685 | @param pWDICtx: pointer to the WLAN DAL context |
| 17686 | pEventData: pointer to the event information structure |
| 17687 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17688 | @see |
| 17689 | @return Result of the function call |
| 17690 | */ |
| 17691 | WDI_Status |
| 17692 | WDI_ProcessWowlEnterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17693 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17694 | WDI_ControlBlockType* pWDICtx, |
| 17695 | WDI_EventInfoType* pEventData |
| 17696 | ) |
| 17697 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17698 | eHalStatus halStatus; |
| 17699 | WDI_WowlEnterReqCb wdiWowlEnterCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17700 | WDI_WowlEnterRspParamsType wdiwowlEnterRsp; |
| 17701 | tHalEnterWowlRspParams halEnterWowlRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17702 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17703 | |
| 17704 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17705 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17706 | -------------------------------------------------------------------------*/ |
| 17707 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17708 | ( NULL == pEventData->pEventData)) |
| 17709 | { |
| 17710 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17711 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17712 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17713 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17714 | } |
| 17715 | |
| 17716 | wdiWowlEnterCb = (WDI_WowlEnterReqCb)pWDICtx->pfncRspCB; |
| 17717 | |
| 17718 | /*------------------------------------------------------------------------- |
| 17719 | Extract response and send it to UMAC |
| 17720 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17721 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17722 | { |
| 17723 | wpalMemoryCopy( &halEnterWowlRspParams, |
| 17724 | (wpt_uint8*)pEventData->pEventData, |
| 17725 | sizeof(halEnterWowlRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17726 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17727 | wdiwowlEnterRsp.bssIdx = halEnterWowlRspParams.bssIdx; |
| 17728 | wdiwowlEnterRsp.status = |
| 17729 | WDI_HAL_2_WDI_STATUS(halEnterWowlRspParams.status); |
| 17730 | } |
| 17731 | else |
| 17732 | { |
| 17733 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17734 | wdiwowlEnterRsp.status = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17735 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17736 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17737 | wdiWowlEnterCb( &wdiwowlEnterRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17738 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17739 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17740 | }/*WDI_ProcessWowlEnterRsp*/ |
| 17741 | |
| 17742 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17743 | @brief Process wowl exit Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17744 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17745 | |
| 17746 | @param pWDICtx: pointer to the WLAN DAL context |
| 17747 | pEventData: pointer to the event information structure |
| 17748 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17749 | @see |
| 17750 | @return Result of the function call |
| 17751 | */ |
| 17752 | WDI_Status |
| 17753 | WDI_ProcessWowlExitRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17754 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17755 | WDI_ControlBlockType* pWDICtx, |
| 17756 | WDI_EventInfoType* pEventData |
| 17757 | ) |
| 17758 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17759 | eHalStatus halStatus; |
| 17760 | WDI_WowlExitReqCb wdiWowlExitCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17761 | tHalExitWowlRspParams halExitWowlRspParams; |
| 17762 | WDI_WowlExitRspParamsType wdiWowlExitRsp; |
| 17763 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17764 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17765 | |
| 17766 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17767 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17768 | -------------------------------------------------------------------------*/ |
| 17769 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17770 | ( NULL == pEventData->pEventData)) |
| 17771 | { |
| 17772 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17773 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17774 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17775 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17776 | } |
| 17777 | |
| 17778 | wdiWowlExitCb = (WDI_WowlExitReqCb)pWDICtx->pfncRspCB; |
| 17779 | |
| 17780 | /*------------------------------------------------------------------------- |
| 17781 | Extract response and send it to UMAC |
| 17782 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17783 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17784 | { |
| 17785 | wpalMemoryCopy( &halExitWowlRspParams, |
| 17786 | pEventData->pEventData, |
| 17787 | sizeof(halExitWowlRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17788 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17789 | wdiWowlExitRsp.status = WDI_HAL_2_WDI_STATUS(halExitWowlRspParams.status); |
| 17790 | wdiWowlExitRsp.bssIdx = halExitWowlRspParams.bssIdx; |
| 17791 | |
| 17792 | } |
| 17793 | else |
| 17794 | { |
| 17795 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17796 | wdiWowlExitRsp.status = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17797 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17798 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17799 | wdiWowlExitCb( &wdiWowlExitRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17800 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17801 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17802 | }/*WDI_ProcessWowlExitRsp*/ |
| 17803 | |
| 17804 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17805 | @brief Process Configure Apps CPU wakeup State Rsp function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17806 | (called when a response is being received over the bus |
| 17807 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17808 | |
| 17809 | @param pWDICtx: pointer to the WLAN DAL context |
| 17810 | pEventData: pointer to the event information structure |
| 17811 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17812 | @see |
| 17813 | @return Result of the function call |
| 17814 | */ |
| 17815 | WDI_Status |
| 17816 | WDI_ProcessConfigureAppsCpuWakeupStateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17817 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17818 | WDI_ControlBlockType* pWDICtx, |
| 17819 | WDI_EventInfoType* pEventData |
| 17820 | ) |
| 17821 | { |
| 17822 | WDI_Status wdiStatus; |
| 17823 | eHalStatus halStatus; |
| 17824 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb; |
| 17825 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17826 | |
| 17827 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17828 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17829 | -------------------------------------------------------------------------*/ |
| 17830 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17831 | ( NULL == pEventData->pEventData)) |
| 17832 | { |
| 17833 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17834 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17835 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17836 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17837 | } |
| 17838 | |
| 17839 | wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pWDICtx->pfncRspCB; |
| 17840 | |
| 17841 | /*------------------------------------------------------------------------- |
| 17842 | Extract response and send it to UMAC |
| 17843 | -------------------------------------------------------------------------*/ |
| 17844 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17845 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17846 | |
| 17847 | /*Notify UMAC*/ |
| 17848 | wdiConfigureAppsCpuWakeupStateCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17849 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17850 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17851 | }/*WDI_ProcessConfigureAppsCpuWakeupStateRsp*/ |
| 17852 | |
| 17853 | |
| 17854 | /** |
| 17855 | @brief Process Nv download(called when a response |
| 17856 | 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] | 17857 | |
| 17858 | @param pWDICtx: pointer to the WLAN DAL context |
| 17859 | pEventData: pointer to the event information structure |
| 17860 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17861 | @see |
| 17862 | @return Result of the function call |
| 17863 | */ |
| 17864 | WDI_Status |
| 17865 | WDI_ProcessNvDownloadRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17866 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17867 | WDI_ControlBlockType* pWDICtx, |
| 17868 | WDI_EventInfoType* pEventData |
| 17869 | ) |
| 17870 | { |
| 17871 | |
| 17872 | WDI_NvDownloadRspCb wdiNvDownloadRspCb; |
| 17873 | tHalNvImgDownloadRspParams halNvDownloadRsp; |
| 17874 | WDI_NvDownloadRspInfoType wdiNvDownloadRsp; |
| 17875 | |
| 17876 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17877 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17878 | -------------------------------------------------------------------------*/ |
| 17879 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17880 | ( NULL == pEventData->pEventData)) |
| 17881 | { |
| 17882 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17883 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17884 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17885 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17886 | } |
| 17887 | |
| 17888 | /*------------------------------------------------------------------------- |
| 17889 | Extract response and send it to UMAC |
| 17890 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17891 | wpalMemoryCopy( &halNvDownloadRsp, |
| 17892 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17893 | sizeof(halNvDownloadRsp)); |
| 17894 | |
| 17895 | wdiNvDownloadRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halNvDownloadRsp.status); |
| 17896 | |
| 17897 | if((wdiNvDownloadRsp.wdiStatus == WDI_STATUS_SUCCESS) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17898 | (pWDICtx->wdiNvBlobInfo.usCurrentFragment != |
| 17899 | pWDICtx->wdiNvBlobInfo.usTotalFragment )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17900 | { |
| 17901 | WDI_NvDownloadReq(&pWDICtx->wdiCachedNvDownloadReq, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17902 | (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17903 | } |
| 17904 | else |
| 17905 | { |
| 17906 | /*Reset the Nv related global information in WDI context information */ |
| 17907 | pWDICtx->wdiNvBlobInfo.usTotalFragment = 0; |
| 17908 | pWDICtx->wdiNvBlobInfo.usFragmentSize = 0; |
| 17909 | pWDICtx->wdiNvBlobInfo.usCurrentFragment = 0; |
| 17910 | /*call WDA callback function for last fragment */ |
| 17911 | wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB; |
| 17912 | wdiNvDownloadRspCb( &wdiNvDownloadRsp, pWDICtx->pRspCBUserData); |
| 17913 | } |
| 17914 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17915 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17916 | } |
| 17917 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 17918 | /** |
| 17919 | @brief Process Add TSpec Rsp function (called when a response |
| 17920 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17921 | |
| 17922 | @param pWDICtx: pointer to the WLAN DAL context |
| 17923 | pEventData: pointer to the event information structure |
| 17924 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17925 | @see |
| 17926 | @return Result of the function call |
| 17927 | */ |
| 17928 | WDI_Status |
| 17929 | WDI_ProcessAggrAddTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17930 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17931 | WDI_ControlBlockType* pWDICtx, |
| 17932 | WDI_EventInfoType* pEventData |
| 17933 | ) |
| 17934 | { |
| 17935 | WDI_Status wdiStatus; |
| 17936 | tAggrAddTsRspParams aggrAddTsRsp; |
| 17937 | WDI_AggrAddTsRspCb wdiAggrAddTsRspCb; |
| 17938 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17939 | |
| 17940 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17941 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17942 | -------------------------------------------------------------------------*/ |
| 17943 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17944 | ( NULL == pEventData->pEventData)) |
| 17945 | { |
| 17946 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17947 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17948 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17949 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17950 | } |
| 17951 | |
| 17952 | wdiAggrAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB; |
| 17953 | |
| 17954 | /*------------------------------------------------------------------------- |
| 17955 | Extract response and send it to UMAC |
| 17956 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17957 | wpalMemoryCopy( &aggrAddTsRsp, |
| 17958 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17959 | sizeof(aggrAddTsRsp)); |
| 17960 | |
| 17961 | /* What is the difference between status0 and status1? */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17962 | wdiStatus = WDI_HAL_2_WDI_STATUS(aggrAddTsRsp.status0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17963 | |
| 17964 | /*Notify UMAC*/ |
| 17965 | wdiAggrAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17966 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17967 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17968 | }/*WDI_ProcessAddTSpecRsp*/ |
| 17969 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 17970 | |
| 17971 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17972 | @brief WDI_ProcessHostResumeRsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17973 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17974 | |
| 17975 | @param pWDICtx: pointer to the WLAN DAL context |
| 17976 | pEventData: pointer to the event information structure |
| 17977 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17978 | @see |
| 17979 | @return Result of the function call |
| 17980 | */ |
| 17981 | WDI_Status |
| 17982 | WDI_ProcessHostResumeRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17983 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17984 | WDI_ControlBlockType* pWDICtx, |
| 17985 | WDI_EventInfoType* pEventData |
| 17986 | ) |
| 17987 | { |
| 17988 | WDI_SuspendResumeRspParamsType wdiResumeRspParams; |
| 17989 | WDI_HostResumeEventRspCb wdiHostResumeRspCb; |
| 17990 | tHalHostResumeRspParams hostResumeRspMsg; |
| 17991 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17992 | |
| 17993 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17994 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17995 | -------------------------------------------------------------------------*/ |
| 17996 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17997 | ( NULL == pEventData->pEventData)) |
| 17998 | { |
| 17999 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18000 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18001 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18002 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18003 | } |
| 18004 | |
| 18005 | wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pWDICtx->pfncRspCB; |
| 18006 | |
| 18007 | /*------------------------------------------------------------------------- |
| 18008 | Extract response and send it to UMAC |
| 18009 | -------------------------------------------------------------------------*/ |
| 18010 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18011 | wpalMemoryCopy( &hostResumeRspMsg, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18012 | (wpt_uint8*)pEventData->pEventData, |
| 18013 | sizeof(hostResumeRspMsg)); |
| 18014 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18015 | wdiResumeRspParams.wdiStatus = |
| 18016 | WDI_HAL_2_WDI_STATUS(hostResumeRspMsg.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18017 | |
| 18018 | /*Notify UMAC*/ |
| 18019 | wdiHostResumeRspCb(&wdiResumeRspParams, (void*) pWDICtx->pRspCBUserData); |
| 18020 | |
| 18021 | return WDI_STATUS_SUCCESS; |
| 18022 | } |
| 18023 | |
| 18024 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18025 | @brief Process Set Tx PER Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18026 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18027 | |
| 18028 | @param pWDICtx: pointer to the WLAN DAL context |
| 18029 | pEventData: pointer to the event information structure |
| 18030 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18031 | @see |
| 18032 | @return Result of the function call |
| 18033 | */ |
| 18034 | WDI_Status |
| 18035 | WDI_ProcessSetTxPerTrackingRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18036 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18037 | WDI_ControlBlockType* pWDICtx, |
| 18038 | WDI_EventInfoType* pEventData |
| 18039 | ) |
| 18040 | { |
| 18041 | WDI_Status wdiStatus; |
| 18042 | eHalStatus halStatus; |
| 18043 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb; |
| 18044 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18045 | |
| 18046 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18047 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18048 | -------------------------------------------------------------------------*/ |
| 18049 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18050 | ( NULL == pEventData->pEventData)) |
| 18051 | { |
| 18052 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18053 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18054 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18055 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18056 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18057 | |
| 18058 | pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18059 | |
| 18060 | /*------------------------------------------------------------------------- |
| 18061 | Extract response and send it to UMAC |
| 18062 | -------------------------------------------------------------------------*/ |
| 18063 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18064 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18065 | |
| 18066 | /*Notify UMAC*/ |
| 18067 | pwdiSetTxPerTrackingRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18068 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18069 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18070 | }/*WDI_ProcessSetTxPerTrackingRsp*/ |
| 18071 | |
| 18072 | /*========================================================================== |
| 18073 | Indications from HAL |
| 18074 | ==========================================================================*/ |
| 18075 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18076 | @brief Process Low RSSI Indication function (called when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18077 | indication of this kind is being received over the bus |
| 18078 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18079 | |
| 18080 | @param pWDICtx: pointer to the WLAN DAL context |
| 18081 | pEventData: pointer to the event information structure |
| 18082 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18083 | @see |
| 18084 | @return Result of the function call |
| 18085 | */ |
| 18086 | WDI_Status |
| 18087 | WDI_ProcessLowRSSIInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18088 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18089 | WDI_ControlBlockType* pWDICtx, |
| 18090 | WDI_EventInfoType* pEventData |
| 18091 | ) |
| 18092 | { |
| 18093 | WDI_LowLevelIndType wdiInd; |
| 18094 | tHalRSSINotificationIndMsg halRSSINotificationIndMsg; |
| 18095 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18096 | |
| 18097 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18098 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18099 | -------------------------------------------------------------------------*/ |
| 18100 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18101 | ( NULL == pEventData->pEventData)) |
| 18102 | { |
| 18103 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18104 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18105 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18106 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18107 | } |
| 18108 | |
| 18109 | /*------------------------------------------------------------------------- |
| 18110 | Extract indication and send it to UMAC |
| 18111 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18112 | wpalMemoryCopy( (void *)&halRSSINotificationIndMsg.rssiNotificationParams, |
| 18113 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18114 | sizeof(tHalRSSINotification)); |
| 18115 | |
| 18116 | /*Fill in the indication parameters*/ |
| 18117 | wdiInd.wdiIndicationType = WDI_RSSI_NOTIFICATION_IND; |
| 18118 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1PosCross = |
| 18119 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1PosCross; |
| 18120 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1NegCross = |
| 18121 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1NegCross; |
| 18122 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2PosCross = |
| 18123 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2PosCross; |
| 18124 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2NegCross = |
| 18125 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2NegCross; |
| 18126 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3PosCross = |
| 18127 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3PosCross; |
| 18128 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3NegCross = |
| 18129 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3NegCross; |
| 18130 | |
| 18131 | /*Notify UMAC*/ |
| 18132 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18133 | |
| 18134 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18135 | }/*WDI_ProcessLowRSSIInd*/ |
| 18136 | |
| 18137 | |
| 18138 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18139 | @brief Process Missed Beacon Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18140 | an indication of this kind is being received over the |
| 18141 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18142 | |
| 18143 | @param pWDICtx: pointer to the WLAN DAL context |
| 18144 | pEventData: pointer to the event information structure |
| 18145 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18146 | @see |
| 18147 | @return Result of the function call |
| 18148 | */ |
| 18149 | WDI_Status |
| 18150 | WDI_ProcessMissedBeaconInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18151 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18152 | WDI_ControlBlockType* pWDICtx, |
| 18153 | WDI_EventInfoType* pEventData |
| 18154 | ) |
| 18155 | { |
| 18156 | WDI_Status wdiStatus; |
| 18157 | eHalStatus halStatus; |
| 18158 | WDI_LowLevelIndType wdiInd; |
| 18159 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18160 | |
| 18161 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18162 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18163 | -------------------------------------------------------------------------*/ |
| 18164 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18165 | ( NULL == pEventData->pEventData)) |
| 18166 | { |
| 18167 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18168 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18169 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18170 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18171 | } |
| 18172 | |
| 18173 | /*------------------------------------------------------------------------- |
| 18174 | Extract indication and send it to UMAC |
| 18175 | -------------------------------------------------------------------------*/ |
| 18176 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 18177 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18178 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18179 | |
| 18180 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18181 | wdiInd.wdiIndicationType = WDI_MISSED_BEACON_IND; |
| 18182 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18183 | /*Notify UMAC*/ |
| 18184 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18185 | |
| 18186 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18187 | }/*WDI_ProcessMissedBeaconInd*/ |
| 18188 | |
| 18189 | |
| 18190 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18191 | @brief Process Unk Addr Frame Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18192 | an indication of this kind is being received over the |
| 18193 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18194 | |
| 18195 | @param pWDICtx: pointer to the WLAN DAL context |
| 18196 | pEventData: pointer to the event information structure |
| 18197 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18198 | @see |
| 18199 | @return Result of the function call |
| 18200 | */ |
| 18201 | WDI_Status |
| 18202 | WDI_ProcessUnkAddrFrameInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18203 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18204 | WDI_ControlBlockType* pWDICtx, |
| 18205 | WDI_EventInfoType* pEventData |
| 18206 | ) |
| 18207 | { |
| 18208 | WDI_Status wdiStatus; |
| 18209 | eHalStatus halStatus; |
| 18210 | WDI_LowLevelIndType wdiInd; |
| 18211 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18212 | |
| 18213 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18214 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18215 | -------------------------------------------------------------------------*/ |
| 18216 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18217 | ( NULL == pEventData->pEventData)) |
| 18218 | { |
| 18219 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18220 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18221 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18222 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18223 | } |
| 18224 | |
| 18225 | /*------------------------------------------------------------------------- |
| 18226 | Extract indication and send it to UMAC |
| 18227 | -------------------------------------------------------------------------*/ |
| 18228 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 18229 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18230 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18231 | |
| 18232 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18233 | wdiInd.wdiIndicationType = WDI_UNKNOWN_ADDR2_FRAME_RX_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18234 | /* ! TO DO - fill in from HAL struct: |
| 18235 | wdiInd.wdiIndicationData.wdiUnkAddr2FrmInfo*/ |
| 18236 | |
| 18237 | /*Notify UMAC*/ |
| 18238 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18239 | |
| 18240 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18241 | }/*WDI_ProcessUnkAddrFrameInd*/ |
| 18242 | |
| 18243 | |
| 18244 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18245 | @brief Process MIC Failure Indication function (called when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18246 | indication of this kind is being received over the bus |
| 18247 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18248 | |
| 18249 | @param pWDICtx: pointer to the WLAN DAL context |
| 18250 | pEventData: pointer to the event information structure |
| 18251 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18252 | @see |
| 18253 | @return Result of the function call |
| 18254 | */ |
| 18255 | WDI_Status |
| 18256 | WDI_ProcessMicFailureInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18257 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18258 | WDI_ControlBlockType* pWDICtx, |
| 18259 | WDI_EventInfoType* pEventData |
| 18260 | ) |
| 18261 | { |
| 18262 | WDI_LowLevelIndType wdiInd; |
| 18263 | tpSirMicFailureInd pHalMicFailureInd; |
| 18264 | |
| 18265 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18266 | |
| 18267 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18268 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18269 | -------------------------------------------------------------------------*/ |
| 18270 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18271 | ( NULL == pEventData->pEventData)) |
| 18272 | { |
| 18273 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18274 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18275 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18276 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18277 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18278 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18279 | pHalMicFailureInd = (tpSirMicFailureInd)pEventData->pEventData; |
| 18280 | /*------------------------------------------------------------------------- |
| 18281 | Extract indication and send it to UMAC |
| 18282 | -------------------------------------------------------------------------*/ |
| 18283 | |
| 18284 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18285 | wdiInd.wdiIndicationType = WDI_MIC_FAILURE_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18286 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.bssId, |
| 18287 | pHalMicFailureInd->bssId, WDI_MAC_ADDR_LEN); |
| 18288 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macSrcAddr, |
| 18289 | pHalMicFailureInd->info.srcMacAddr, WDI_MAC_ADDR_LEN); |
| 18290 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macTaAddr, |
| 18291 | pHalMicFailureInd->info.taMacAddr, WDI_MAC_ADDR_LEN); |
| 18292 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macDstAddr, |
| 18293 | pHalMicFailureInd->info.dstMacAddr, WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18294 | wdiInd.wdiIndicationData.wdiMICFailureInfo.ucMulticast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18295 | pHalMicFailureInd->info.multicast; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18296 | wdiInd.wdiIndicationData.wdiMICFailureInfo.ucIV1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18297 | pHalMicFailureInd->info.IV1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18298 | wdiInd.wdiIndicationData.wdiMICFailureInfo.keyId= |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18299 | pHalMicFailureInd->info.keyId; |
| 18300 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.TSC, |
| 18301 | pHalMicFailureInd->info.TSC,WDI_CIPHER_SEQ_CTR_SIZE); |
| 18302 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macRxAddr, |
| 18303 | pHalMicFailureInd->info.rxMacAddr, WDI_MAC_ADDR_LEN); |
| 18304 | /*Notify UMAC*/ |
| 18305 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18306 | |
| 18307 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18308 | }/*WDI_ProcessMicFailureInd*/ |
| 18309 | |
| 18310 | |
| 18311 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18312 | @brief Process Fatal Failure Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18313 | an indication of this kind is being received over the |
| 18314 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18315 | |
| 18316 | @param pWDICtx: pointer to the WLAN DAL context |
| 18317 | pEventData: pointer to the event information structure |
| 18318 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18319 | @see |
| 18320 | @return Result of the function call |
| 18321 | */ |
| 18322 | WDI_Status |
| 18323 | WDI_ProcessFatalErrorInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18324 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18325 | WDI_ControlBlockType* pWDICtx, |
| 18326 | WDI_EventInfoType* pEventData |
| 18327 | ) |
| 18328 | { |
| 18329 | WDI_Status wdiStatus; |
| 18330 | eHalStatus halStatus; |
| 18331 | WDI_LowLevelIndType wdiInd; |
| 18332 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18333 | |
| 18334 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18335 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18336 | -------------------------------------------------------------------------*/ |
| 18337 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18338 | ( NULL == pEventData->pEventData)) |
| 18339 | { |
| 18340 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18341 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18342 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18343 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18344 | } |
| 18345 | |
| 18346 | /*------------------------------------------------------------------------- |
| 18347 | Extract indication and send it to UMAC |
| 18348 | -------------------------------------------------------------------------*/ |
| 18349 | |
| 18350 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 18351 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18352 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18353 | |
| 18354 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 18355 | "Fatal failure received from device %d ", halStatus ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18356 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18357 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18358 | wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND; |
| 18359 | wdiInd.wdiIndicationData.usErrorCode = WDI_ERR_DEV_INTERNAL_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18360 | |
| 18361 | /*Notify UMAC*/ |
| 18362 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18363 | |
| 18364 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18365 | }/*WDI_ProcessFatalErrorInd*/ |
| 18366 | |
| 18367 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18368 | @brief Process Delete STA Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18369 | an indication of this kind is being received over the |
| 18370 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18371 | |
| 18372 | @param pWDICtx: pointer to the WLAN DAL context |
| 18373 | pEventData: pointer to the event information structure |
| 18374 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18375 | @see |
| 18376 | @return Result of the function call |
| 18377 | */ |
| 18378 | WDI_Status |
| 18379 | WDI_ProcessDelSTAInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18380 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18381 | WDI_ControlBlockType* pWDICtx, |
| 18382 | WDI_EventInfoType* pEventData |
| 18383 | ) |
| 18384 | { |
| 18385 | tDeleteStaContextParams halDelSTACtx; |
| 18386 | WDI_LowLevelIndType wdiInd; |
| 18387 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18388 | |
| 18389 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18390 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18391 | -------------------------------------------------------------------------*/ |
| 18392 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18393 | ( NULL == pEventData->pEventData)) |
| 18394 | { |
| 18395 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18396 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18397 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18398 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18399 | } |
| 18400 | |
| 18401 | /*------------------------------------------------------------------------- |
| 18402 | Extract indication and send it to UMAC |
| 18403 | -------------------------------------------------------------------------*/ |
| 18404 | |
| 18405 | /* Parameters need to be unpacked according to HAL struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18406 | wpalMemoryCopy( &halDelSTACtx, |
| 18407 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18408 | sizeof(halDelSTACtx)); |
| 18409 | |
| 18410 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18411 | wdiInd.wdiIndicationType = WDI_DEL_STA_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18412 | |
| 18413 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macADDR2, |
| 18414 | halDelSTACtx.addr2, WDI_MAC_ADDR_LEN); |
| 18415 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macBSSID, |
| 18416 | halDelSTACtx.bssId, WDI_MAC_ADDR_LEN); |
| 18417 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18418 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.usAssocId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18419 | halDelSTACtx.assocId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18420 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18421 | halDelSTACtx.staId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18422 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.wptReasonCode = |
| 18423 | halDelSTACtx.reasonCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18424 | |
| 18425 | /*Notify UMAC*/ |
| 18426 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18427 | |
| 18428 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18429 | }/*WDI_ProcessDelSTAInd*/ |
| 18430 | |
| 18431 | /** |
| 18432 | *@brief Process Coex Indication function (called when |
| 18433 | an indication of this kind is being received over the |
| 18434 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18435 | |
| 18436 | @param pWDICtx: pointer to the WLAN DAL context |
| 18437 | pEventData: pointer to the event information structure |
| 18438 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18439 | @see |
| 18440 | @return Result of the function call |
| 18441 | */ |
| 18442 | WDI_Status |
| 18443 | WDI_ProcessCoexInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18444 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18445 | WDI_ControlBlockType* pWDICtx, |
| 18446 | WDI_EventInfoType* pEventData |
| 18447 | ) |
| 18448 | { |
| 18449 | WDI_LowLevelIndType wdiInd; |
| 18450 | tCoexIndMsg halCoexIndMsg; |
| 18451 | wpt_uint32 index; |
| 18452 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18453 | |
| 18454 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18455 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18456 | -------------------------------------------------------------------------*/ |
| 18457 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18458 | ( NULL == pEventData->pEventData )) |
| 18459 | { |
| 18460 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18461 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18462 | WDI_ASSERT( 0 ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18463 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18464 | } |
| 18465 | |
| 18466 | /*------------------------------------------------------------------------- |
| 18467 | Extract indication and send it to UMAC |
| 18468 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18469 | wpalMemoryCopy( &halCoexIndMsg.coexIndParams, |
| 18470 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18471 | sizeof(halCoexIndMsg.coexIndParams) ); |
| 18472 | |
| 18473 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18474 | wdiInd.wdiIndicationType = WDI_COEX_IND; |
| 18475 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType = halCoexIndMsg.coexIndParams.coexIndType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18476 | for (index = 0; index < WDI_COEX_IND_DATA_SIZE; index++) |
| 18477 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18478 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[index] = halCoexIndMsg.coexIndParams.coexIndData[index]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18479 | } |
| 18480 | |
| 18481 | // DEBUG |
| 18482 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 18483 | "[COEX WDI] Coex Ind Type (%x) data (%x %x %x %x)", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18484 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType, |
| 18485 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[0], |
| 18486 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[1], |
| 18487 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[2], |
| 18488 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[3] ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18489 | |
| 18490 | /*Notify UMAC*/ |
| 18491 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18492 | |
| 18493 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18494 | }/*WDI_ProcessCoexInd*/ |
| 18495 | |
| 18496 | /** |
| 18497 | *@brief Process Tx Complete Indication function (called when |
| 18498 | an indication of this kind is being received over the |
| 18499 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18500 | |
| 18501 | @param pWDICtx: pointer to the WLAN DAL context |
| 18502 | pEventData: pointer to the event information structure |
| 18503 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18504 | @see |
| 18505 | @return Result of the function call |
| 18506 | */ |
| 18507 | WDI_Status |
| 18508 | WDI_ProcessTxCompleteInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18509 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18510 | WDI_ControlBlockType* pWDICtx, |
| 18511 | WDI_EventInfoType* pEventData |
| 18512 | ) |
| 18513 | { |
| 18514 | WDI_LowLevelIndType wdiInd; |
| 18515 | tTxComplIndMsg halTxComplIndMsg; |
| 18516 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18517 | |
| 18518 | /*------------------------------------------------------------------------- |
| 18519 | Sanity check |
| 18520 | -------------------------------------------------------------------------*/ |
| 18521 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18522 | ( NULL == pEventData->pEventData )) |
| 18523 | { |
| 18524 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18525 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18526 | WDI_ASSERT( 0 ); |
| 18527 | return WDI_STATUS_E_FAILURE; |
| 18528 | } |
| 18529 | |
| 18530 | /*------------------------------------------------------------------------- |
| 18531 | Extract indication and send it to UMAC |
| 18532 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18533 | wpalMemoryCopy( &halTxComplIndMsg.txComplParams, |
| 18534 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18535 | sizeof(halTxComplIndMsg.txComplParams) ); |
| 18536 | |
| 18537 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18538 | wdiInd.wdiIndicationType = WDI_TX_COMPLETE_IND; |
| 18539 | wdiInd.wdiIndicationData.tx_complete_status |
| 18540 | = halTxComplIndMsg.txComplParams.status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18541 | |
| 18542 | /*Notify UMAC*/ |
| 18543 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18544 | |
| 18545 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18546 | }/*WDI_ProcessTxCompleteInd*/ |
| 18547 | |
| 18548 | #ifdef WLAN_FEATURE_P2P |
| 18549 | /** |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 18550 | *@brief Process Noa Start Indication function (called when |
| 18551 | an indication of this kind is being received over the |
| 18552 | bus from HAL) |
| 18553 | |
| 18554 | @param pWDICtx: pointer to the WLAN DAL context |
| 18555 | pEventData: pointer to the event information structure |
| 18556 | |
| 18557 | @see |
| 18558 | @return Result of the function call |
| 18559 | */ |
| 18560 | WDI_Status |
| 18561 | WDI_ProcessP2pNoaStartInd |
| 18562 | ( |
| 18563 | WDI_ControlBlockType* pWDICtx, |
| 18564 | WDI_EventInfoType* pEventData |
| 18565 | ) |
| 18566 | { |
| 18567 | WDI_LowLevelIndType wdiInd; |
| 18568 | tNoaStartIndMsg halNoaStartIndMsg; |
| 18569 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18570 | |
| 18571 | /*------------------------------------------------------------------------- |
| 18572 | Sanity check |
| 18573 | -------------------------------------------------------------------------*/ |
| 18574 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18575 | ( NULL == pEventData->pEventData )) |
| 18576 | { |
| 18577 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18578 | "%s: Invalid parameters", __func__); |
| 18579 | WDI_ASSERT( 0 ); |
| 18580 | return WDI_STATUS_E_FAILURE; |
| 18581 | } |
| 18582 | |
| 18583 | /*------------------------------------------------------------------------- |
| 18584 | Extract indication and send it to UMAC |
| 18585 | -------------------------------------------------------------------------*/ |
| 18586 | wpalMemoryCopy( &halNoaStartIndMsg.noaStartIndParams, |
| 18587 | pEventData->pEventData, |
| 18588 | sizeof(halNoaStartIndMsg.noaStartIndParams) ); |
| 18589 | |
| 18590 | /*Fill in the indication parameters*/ |
| 18591 | wdiInd.wdiIndicationType = WDI_P2P_NOA_START_IND; |
| 18592 | |
| 18593 | wdiInd.wdiIndicationData.wdiP2pNoaStartInfo.status |
| 18594 | = halNoaStartIndMsg.noaStartIndParams.status; |
| 18595 | |
| 18596 | wdiInd.wdiIndicationData.wdiP2pNoaStartInfo.bssIdx |
| 18597 | = halNoaStartIndMsg.noaStartIndParams.bssIdx; |
| 18598 | |
| 18599 | /*Notify UMAC*/ |
| 18600 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 18601 | |
| 18602 | return WDI_STATUS_SUCCESS; |
| 18603 | }/*WDI_ProcessNoaAttrInd*/ |
| 18604 | |
| 18605 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18606 | *@brief Process Noa Attr Indication function (called when |
| 18607 | an indication of this kind is being received over the |
| 18608 | bus from HAL) |
| 18609 | |
| 18610 | @param pWDICtx: pointer to the WLAN DAL context |
| 18611 | pEventData: pointer to the event information structure |
| 18612 | |
| 18613 | @see |
| 18614 | @return Result of the function call |
| 18615 | */ |
| 18616 | WDI_Status |
| 18617 | WDI_ProcessP2pNoaAttrInd |
| 18618 | ( |
| 18619 | WDI_ControlBlockType* pWDICtx, |
| 18620 | WDI_EventInfoType* pEventData |
| 18621 | ) |
| 18622 | { |
| 18623 | WDI_LowLevelIndType wdiInd; |
| 18624 | tNoaAttrIndMsg halNoaAttrIndMsg; |
| 18625 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18626 | |
| 18627 | /*------------------------------------------------------------------------- |
| 18628 | Sanity check |
| 18629 | -------------------------------------------------------------------------*/ |
| 18630 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18631 | ( NULL == pEventData->pEventData )) |
| 18632 | { |
| 18633 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18634 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18635 | WDI_ASSERT( 0 ); |
| 18636 | return WDI_STATUS_E_FAILURE; |
| 18637 | } |
| 18638 | |
| 18639 | /*------------------------------------------------------------------------- |
| 18640 | Extract indication and send it to UMAC |
| 18641 | -------------------------------------------------------------------------*/ |
| 18642 | wpalMemoryCopy( &halNoaAttrIndMsg.noaAttrIndParams, |
| 18643 | pEventData->pEventData, |
| 18644 | sizeof(halNoaAttrIndMsg.noaAttrIndParams) ); |
| 18645 | |
| 18646 | /*Fill in the indication parameters*/ |
| 18647 | wdiInd.wdiIndicationType = WDI_P2P_NOA_ATTR_IND; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18648 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18649 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.status |
| 18650 | = halNoaAttrIndMsg.noaAttrIndParams.status; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18651 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18652 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucIndex |
| 18653 | = halNoaAttrIndMsg.noaAttrIndParams.index; |
| 18654 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucOppPsFlag |
| 18655 | = halNoaAttrIndMsg.noaAttrIndParams.oppPsFlag; |
| 18656 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usCtWin |
| 18657 | = halNoaAttrIndMsg.noaAttrIndParams.ctWin; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18658 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18659 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa1IntervalCnt |
| 18660 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1IntervalCnt; |
| 18661 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Duration |
| 18662 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Duration; |
| 18663 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Interval |
| 18664 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Interval; |
| 18665 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1StartTime |
| 18666 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1StartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18667 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18668 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa2IntervalCnt |
| 18669 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2IntervalCnt; |
| 18670 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Duration |
| 18671 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Duration; |
| 18672 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Interval |
| 18673 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Interval; |
| 18674 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2StartTime |
| 18675 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2StartTime; |
| 18676 | |
| 18677 | /*Notify UMAC*/ |
| 18678 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 18679 | |
| 18680 | return WDI_STATUS_SUCCESS; |
| 18681 | }/*WDI_ProcessNoaAttrInd*/ |
| 18682 | #endif |
| 18683 | |
| 18684 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18685 | @brief Process Tx PER Hit Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18686 | an indication of this kind is being received over the |
| 18687 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18688 | |
| 18689 | @param pWDICtx: pointer to the WLAN DAL context |
| 18690 | pEventData: pointer to the event information structure |
| 18691 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18692 | @see |
| 18693 | @return Result of the function call |
| 18694 | */ |
| 18695 | WDI_Status |
| 18696 | WDI_ProcessTxPerHitInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18697 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18698 | WDI_ControlBlockType* pWDICtx, |
| 18699 | WDI_EventInfoType* pEventData |
| 18700 | ) |
| 18701 | { |
| 18702 | WDI_LowLevelIndType wdiInd; |
| 18703 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18704 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18705 | /*------------------------------------------------------------------------- |
| 18706 | Extract indication and send it to UMAC |
| 18707 | -------------------------------------------------------------------------*/ |
| 18708 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18709 | wdiInd.wdiIndicationType = WDI_TX_PER_HIT_IND; |
| 18710 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18711 | /*Notify UMAC*/ |
| 18712 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 18713 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18714 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18715 | }/*WDI_ProcessTxPerHitInd*/ |
| 18716 | |
| 18717 | #ifdef ANI_MANF_DIAG |
| 18718 | /** |
| 18719 | @brief WDI_ProcessFTMCommandReq |
| 18720 | Process FTM Command, simply route to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18721 | |
| 18722 | @param pWDICtx: pointer to the WLAN DAL context |
| 18723 | pEventData: pointer to the event information structure |
| 18724 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18725 | @see |
| 18726 | @return Result of the function call |
| 18727 | */ |
| 18728 | WDI_Status |
| 18729 | WDI_ProcessFTMCommandReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18730 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18731 | WDI_ControlBlockType* pWDICtx, |
| 18732 | WDI_EventInfoType* pEventData |
| 18733 | ) |
| 18734 | { |
| 18735 | WDI_FTMCommandReqType *ftmCommandReq = NULL; |
| 18736 | wpt_uint8 *ftmCommandBuffer = NULL; |
| 18737 | wpt_uint16 dataOffset; |
| 18738 | wpt_uint16 bufferSize; |
| 18739 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18740 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18741 | -------------------------------------------------------------------------*/ |
| 18742 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18743 | ( NULL == pEventData->pEventData)) |
| 18744 | |
| 18745 | { |
| 18746 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18747 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18748 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18749 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18750 | } |
| 18751 | |
| 18752 | ftmCommandReq = (WDI_FTMCommandReqType *)pEventData->pEventData; |
| 18753 | |
| 18754 | /* Get MSG Buffer */ |
| 18755 | WDI_GetMessageBuffer(pWDICtx, |
| 18756 | WDI_FTM_CMD_REQ, |
| 18757 | ftmCommandReq->bodyLength, |
| 18758 | &ftmCommandBuffer, |
| 18759 | &dataOffset, |
| 18760 | &bufferSize); |
| 18761 | |
| 18762 | wpalMemoryCopy(ftmCommandBuffer + dataOffset, |
| 18763 | ftmCommandReq->FTMCommandBody, |
| 18764 | ftmCommandReq->bodyLength); |
| 18765 | |
| 18766 | /* Send MSG */ |
| 18767 | return WDI_SendMsg(pWDICtx, |
| 18768 | ftmCommandBuffer, |
| 18769 | bufferSize, |
| 18770 | pEventData->pCBfnc, |
| 18771 | pEventData->pUserData, |
| 18772 | WDI_FTM_CMD_RESP); |
| 18773 | } |
| 18774 | |
| 18775 | /** |
| 18776 | @brief WDI_ProcessFTMCommandRsp |
| 18777 | Process FTM Command Response from HAL, simply route to HDD FTM |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18778 | |
| 18779 | @param pWDICtx: pointer to the WLAN DAL context |
| 18780 | pEventData: pointer to the event information structure |
| 18781 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18782 | @see |
| 18783 | @return Result of the function call |
| 18784 | */ |
| 18785 | WDI_Status |
| 18786 | WDI_ProcessFTMCommandRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18787 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18788 | WDI_ControlBlockType* pWDICtx, |
| 18789 | WDI_EventInfoType* pEventData |
| 18790 | ) |
| 18791 | { |
| 18792 | WDI_FTMCommandRspCb ftmCMDRspCb; |
| 18793 | tProcessPttRspParams *ftmCMDRspData = NULL; |
| 18794 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18795 | |
| 18796 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18797 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18798 | -------------------------------------------------------------------------*/ |
| 18799 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18800 | ( NULL == pEventData->pEventData)) |
| 18801 | { |
| 18802 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18803 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18804 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18805 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18806 | } |
| 18807 | |
| 18808 | ftmCMDRspCb = (WDI_FTMCommandRspCb)pWDICtx->pfncRspCB; |
| 18809 | |
| 18810 | ftmCMDRspData = (tProcessPttRspParams *)pEventData->pEventData; |
| 18811 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18812 | wpalMemoryCopy((void *)pWDICtx->ucFTMCommandRspBuffer, |
| 18813 | (void *)&ftmCMDRspData->pttMsgBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18814 | ftmCMDRspData->pttMsgBuffer.msgBodyLength); |
| 18815 | |
| 18816 | /*Notify UMAC*/ |
| 18817 | ftmCMDRspCb((void *)pWDICtx->ucFTMCommandRspBuffer, pWDICtx->pRspCBUserData); |
| 18818 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18819 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18820 | } |
| 18821 | #endif /* ANI_MANF_DIAG */ |
| 18822 | /** |
| 18823 | @brief WDI_ProcessHalDumpCmdReq |
| 18824 | Process hal dump Command, simply route to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18825 | |
| 18826 | @param pWDICtx: pointer to the WLAN DAL context |
| 18827 | pEventData: pointer to the event information structure |
| 18828 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18829 | @see |
| 18830 | @return Result of the function call |
| 18831 | */ |
| 18832 | WDI_Status |
| 18833 | WDI_ProcessHALDumpCmdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18834 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18835 | WDI_ControlBlockType* pWDICtx, |
| 18836 | WDI_EventInfoType* pEventData |
| 18837 | ) |
| 18838 | { |
| 18839 | WDI_HALDumpCmdReqParamsType* pwdiHALDumpCmdParams = NULL; |
| 18840 | WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb = NULL; |
| 18841 | wpt_uint16 usDataOffset = 0; |
| 18842 | wpt_uint16 usSendSize = 0; |
| 18843 | tHalDumpCmdReqMsg halDumpCmdReqMsg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18844 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18845 | |
| 18846 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18847 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18848 | -------------------------------------------------------------------------*/ |
| 18849 | if (( NULL == pEventData ) || |
| 18850 | ( NULL == pEventData->pEventData) || |
| 18851 | ( NULL == pEventData->pCBfnc )) |
| 18852 | { |
| 18853 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18854 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18855 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18856 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18857 | } |
| 18858 | |
| 18859 | pwdiHALDumpCmdParams = (WDI_HALDumpCmdReqParamsType*)pEventData->pEventData; |
| 18860 | wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pEventData->pCBfnc; |
| 18861 | |
| 18862 | /* Copying the HAL DUMP Command Information HAL Structure*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18863 | halDumpCmdReqMsg.dumpCmdReqParams.argument1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18864 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.command; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18865 | halDumpCmdReqMsg.dumpCmdReqParams.argument2 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18866 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18867 | halDumpCmdReqMsg.dumpCmdReqParams.argument3 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18868 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument2; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18869 | halDumpCmdReqMsg.dumpCmdReqParams.argument4 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18870 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument3; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18871 | halDumpCmdReqMsg.dumpCmdReqParams.argument5 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18872 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument4; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18873 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18874 | /*----------------------------------------------------------------------- |
| 18875 | Get message buffer |
| 18876 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18877 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HAL_DUMP_CMD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18878 | sizeof(halDumpCmdReqMsg.dumpCmdReqParams), |
| 18879 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18880 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18881 | (usDataOffset + sizeof(halDumpCmdReqMsg.dumpCmdReqParams) ))) |
| 18882 | { |
| 18883 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18884 | "Unable to get send buffer in HAL Dump Command req %x %x %x", |
| 18885 | pEventData, pwdiHALDumpCmdParams, wdiHALDumpCmdRspCb); |
| 18886 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18887 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18888 | } |
| 18889 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18890 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 18891 | &halDumpCmdReqMsg.dumpCmdReqParams, |
| 18892 | sizeof(halDumpCmdReqMsg.dumpCmdReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18893 | |
| 18894 | pWDICtx->wdiReqStatusCB = pwdiHALDumpCmdParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18895 | pWDICtx->pReqStatusUserData = pwdiHALDumpCmdParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18896 | |
| 18897 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18898 | Send Start Request to HAL |
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 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 18901 | wdiHALDumpCmdRspCb, pEventData->pUserData, |
| 18902 | WDI_HAL_DUMP_CMD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18903 | } |
| 18904 | |
| 18905 | /** |
| 18906 | @brief WDI_ProcessHalDumpCmdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18907 | Process hal Dump Command Response from HAL, simply route to HDD |
| 18908 | |
| 18909 | @param pWDICtx: pointer to the WLAN DAL context |
| 18910 | pEventData: pointer to the event information structure |
| 18911 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18912 | @see |
| 18913 | @return Result of the function call |
| 18914 | */ |
| 18915 | WDI_Status |
| 18916 | WDI_ProcessHALDumpCmdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18917 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18918 | WDI_ControlBlockType* pWDICtx, |
| 18919 | WDI_EventInfoType* pEventData |
| 18920 | ) |
| 18921 | { |
| 18922 | WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb; |
| 18923 | tpHalDumpCmdRspParams halDumpCmdRspParams; |
| 18924 | WDI_HALDumpCmdRspParamsType wdiHALDumpCmdRsp; |
| 18925 | |
| 18926 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18927 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18928 | -------------------------------------------------------------------------*/ |
| 18929 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18930 | ( NULL == pEventData->pEventData)) |
| 18931 | { |
| 18932 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18933 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18934 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18935 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18936 | } |
| 18937 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18938 | wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18939 | |
| 18940 | /*Initialize the WDI Response structure */ |
| 18941 | wdiHALDumpCmdRsp.usBufferLen = 0; |
| 18942 | wdiHALDumpCmdRsp.pBuffer = NULL; |
| 18943 | |
| 18944 | halDumpCmdRspParams = (tHalDumpCmdRspParams *)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18945 | |
| 18946 | wdiHALDumpCmdRsp.wdiStatus = |
| 18947 | WDI_HAL_2_WDI_STATUS(halDumpCmdRspParams->status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18948 | |
| 18949 | if (( wdiHALDumpCmdRsp.wdiStatus == WDI_STATUS_SUCCESS) && |
| 18950 | (halDumpCmdRspParams->rspLength != 0)) |
| 18951 | { |
| 18952 | /* Copy the response data */ |
| 18953 | wdiHALDumpCmdRsp.usBufferLen = halDumpCmdRspParams->rspLength; |
| 18954 | wdiHALDumpCmdRsp.pBuffer = wpalMemoryAllocate(halDumpCmdRspParams->rspLength); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18955 | wpalMemoryCopy( &halDumpCmdRspParams->rspBuffer, |
| 18956 | wdiHALDumpCmdRsp.pBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18957 | sizeof(wdiHALDumpCmdRsp.usBufferLen)); |
| 18958 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18959 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18960 | /*Notify UMAC*/ |
| 18961 | wdiHALDumpCmdRspCb(&wdiHALDumpCmdRsp, pWDICtx->pRspCBUserData); |
| 18962 | |
| 18963 | if(wdiHALDumpCmdRsp.pBuffer != NULL) |
| 18964 | { |
| 18965 | /* Free the allocated buffer */ |
| 18966 | wpalMemoryFree(wdiHALDumpCmdRsp.pBuffer); |
| 18967 | } |
| 18968 | return WDI_STATUS_SUCCESS; |
| 18969 | } |
| 18970 | |
| 18971 | /*========================================================================== |
| 18972 | CONTRL TRANSPORT INTERACTION |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18973 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18974 | Callback function registered with the control transport - for receiving |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18975 | notifications and packets |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18976 | ==========================================================================*/ |
| 18977 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18978 | @brief This callback is invoked by the control transport |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18979 | when it wishes to send up a notification like the ones |
| 18980 | mentioned above. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18981 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18982 | @param |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18983 | |
| 18984 | wctsHandle: handle to the control transport service |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18985 | wctsEvent: the event being notified |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18986 | wctsNotifyCBData: the callback data of the user |
| 18987 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18988 | @see WCTS_OpenTransport |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18989 | |
| 18990 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18991 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18992 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18993 | WDI_NotifyMsgCTSCB |
| 18994 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18995 | WCTS_HandleType wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18996 | WCTS_NotifyEventType wctsEvent, |
| 18997 | void* wctsNotifyCBData |
| 18998 | ) |
| 18999 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19000 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsNotifyCBData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19001 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19002 | |
| 19003 | if (NULL == pWDICtx ) |
| 19004 | { |
| 19005 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19006 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19007 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19008 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19009 | } |
| 19010 | |
| 19011 | if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic) |
| 19012 | { |
| 19013 | /* callback presumably occurred after close */ |
| 19014 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19015 | "%s: Invalid control block", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19016 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19017 | } |
| 19018 | |
| 19019 | if ( WCTS_EVENT_OPEN == wctsEvent ) |
| 19020 | { |
| 19021 | /*Flag must be set atomically as it is checked from incoming request |
| 19022 | functions*/ |
| 19023 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19024 | pWDICtx->bCTOpened = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19025 | |
| 19026 | /*Nothing to do - so try to dequeue any pending request that may have |
| 19027 | occurred while we were trying to establish this*/ |
| 19028 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19029 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19030 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19031 | else if ( WCTS_EVENT_CLOSE == wctsEvent ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19032 | { |
| 19033 | /*Flag must be set atomically as it is checked from incoming request |
| 19034 | functions*/ |
| 19035 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19036 | pWDICtx->bCTOpened = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19037 | |
| 19038 | /*No other request will be processed from now on - fail all*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19039 | WDI_ClearPendingRequests(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19040 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 19041 | |
| 19042 | /*Notify that the Control Channel is closed */ |
| 19043 | wpalEventSet(&pWDICtx->wctsActionEvent); |
| 19044 | } |
| 19045 | |
| 19046 | }/*WDI_NotifyMsgCTSCB*/ |
| 19047 | |
| 19048 | |
| 19049 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19050 | @brief This callback is invoked by the control transport |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19051 | when it wishes to send up a packet received over the |
| 19052 | bus. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19053 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19054 | @param |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19055 | |
| 19056 | wctsHandle: handle to the control transport service |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19057 | pMsg: the packet |
| 19058 | uLen: the packet length |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19059 | wctsRxMsgCBData: the callback data of the user |
| 19060 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19061 | @see WCTS_OpenTransport |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19062 | |
| 19063 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19064 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19065 | void |
| 19066 | WDI_RXMsgCTSCB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19067 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19068 | WCTS_HandleType wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19069 | void* pMsg, |
| 19070 | wpt_uint32 uLen, |
| 19071 | void* wctsRxMsgCBData |
| 19072 | ) |
| 19073 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19074 | tHalMsgHeader *pHalMsgHeader; |
| 19075 | WDI_EventInfoType wdiEventData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19076 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsRxMsgCBData; |
| 19077 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19078 | |
| 19079 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19080 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19081 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19082 | if ((NULL == pWDICtx ) || ( NULL == pMsg ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19083 | ( uLen < sizeof(tHalMsgHeader))) |
| 19084 | { |
| 19085 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19086 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19087 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19088 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19089 | } |
| 19090 | |
| 19091 | if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic) |
| 19092 | { |
| 19093 | /* callback presumably occurred after close */ |
| 19094 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19095 | "%s: Invalid control block", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19096 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19097 | } |
| 19098 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19099 | /*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] | 19100 | context - so no serialization is necessary here |
| 19101 | ! - revisit this assumption */ |
| 19102 | |
| 19103 | pHalMsgHeader = (tHalMsgHeader *)pMsg; |
| 19104 | |
| 19105 | if ( uLen != pHalMsgHeader->msgLen ) |
| 19106 | { |
| 19107 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19108 | "Invalid packet received from HAL - catastrophic failure"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19109 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); |
| 19110 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19111 | } |
| 19112 | |
| 19113 | wdiEventData.wdiResponse = HAL_2_WDI_RSP_TYPE( pHalMsgHeader->msgType ); |
| 19114 | |
| 19115 | /*The message itself starts after the header*/ |
| 19116 | wdiEventData.pEventData = (wpt_uint8*)pMsg + sizeof(tHalMsgHeader); |
| 19117 | wdiEventData.uEventDataSize = pHalMsgHeader->msgLen - sizeof(tHalMsgHeader); |
| 19118 | wdiEventData.pCBfnc = gWDICb.pfncRspCB; |
| 19119 | wdiEventData.pUserData = gWDICb.pRspCBUserData; |
| 19120 | |
| 19121 | |
| 19122 | if ( wdiEventData.wdiResponse == pWDICtx->wdiExpectedResponse ) |
| 19123 | { |
| 19124 | /*Stop the timer as the response was received */ |
| 19125 | /*!UT - check for potential race conditions between stop and response */ |
| 19126 | wpalTimerStop(&pWDICtx->wptResponseTimer); |
| 19127 | } |
| 19128 | /* Check if we receive a response message which is not expected */ |
| 19129 | else if ( wdiEventData.wdiResponse < WDI_HAL_IND_MIN ) |
| 19130 | { |
| 19131 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 19132 | "Received response %s (%d) when expecting %s (%d) - catastrophic failure", |
| 19133 | WDI_getRespMsgString(wdiEventData.wdiResponse), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19134 | wdiEventData.wdiResponse, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19135 | WDI_getRespMsgString(pWDICtx->wdiExpectedResponse), |
| 19136 | pWDICtx->wdiExpectedResponse); |
| 19137 | /* WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); */ |
| 19138 | return; |
| 19139 | } |
| 19140 | |
| 19141 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19142 | "Rx smth from HAL: %d", wdiEventData.wdiResponse); |
| 19143 | |
| 19144 | /*Post response event to the state machine*/ |
| 19145 | WDI_PostMainEvent(pWDICtx, WDI_RESPONSE_EVENT, &wdiEventData); |
| 19146 | |
| 19147 | }/*WDI_RXMsgCTSCB*/ |
| 19148 | |
| 19149 | |
| 19150 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19151 | Internal Helper Routines |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19152 | ========================================================================*/ |
| 19153 | |
| 19154 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19155 | @brief WDI_CleanCB - internal helper routine used to clean the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19156 | WDI Main Control Block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19157 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19158 | @param pWDICtx - pointer to the control block |
| 19159 | |
| 19160 | @return Result of the function call |
| 19161 | */ |
| 19162 | WPT_INLINE WDI_Status |
| 19163 | WDI_CleanCB |
| 19164 | ( |
| 19165 | WDI_ControlBlockType* pWDICtx |
| 19166 | ) |
| 19167 | { |
| 19168 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19169 | |
| 19170 | /*Clean the WDI Control Block*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19171 | wpalMemoryZero( pWDICtx, sizeof(*pWDICtx)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19172 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19173 | pWDICtx->uGlobalState = WDI_MAX_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19174 | pWDICtx->ucMaxBssids = WDI_MAX_SUPPORTED_BSS; |
| 19175 | pWDICtx->ucMaxStations = WDI_MAX_SUPPORTED_STAS; |
| 19176 | |
| 19177 | WDI_ResetAssocSessions( pWDICtx ); |
| 19178 | |
| 19179 | return WDI_STATUS_SUCCESS; |
| 19180 | }/*WDI_CleanCB*/ |
| 19181 | |
| 19182 | |
| 19183 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19184 | @brief Process request helper function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19185 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19186 | |
| 19187 | @param pWDICtx: pointer to the WLAN DAL context |
| 19188 | pEventData: pointer to the event information structure |
| 19189 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19190 | @see |
| 19191 | @return Result of the function call |
| 19192 | */ |
| 19193 | WPT_INLINE WDI_Status |
| 19194 | WDI_ProcessRequest |
| 19195 | ( |
| 19196 | WDI_ControlBlockType* pWDICtx, |
| 19197 | WDI_EventInfoType* pEventData |
| 19198 | ) |
| 19199 | { |
| 19200 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19201 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19202 | /*!! Skip sanity check as this is called from the FSM functionss which |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19203 | already checked these pointers*/ |
| 19204 | |
| 19205 | if (( pEventData->wdiRequest < WDI_MAX_UMAC_IND ) && |
| 19206 | ( NULL != pfnReqProcTbl[pEventData->wdiRequest] )) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19207 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19208 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19209 | "Calling request processing function for req %s (%d) %x", |
| 19210 | WDI_getReqMsgString(pEventData->wdiRequest), |
| 19211 | pEventData->wdiRequest, pfnReqProcTbl[pEventData->wdiRequest]); |
| 19212 | return pfnReqProcTbl[pEventData->wdiRequest](pWDICtx, pEventData); |
| 19213 | } |
| 19214 | else |
| 19215 | { |
| 19216 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19217 | "Operation %d is not yet implemented ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19218 | pEventData->wdiRequest); |
| 19219 | return WDI_STATUS_E_NOT_IMPLEMENT; |
| 19220 | } |
| 19221 | }/*WDI_ProcessRequest*/ |
| 19222 | |
| 19223 | |
| 19224 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19225 | @brief Get message helper function - it allocates memory for a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19226 | message that is to be sent to HAL accross the bus and |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19227 | prefixes it with a send message header |
| 19228 | |
| 19229 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19230 | wdiReqType: type of the request being sent |
| 19231 | uBufferLen: message buffer len |
| 19232 | pMsgBuffer: resulting allocated buffer |
| 19233 | pusDataOffset: offset in the buffer where the caller |
| 19234 | can start copying its message data |
| 19235 | puBufferSize: the resulting buffer size (offset+buff |
| 19236 | len) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19237 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19238 | @see |
| 19239 | @return Result of the function call |
| 19240 | */ |
| 19241 | WDI_Status |
| 19242 | WDI_GetMessageBuffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19243 | ( |
| 19244 | WDI_ControlBlockType* pWDICtx, |
| 19245 | WDI_RequestEnumType wdiReqType, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19246 | wpt_uint16 usBufferLen, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19247 | wpt_uint8** pMsgBuffer, |
| 19248 | wpt_uint16* pusDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19249 | wpt_uint16* pusBufferSize |
| 19250 | ) |
| 19251 | { |
| 19252 | tHalMsgHeader halMsgHeader; |
| 19253 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19254 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19255 | /*!! No sanity check here as we trust the called - ! check this assumption |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19256 | again*/ |
| 19257 | |
| 19258 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19259 | Try to allocate message buffer from PAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19260 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19261 | *pusBufferSize = sizeof(halMsgHeader) + usBufferLen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19262 | *pMsgBuffer = (wpt_uint8*)wpalMemoryAllocate(*pusBufferSize); |
| 19263 | if ( NULL == *pMsgBuffer ) |
| 19264 | { |
| 19265 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19266 | "Unable to allocate message buffer for req %s (%d)", |
| 19267 | WDI_getReqMsgString(wdiReqType), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19268 | wdiReqType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19269 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19270 | return WDI_STATUS_MEM_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19271 | } |
| 19272 | |
| 19273 | /*------------------------------------------------------------------------- |
| 19274 | Fill in the message header |
| 19275 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19276 | halMsgHeader.msgType = WDI_2_HAL_REQ_TYPE(wdiReqType); |
| 19277 | /* Fill msgVersion */ |
| 19278 | #ifdef WLAN_FEATURE_11AC |
| 19279 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 19280 | halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19281 | else |
| 19282 | #endif |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 19283 | halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19284 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19285 | halMsgHeader.msgLen = sizeof(halMsgHeader) + usBufferLen; |
| 19286 | *pusDataOffset = sizeof(halMsgHeader); |
| 19287 | wpalMemoryCopy(*pMsgBuffer, &halMsgHeader, sizeof(halMsgHeader)); |
| 19288 | |
| 19289 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19290 | }/*WDI_GetMessageBuffer*/ |
| 19291 | |
| 19292 | |
| 19293 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19294 | @brief Send message helper function - sends a message over the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19295 | bus using the control tranport and saves some info in |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19296 | the CB |
| 19297 | |
| 19298 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19299 | pSendBuffer: buffer to be sent |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19300 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19301 | usSendSize size of the buffer to be sent |
| 19302 | pRspCb: response callback - save in the WDI |
| 19303 | CB |
| 19304 | pUserData: user data associated with the |
| 19305 | callback |
| 19306 | wdiExpectedResponse: the code of the response that is |
| 19307 | expected to be rx-ed for this request |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19308 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19309 | @see |
| 19310 | @return Result of the function call |
| 19311 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19312 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19313 | WDI_SendMsg |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19314 | ( |
| 19315 | WDI_ControlBlockType* pWDICtx, |
| 19316 | wpt_uint8* pSendBuffer, |
| 19317 | wpt_uint32 usSendSize, |
| 19318 | void* pRspCb, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19319 | void* pUserData, |
| 19320 | WDI_ResponseEnumType wdiExpectedResponse |
| 19321 | ) |
| 19322 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19323 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19324 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19325 | |
| 19326 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19327 | Save needed info in the CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19328 | ------------------------------------------------------------------------*/ |
| 19329 | pWDICtx->pRspCBUserData = pUserData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19330 | pWDICtx->pfncRspCB = pRspCb; |
| 19331 | pWDICtx->wdiExpectedResponse = wdiExpectedResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19332 | |
| 19333 | /*----------------------------------------------------------------------- |
| 19334 | Call the CTS to send this message over - free message afterwards |
| 19335 | - notify transport failure |
| 19336 | Note: CTS is reponsible for freeing the message buffer. |
| 19337 | -----------------------------------------------------------------------*/ |
| 19338 | if ( 0 != WCTS_SendMessage( pWDICtx->wctsHandle, (void*)pSendBuffer, usSendSize )) |
| 19339 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19340 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19341 | "Failed to send message over the bus - catastrophic failure"); |
| 19342 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19343 | wdiStatus = WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19344 | } |
| 19345 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19346 | /*Check if originator provided a request status callback*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19347 | if ( NULL != pWDICtx->wdiReqStatusCB ) |
| 19348 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19349 | /*Inform originator whether request went through or not*/ |
| 19350 | WDI_ReqStatusCb callback = pWDICtx->wdiReqStatusCB; |
| 19351 | void *callbackContext = pWDICtx->pReqStatusUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19352 | pWDICtx->wdiReqStatusCB = NULL; |
| 19353 | pWDICtx->pReqStatusUserData = NULL; |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19354 | callback(wdiStatus, callbackContext); |
| 19355 | |
| 19356 | /*For WDI requests which have registered a request callback, |
| 19357 | inform the WDA caller of the same via setting the return value |
| 19358 | (wdiStatus) to WDI_STATUS_PENDING. This makes sure that WDA doesnt |
| 19359 | end up repeating the functonality in the req callback for the |
| 19360 | WDI_STATUS_E_FAILURE case*/ |
| 19361 | if (wdiStatus == WDI_STATUS_E_FAILURE) |
| 19362 | wdiStatus = WDI_STATUS_PENDING; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19363 | } |
| 19364 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19365 | if ( wdiStatus == WDI_STATUS_SUCCESS ) |
| 19366 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19367 | /*Start timer for the expected response */ |
| 19368 | wpalTimerStart(&pWDICtx->wptResponseTimer, WDI_RESPONSE_TIMEOUT); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19369 | } |
| 19370 | else |
| 19371 | { |
| 19372 | /*Inform upper stack layers that a transport fatal error occured*/ |
| 19373 | WDI_DetectedDeviceError(pWDICtx, WDI_ERR_TRANSPORT_FAILURE); |
| 19374 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19375 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19376 | return wdiStatus; |
| 19377 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19378 | }/*WDI_SendMsg*/ |
| 19379 | |
| 19380 | |
| 19381 | |
| 19382 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19383 | @brief Send indication helper function - sends a message over |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19384 | the bus using the control transport and saves some info |
| 19385 | in the CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19386 | |
| 19387 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19388 | pSendBuffer: buffer to be sent |
| 19389 | usSendSize: size of the buffer to be sent |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19390 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19391 | @see |
| 19392 | @return Result of the function call |
| 19393 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19394 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19395 | WDI_SendIndication |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19396 | ( |
| 19397 | WDI_ControlBlockType* pWDICtx, |
| 19398 | wpt_uint8* pSendBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19399 | wpt_uint32 usSendSize |
| 19400 | ) |
| 19401 | { |
| 19402 | wpt_uint32 uStatus ; |
| 19403 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19404 | |
| 19405 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19406 | Call the CTS to send this message over |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19407 | Note: CTS is reponsible for freeing the message buffer. |
| 19408 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19409 | uStatus = WCTS_SendMessage( pWDICtx->wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19410 | (void*)pSendBuffer, usSendSize ); |
| 19411 | |
| 19412 | /*Inform Upper MAC about the outcome of the request*/ |
| 19413 | if ( NULL != pWDICtx->wdiReqStatusCB ) |
| 19414 | { |
| 19415 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19416 | "Send indication status : %d", uStatus); |
| 19417 | |
| 19418 | pWDICtx->wdiReqStatusCB( (uStatus != 0 ) ? WDI_STATUS_E_FAILURE: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19419 | WDI_STATUS_SUCCESS, |
| 19420 | pWDICtx->pReqStatusUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19421 | } |
| 19422 | |
| 19423 | /*If sending of the message failed - it is considered catastrophic and |
| 19424 | indicates an error with the device*/ |
| 19425 | if ( 0 != uStatus) |
| 19426 | { |
| 19427 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19428 | "Failed to send indication over the bus - catastrophic failure"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19429 | |
| 19430 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_TRANSPORT_FAILURE); |
| 19431 | return WDI_STATUS_E_FAILURE; |
| 19432 | } |
| 19433 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19434 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19435 | }/*WDI_SendIndication*/ |
| 19436 | |
| 19437 | |
| 19438 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19439 | @brief WDI_DetectedDeviceError - called internally by DAL when |
| 19440 | it has detected a failure in the device |
| 19441 | |
| 19442 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19443 | usErrorCode: error code detected by WDI or received |
| 19444 | from HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19445 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19446 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19447 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19448 | */ |
| 19449 | void |
| 19450 | WDI_DetectedDeviceError |
| 19451 | ( |
| 19452 | WDI_ControlBlockType* pWDICtx, |
| 19453 | wpt_uint16 usErrorCode |
| 19454 | ) |
| 19455 | { |
| 19456 | WDI_LowLevelIndType wdiInd; |
| 19457 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19458 | |
| 19459 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19460 | "Device Error detected code: %d - transitioning to stopped state", |
| 19461 | usErrorCode); |
| 19462 | |
| 19463 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 19464 | |
| 19465 | WDI_STATableStop(pWDICtx); |
| 19466 | |
| 19467 | WDI_ResetAssocSessions(pWDICtx); |
| 19468 | |
| 19469 | /*Set the expected state transition to stopped - because the device |
| 19470 | experienced a failure*/ |
| 19471 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 19472 | |
| 19473 | /*Transition to stopped to fail all incomming requests from this point on*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19474 | WDI_STATE_TRANSITION( pWDICtx, WDI_STOPPED_ST); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19475 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19476 | WDI_ClearPendingRequests(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19477 | |
| 19478 | /*TO DO: - there should be an attempt to reset the device here*/ |
| 19479 | |
| 19480 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 19481 | |
| 19482 | /*------------------------------------------------------------------------ |
| 19483 | Notify UMAC if a handler is registered |
| 19484 | ------------------------------------------------------------------------*/ |
| 19485 | if (pWDICtx->wdiLowLevelIndCB) |
| 19486 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19487 | wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND; |
| 19488 | wdiInd.wdiIndicationData.usErrorCode = usErrorCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19489 | |
| 19490 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData); |
| 19491 | } |
| 19492 | }/*WDI_DetectedDeviceError*/ |
| 19493 | |
| 19494 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19495 | @brief This callback is invoked by the wpt when a timer that |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19496 | we started on send message has expire - this should |
| 19497 | never happen - it means device is stuck and cannot |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19498 | reply - trigger catastrophic failure |
| 19499 | @param |
| 19500 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19501 | pUserData: the callback data of the user (ptr to WDI CB) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19502 | |
| 19503 | @see |
| 19504 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19505 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19506 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19507 | WDI_ResponseTimerCB |
| 19508 | ( |
| 19509 | void *pUserData |
| 19510 | ) |
| 19511 | { |
| 19512 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData; |
| 19513 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19514 | |
| 19515 | if (NULL == pWDICtx ) |
| 19516 | { |
| 19517 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19518 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19519 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19520 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19521 | } |
| 19522 | |
| 19523 | if ( WDI_MAX_RESP != pWDICtx->wdiExpectedResponse ) |
| 19524 | { |
| 19525 | |
Madan Mohan Koyyalamudi | bf77107 | 2012-11-27 18:50:02 +0530 | [diff] [blame] | 19526 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19527 | "Timeout occurred while waiting for %s (%d) message from device " |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19528 | " - catastrophic failure", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19529 | WDI_getRespMsgString(pWDICtx->wdiExpectedResponse), |
| 19530 | pWDICtx->wdiExpectedResponse); |
| 19531 | /* WDI timeout means Riva is not responding or SMD communication to Riva |
| 19532 | * 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] | 19533 | * is to initiate SSR from APPS |
| 19534 | * There is also an option to re-enable wifi, which will eventually |
| 19535 | * trigger SSR |
| 19536 | */ |
| 19537 | #ifndef WDI_RE_ENABLE_WIFI_ON_WDI_TIMEOUT |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 19538 | wpalWcnssResetIntr(); |
| 19539 | /* if this timer fires, it means Riva did not receive the FIQ */ |
| 19540 | wpalTimerStart(&pWDICtx->ssrTimer, WDI_SSR_TIMEOUT); |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 19541 | #else |
| 19542 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 19543 | wpalWlanReload(); |
| 19544 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19545 | } |
| 19546 | else |
| 19547 | { |
| 19548 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19549 | "Timeout occurred but not waiting for any response %d", |
| 19550 | pWDICtx->wdiExpectedResponse); |
| 19551 | } |
| 19552 | |
| 19553 | return; |
| 19554 | |
| 19555 | }/*WDI_ResponseTimerCB*/ |
| 19556 | |
| 19557 | |
| 19558 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19559 | @brief Process response helper function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19560 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19561 | |
| 19562 | @param pWDICtx: pointer to the WLAN DAL context |
| 19563 | pEventData: pointer to the event information structure |
| 19564 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19565 | @see |
| 19566 | @return Result of the function call |
| 19567 | */ |
| 19568 | WPT_INLINE WDI_Status |
| 19569 | WDI_ProcessResponse |
| 19570 | ( |
| 19571 | WDI_ControlBlockType* pWDICtx, |
| 19572 | WDI_EventInfoType* pEventData |
| 19573 | ) |
| 19574 | { |
| 19575 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19576 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19577 | /* Skip sanity check as this is called from the FSM functions which |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19578 | already checked these pointers |
| 19579 | ! - revisit this assumption */ |
| 19580 | if (( pEventData->wdiResponse < WDI_MAX_RESP ) && |
| 19581 | ( NULL != pfnRspProcTbl[pEventData->wdiResponse] )) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19582 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19583 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19584 | "Calling response processing function for resp %s (%d) %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19585 | WDI_getRespMsgString(pEventData->wdiResponse), |
| 19586 | pEventData->wdiResponse, pfnRspProcTbl[pEventData->wdiResponse]); |
| 19587 | return pfnRspProcTbl[pEventData->wdiResponse](pWDICtx, pEventData); |
| 19588 | } |
| 19589 | else |
| 19590 | { |
| 19591 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19592 | "Operation %d is not yet implemented ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19593 | pEventData->wdiResponse); |
| 19594 | return WDI_STATUS_E_NOT_IMPLEMENT; |
| 19595 | } |
| 19596 | }/*WDI_ProcessResponse*/ |
| 19597 | |
| 19598 | |
| 19599 | /*========================================================================= |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19600 | QUEUE SUPPORT UTILITY FUNCTIONS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19601 | =========================================================================*/ |
| 19602 | |
| 19603 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19604 | @brief Utility function used by the DAL Core to help queue a |
| 19605 | request that cannot be processed right away. |
| 19606 | @param |
| 19607 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19608 | pWDICtx: - pointer to the WDI control block |
| 19609 | pEventData: - pointer to the evnt info that needs to be |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19610 | queued |
| 19611 | |
| 19612 | @see |
| 19613 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19614 | */ |
| 19615 | WDI_Status |
| 19616 | WDI_QueuePendingReq |
| 19617 | ( |
| 19618 | WDI_ControlBlockType* pWDICtx, |
| 19619 | WDI_EventInfoType* pEventData |
| 19620 | ) |
| 19621 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19622 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19623 | WDI_EventInfoType* pEventDataQueue = wpalMemoryAllocate(sizeof(*pEventData)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19624 | void* pEventInfo = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19625 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19626 | |
| 19627 | if ( NULL == pEventDataQueue ) |
| 19628 | { |
| 19629 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19630 | "Cannot allocate memory for queueing"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19631 | WDI_ASSERT(0); |
| 19632 | return WDI_STATUS_MEM_FAILURE; |
| 19633 | } |
| 19634 | |
| 19635 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 19636 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 19637 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 19638 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19639 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19640 | |
| 19641 | if( pEventData->uEventDataSize != 0 && pEventData->pEventData != NULL ) |
| 19642 | { |
| 19643 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19644 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19645 | if ( NULL == pEventInfo ) |
| 19646 | { |
| 19647 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19648 | "Cannot allocate memory for queueing event data info"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19649 | WDI_ASSERT(0); |
| 19650 | wpalMemoryFree(pEventDataQueue); |
| 19651 | return WDI_STATUS_MEM_FAILURE; |
| 19652 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19653 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19654 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 19655 | |
| 19656 | } |
| 19657 | pEventDataQueue->pEventData = pEventInfo; |
| 19658 | |
| 19659 | /*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] | 19660 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19661 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19662 | wpal_list_insert_back(&(pWDICtx->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19663 | |
| 19664 | return WDI_STATUS_SUCCESS; |
| 19665 | }/*WDI_QueuePendingReq*/ |
| 19666 | |
| 19667 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19668 | @brief Callback function for serializing queued message |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19669 | processing in the control context |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19670 | @param |
| 19671 | |
| 19672 | pMsg - pointer to the message |
| 19673 | |
| 19674 | @see |
| 19675 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19676 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19677 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19678 | WDI_PALCtrlMsgCB |
| 19679 | ( |
| 19680 | wpt_msg *pMsg |
| 19681 | ) |
| 19682 | { |
| 19683 | WDI_EventInfoType* pEventData = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19684 | WDI_ControlBlockType* pWDICtx = NULL; |
| 19685 | WDI_Status wdiStatus; |
| 19686 | WDI_ReqStatusCb pfnReqStatusCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19687 | void* pUserData; |
| 19688 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19689 | |
| 19690 | if (( NULL == pMsg )|| |
| 19691 | ( NULL == (pEventData = (WDI_EventInfoType*)pMsg->ptr)) || |
| 19692 | ( NULL == (pWDICtx = (WDI_ControlBlockType*)pMsg->pContext ))) |
| 19693 | { |
| 19694 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19695 | "Invalid message received on serialize ctrl context API"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19696 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19697 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19698 | } |
| 19699 | |
| 19700 | /*Transition back to the state that we had before serialization |
| 19701 | - serialization transitions us to BUSY to stop any incomming requests |
| 19702 | ! TO DO L: possible race condition here if a request comes in between the |
| 19703 | state transition and the post function*/ |
| 19704 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19705 | WDI_STATE_TRANSITION( pWDICtx, pMsg->val); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19706 | |
| 19707 | /*----------------------------------------------------------------------- |
| 19708 | Check to see what type of event we are serializing |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19709 | - responses are never expected to come through here |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19710 | -----------------------------------------------------------------------*/ |
| 19711 | switch ( pEventData->wdiRequest ) |
| 19712 | { |
| 19713 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19714 | case WDI_STOP_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19715 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, pEventData); |
| 19716 | break; |
| 19717 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19718 | case WDI_NV_DOWNLOAD_REQ: |
| 19719 | // When WDI State is WDI_STARTED_ST, send WDI request message with event type WDI_REQUEST_EVENT. |
| 19720 | // In this case, because this request is called from response process, we could call WDI_ProcessRequest() directly. |
| 19721 | if (pWDICtx->uGlobalState == WDI_STARTED_ST) |
| 19722 | { |
| 19723 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19724 | "%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] | 19725 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData); |
| 19726 | } |
| 19727 | else |
| 19728 | { |
| 19729 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, pEventData); |
| 19730 | } |
| 19731 | |
| 19732 | break; |
| 19733 | |
| 19734 | default: |
| 19735 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData); |
| 19736 | break; |
| 19737 | }/*switch ( pEventData->wdiRequest )*/ |
| 19738 | |
| 19739 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 19740 | { |
| 19741 | WDI_ExtractRequestCBFromEvent(pEventData, &pfnReqStatusCB, &pUserData); |
| 19742 | |
| 19743 | if ( NULL != pfnReqStatusCB ) |
| 19744 | { |
| 19745 | /*Fail the request*/ |
| 19746 | pfnReqStatusCB( wdiStatus, pUserData); |
| 19747 | } |
| 19748 | } |
| 19749 | |
| 19750 | /* Free data - that was allocated when queueing*/ |
| 19751 | if( pEventData != NULL ) |
| 19752 | { |
| 19753 | if( pEventData->pEventData != NULL ) |
| 19754 | { |
| 19755 | wpalMemoryFree(pEventData->pEventData); |
| 19756 | } |
| 19757 | wpalMemoryFree(pEventData); |
| 19758 | } |
| 19759 | |
| 19760 | if( pMsg != NULL ) |
| 19761 | { |
| 19762 | wpalMemoryFree(pMsg); |
| 19763 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19764 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19765 | }/*WDI_PALCtrlMsgCB*/ |
| 19766 | |
| 19767 | /** |
| 19768 | @brief Utility function used by the DAL Core to help dequeue |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19769 | and schedule for execution a pending request |
| 19770 | @param |
| 19771 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19772 | pWDICtx: - pointer to the WDI control block |
| 19773 | pEventData: - pointer to the evnt info that needs to be |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19774 | queued |
| 19775 | |
| 19776 | @see |
| 19777 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19778 | */ |
| 19779 | WDI_Status |
| 19780 | WDI_DequeuePendingReq |
| 19781 | ( |
| 19782 | WDI_ControlBlockType* pWDICtx |
| 19783 | ) |
| 19784 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19785 | wpt_list_node* pNode = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19786 | WDI_EventInfoType* pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19787 | wpt_msg* palMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19788 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19789 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19790 | wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19791 | |
| 19792 | if ( NULL == pNode ) |
| 19793 | { |
| 19794 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19795 | "List is empty - return"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19796 | return WDI_STATUS_SUCCESS; |
| 19797 | } |
| 19798 | |
| 19799 | /*The node actually points to the 1st element inside the Event Data struct - |
| 19800 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19801 | pEventData = (WDI_EventInfoType*)pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19802 | |
| 19803 | /*Serialize processing in the control thread |
| 19804 | !TO DO: - check to see if these are all the messages params that need |
| 19805 | to be filled in*/ |
| 19806 | palMsg = wpalMemoryAllocate(sizeof(wpt_msg)); |
| 19807 | |
| 19808 | if ( NULL == palMsg ) |
| 19809 | { |
| 19810 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19811 | "WDI_DequeuePendingReq: Cannot allocate memory for palMsg."); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19812 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19813 | return WDI_STATUS_MEM_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19814 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19815 | palMsg->pContext = pWDICtx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19816 | palMsg->callback = WDI_PALCtrlMsgCB; |
| 19817 | palMsg->ptr = pEventData; |
| 19818 | |
| 19819 | /*Save the global state as we need it on the other side*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19820 | palMsg->val = pWDICtx->uGlobalState; |
| 19821 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19822 | /*Transition back to BUSY as we need to handle a queued request*/ |
| 19823 | WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19824 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19825 | wpalPostCtrlMsg(pWDICtx->pPALContext, palMsg); |
| 19826 | |
| 19827 | return WDI_STATUS_PENDING; |
| 19828 | }/*WDI_DequeuePendingReq*/ |
| 19829 | |
| 19830 | |
| 19831 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19832 | @brief Utility function used by the DAL Core to help queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19833 | an association request that cannot be processed right |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19834 | away.- The assoc requests will be queued by BSSID |
| 19835 | @param |
| 19836 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19837 | pWDICtx: - pointer to the WDI control block |
| 19838 | pEventData: pointer to the evnt info that needs to be queued |
| 19839 | macBSSID: bssid |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19840 | |
| 19841 | @see |
| 19842 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19843 | */ |
| 19844 | WDI_Status |
| 19845 | WDI_QueueNewAssocRequest |
| 19846 | ( |
| 19847 | WDI_ControlBlockType* pWDICtx, |
| 19848 | WDI_EventInfoType* pEventData, |
| 19849 | wpt_macAddr macBSSID |
| 19850 | ) |
| 19851 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19852 | wpt_uint8 i; |
| 19853 | WDI_BSSSessionType* pSession = NULL; |
| 19854 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19855 | WDI_EventInfoType* pEventDataQueue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19856 | void* pEventInfo; |
| 19857 | WDI_NextSessionIdType* pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19858 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19859 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19860 | |
| 19861 | /*------------------------------------------------------------------------ |
| 19862 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19863 | ------------------------------------------------------------------------*/ |
| 19864 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 19865 | { |
| 19866 | if ( eWLAN_PAL_FALSE == pWDICtx->aBSSSessions[i].bInUse ) |
| 19867 | { |
| 19868 | /*Found an empty session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19869 | pSession = &pWDICtx->aBSSSessions[i]; |
| 19870 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19871 | } |
| 19872 | } |
| 19873 | |
| 19874 | if ( i >= WDI_MAX_BSS_SESSIONS ) |
| 19875 | { |
| 19876 | /*Cannot find any empty sessions*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19877 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19878 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19879 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19880 | /*------------------------------------------------------------------------ |
| 19881 | Fill in the BSSID for this session and set the usage flag |
| 19882 | ------------------------------------------------------------------------*/ |
| 19883 | wpalMemoryCopy(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19884 | pWDICtx->aBSSSessions[i].bInUse = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19885 | |
| 19886 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19887 | Allocate memory for this and place it in the queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19888 | ------------------------------------------------------------------------*/ |
| 19889 | pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType)); |
| 19890 | if ( NULL == pEventDataQueue ) |
| 19891 | { |
| 19892 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19893 | "%s: Cannot allocate memory for queue node", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19894 | WDI_ASSERT(0); |
| 19895 | return WDI_STATUS_MEM_FAILURE; |
| 19896 | } |
| 19897 | |
| 19898 | pSessionIdElement = (WDI_NextSessionIdType*)wpalMemoryAllocate(sizeof(WDI_NextSessionIdType)); |
| 19899 | if ( NULL == pSessionIdElement ) |
| 19900 | { |
| 19901 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19902 | "%s: Cannot allocate memory for session ID", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19903 | WDI_ASSERT(0); |
| 19904 | wpalMemoryFree(pEventDataQueue); |
| 19905 | return WDI_STATUS_MEM_FAILURE; |
| 19906 | } |
| 19907 | |
| 19908 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
| 19909 | if ( NULL == pEventInfo ) |
| 19910 | { |
| 19911 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19912 | "%s: Cannot allocate memory for event data info", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19913 | WDI_ASSERT(0); |
| 19914 | wpalMemoryFree(pSessionIdElement); |
| 19915 | wpalMemoryFree(pEventDataQueue); |
| 19916 | return WDI_STATUS_MEM_FAILURE; |
| 19917 | } |
| 19918 | |
| 19919 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 19920 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 19921 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 19922 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19923 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19924 | |
| 19925 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 19926 | pEventDataQueue->pEventData = pEventInfo; |
| 19927 | |
| 19928 | /*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] | 19929 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19930 | |
| 19931 | /*This association is currently being queued*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19932 | pSession->bAssocReqQueued = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19933 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19934 | wpal_list_insert_back(&(pSession->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19935 | |
| 19936 | /*We need to maintain a separate list that keeps track of the order in which |
| 19937 | the new assoc requests are being queued such that we can start processing |
| 19938 | them in the order that they had arrived*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19939 | pSessionIdElement->ucIndex = i; |
| 19940 | pNode = (wpt_list_node*)pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19941 | |
| 19942 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19943 | "Queueing up new assoc session : %d ", pSessionIdElement->ucIndex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19944 | wpal_list_insert_back(&pWDICtx->wptPendingAssocSessionIdQueue, pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19945 | |
| 19946 | /*Return pending as this is what the status of the request is since it has |
| 19947 | been queued*/ |
| 19948 | return WDI_STATUS_PENDING; |
| 19949 | }/*WDI_QueueNewAssocRequest*/ |
| 19950 | |
| 19951 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19952 | @brief Utility function used by the DAL Core to help queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19953 | an association request that cannot be processed right |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19954 | away.- The assoc requests will be queued by BSSID |
| 19955 | @param |
| 19956 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19957 | pWDICtx: - pointer to the WDI control block |
| 19958 | pSession: - session in which to queue |
| 19959 | pEventData: pointer to the event info that needs to be |
| 19960 | queued |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19961 | |
| 19962 | @see |
| 19963 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19964 | */ |
| 19965 | WDI_Status |
| 19966 | WDI_QueueAssocRequest |
| 19967 | ( |
| 19968 | WDI_ControlBlockType* pWDICtx, |
| 19969 | WDI_BSSSessionType* pSession, |
| 19970 | WDI_EventInfoType* pEventData |
| 19971 | ) |
| 19972 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19973 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19974 | WDI_EventInfoType* pEventDataQueue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19975 | void* pEventInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19976 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19977 | |
| 19978 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19979 | Sanity check |
| 19980 | ------------------------------------------------------------------------*/ |
| 19981 | if (( NULL == pSession ) || ( NULL == pWDICtx )) |
| 19982 | { |
| 19983 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19984 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19985 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19986 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19987 | } |
| 19988 | |
| 19989 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19990 | Allocate memory for this and place it in the queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19991 | ------------------------------------------------------------------------*/ |
| 19992 | pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType)); |
| 19993 | if ( NULL == pEventDataQueue ) |
| 19994 | { |
| 19995 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19996 | "%s: Cannot allocate memory for queueing", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19997 | WDI_ASSERT(0); |
| 19998 | return WDI_STATUS_MEM_FAILURE; |
| 19999 | } |
| 20000 | |
| 20001 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
| 20002 | if ( NULL == pEventInfo ) |
| 20003 | { |
| 20004 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 20005 | "%s: Cannot allocate memory for queueing event data info", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20006 | __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20007 | WDI_ASSERT(0); |
| 20008 | wpalMemoryFree(pEventDataQueue); |
| 20009 | return WDI_STATUS_MEM_FAILURE; |
| 20010 | } |
| 20011 | |
| 20012 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 20013 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 20014 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 20015 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20016 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20017 | pEventDataQueue->pEventData = pEventInfo; |
| 20018 | |
| 20019 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 20020 | |
| 20021 | /*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] | 20022 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20023 | |
| 20024 | /*This association is currently being queued*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20025 | pSession->bAssocReqQueued = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20026 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20027 | wpal_list_insert_back(&(pSession->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20028 | |
| 20029 | /*The result of this operation is pending because the request has been |
| 20030 | queued and it will be processed at a later moment in time */ |
| 20031 | return WDI_STATUS_PENDING; |
| 20032 | }/*WDI_QueueAssocRequest*/ |
| 20033 | |
| 20034 | /** |
| 20035 | @brief Utility function used by the DAL Core to help dequeue |
| 20036 | an association request that was pending |
| 20037 | The request will be queued up in front of the main |
| 20038 | pending queue for imediate processing |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20039 | @param |
| 20040 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20041 | pWDICtx: - pointer to the WDI control block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20042 | |
| 20043 | |
| 20044 | @see |
| 20045 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20046 | */ |
| 20047 | WDI_Status |
| 20048 | WDI_DequeueAssocRequest |
| 20049 | ( |
| 20050 | WDI_ControlBlockType* pWDICtx |
| 20051 | ) |
| 20052 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20053 | wpt_list_node* pNode = NULL; |
| 20054 | WDI_NextSessionIdType* pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20055 | WDI_BSSSessionType* pSession; |
| 20056 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20057 | |
| 20058 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20059 | Sanity check |
| 20060 | ------------------------------------------------------------------------*/ |
| 20061 | if ( NULL == pWDICtx ) |
| 20062 | { |
| 20063 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20064 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20065 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20066 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20067 | } |
| 20068 | |
| 20069 | /*------------------------------------------------------------------------ |
| 20070 | An association has been completed => a new association can occur |
| 20071 | Check to see if there are any pending associations -> |
| 20072 | If so , transfer all the pending requests into the busy queue for |
| 20073 | processing |
| 20074 | These requests have arrived prior to the requests in the busy queue |
| 20075 | (bc they needed to be processed in order to be placed in this queue) |
| 20076 | => they will be placed at the front of the busy queue |
| 20077 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20078 | wpal_list_remove_front(&(pWDICtx->wptPendingAssocSessionIdQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20079 | |
| 20080 | if ( NULL == pNode ) |
| 20081 | { |
| 20082 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20083 | "List is empty - return"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20084 | return WDI_STATUS_SUCCESS; |
| 20085 | } |
| 20086 | |
| 20087 | /*The node actually points to the 1st element inside the Session Id struct - |
| 20088 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20089 | pSessionIdElement = (WDI_NextSessionIdType*)pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20090 | |
| 20091 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 20092 | "Dequeueing new assoc session : %d ", pSessionIdElement->ucIndex); |
| 20093 | |
| 20094 | if ( pSessionIdElement->ucIndex < WDI_MAX_BSS_SESSIONS ) |
| 20095 | { |
| 20096 | pSession = &pWDICtx->aBSSSessions[pSessionIdElement->ucIndex]; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20097 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20098 | /*Transfer all the pending requests in this assoc queue to |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20099 | the front of the main waiting queue for subsequent execution*/ |
| 20100 | wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20101 | while ( NULL != pNode ) |
| 20102 | { |
| 20103 | /*Place it in front of the main pending list*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20104 | wpal_list_insert_front( &(pWDICtx->wptPendingQueue), &pNode); |
| 20105 | wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20106 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20107 | pSession->bAssocReqQueued = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20108 | } |
| 20109 | else |
| 20110 | { |
| 20111 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20112 | "Invalid session id queued up for assoc"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20113 | WPAL_ASSERT(0); |
| 20114 | wpalMemoryFree(pSessionIdElement); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20115 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20116 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20117 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20118 | /*Clean this up as it is no longer needed in order to prevent memory leak*/ |
| 20119 | wpalMemoryFree(pSessionIdElement); |
| 20120 | return WDI_STATUS_SUCCESS; |
| 20121 | }/*WDI_DequeueAssocRequest*/ |
| 20122 | |
| 20123 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20124 | @brief Utility function used by the DAL Core to clear any |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20125 | pending requests - all req cb will be called with |
| 20126 | failure and the queue will be emptied. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20127 | @param |
| 20128 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20129 | pWDICtx: - pointer to the WDI control block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20130 | |
| 20131 | @see |
| 20132 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20133 | */ |
| 20134 | WDI_Status |
| 20135 | WDI_ClearPendingRequests |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20136 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20137 | WDI_ControlBlockType* pWDICtx |
| 20138 | ) |
| 20139 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20140 | wpt_list_node* pNode = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20141 | WDI_EventInfoType* pEventDataQueue = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20142 | WDI_ReqStatusCb pfnReqStatusCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20143 | void* pUserData; |
| 20144 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20145 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20146 | wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20147 | |
| 20148 | /*------------------------------------------------------------------------ |
| 20149 | Go through all the requests and fail them - this will only be called |
| 20150 | 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] | 20151 | pending requests can no longer be sent down to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20152 | ------------------------------------------------------------------------*/ |
| 20153 | while( pNode ) |
| 20154 | { |
| 20155 | /*The node actually points to the 1st element inside the Event Data struct - |
| 20156 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20157 | pEventDataQueue = (WDI_EventInfoType*)pNode; |
| 20158 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20159 | WDI_ExtractRequestCBFromEvent(pEventDataQueue, &pfnReqStatusCB, &pUserData); |
| 20160 | if ( NULL != pfnReqStatusCB ) |
| 20161 | { |
| 20162 | /*Fail the request*/ |
| 20163 | pfnReqStatusCB( WDI_STATUS_E_FAILURE, pUserData); |
| 20164 | } |
| 20165 | /* Free data - that was allocated when queueing */ |
| 20166 | if ( pEventDataQueue->pEventData != NULL ) |
| 20167 | { |
| 20168 | wpalMemoryFree(pEventDataQueue->pEventData); |
| 20169 | } |
| 20170 | wpalMemoryFree(pEventDataQueue); |
| 20171 | |
| 20172 | if (wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode) != eWLAN_PAL_STATUS_SUCCESS) |
| 20173 | { |
| 20174 | break; |
| 20175 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20176 | } |
| 20177 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20178 | return WDI_STATUS_SUCCESS; |
| 20179 | }/*WDI_ClearPendingRequests*/ |
| 20180 | |
| 20181 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20182 | @brief Helper routine used to init the BSS Sessions in the WDI control block |
| 20183 | |
| 20184 | |
| 20185 | @param pWDICtx: pointer to the WLAN DAL context |
| 20186 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20187 | @see |
| 20188 | */ |
| 20189 | void |
| 20190 | WDI_ResetAssocSessions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20191 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20192 | WDI_ControlBlockType* pWDICtx |
| 20193 | ) |
| 20194 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20195 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20196 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20197 | |
| 20198 | /*------------------------------------------------------------------------- |
| 20199 | No Sanity check |
| 20200 | -------------------------------------------------------------------------*/ |
| 20201 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 20202 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20203 | wpalMemoryZero( &pWDICtx->aBSSSessions[i], sizeof(WDI_BSSSessionType) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20204 | pWDICtx->aBSSSessions[i].wdiAssocState = WDI_ASSOC_INIT_ST; |
| 20205 | pWDICtx->aBSSSessions[i].bcastStaIdx = WDI_STA_INVALID_IDX; |
| 20206 | pWDICtx->aBSSSessions[i].ucBSSIdx = WDI_BSS_INVALID_IDX; |
| 20207 | } |
| 20208 | }/*WDI_ResetAssocSessions*/ |
| 20209 | |
| 20210 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20211 | @brief Helper routine used to find a session based on the BSSID |
| 20212 | |
| 20213 | |
| 20214 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20215 | macBSSID: BSSID of the session |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20216 | pSession: pointer to the session (if found) |
| 20217 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20218 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20219 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20220 | */ |
| 20221 | wpt_uint8 |
| 20222 | WDI_FindAssocSession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20223 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20224 | WDI_ControlBlockType* pWDICtx, |
| 20225 | wpt_macAddr macBSSID, |
| 20226 | WDI_BSSSessionType** ppSession |
| 20227 | ) |
| 20228 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20229 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20230 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20231 | |
| 20232 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20233 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20234 | -------------------------------------------------------------------------*/ |
| 20235 | if ( NULL == ppSession ) |
| 20236 | { |
| 20237 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20238 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20239 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20240 | } |
| 20241 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20242 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20243 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20244 | /*------------------------------------------------------------------------ |
| 20245 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20246 | ------------------------------------------------------------------------*/ |
| 20247 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 20248 | { |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 20249 | if ( (pWDICtx->aBSSSessions[i].bInUse == eWLAN_PAL_TRUE) && |
| 20250 | (eWLAN_PAL_TRUE == |
| 20251 | wpalMemoryCompare(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, |
| 20252 | WDI_MAC_ADDR_LEN)) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20253 | { |
| 20254 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20255 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20256 | return i; |
| 20257 | } |
| 20258 | } |
| 20259 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20260 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20261 | }/*WDI_FindAssocSession*/ |
| 20262 | |
| 20263 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20264 | @brief Helper routine used to find a session based on the BSSID |
| 20265 | |
| 20266 | |
| 20267 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20268 | ucBSSIdx: BSS Index of the session |
| 20269 | ppSession: out pointer to the session (if found) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20270 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20271 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20272 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20273 | */ |
| 20274 | wpt_uint8 |
| 20275 | WDI_FindAssocSessionByBSSIdx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20276 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20277 | WDI_ControlBlockType* pWDICtx, |
| 20278 | wpt_uint16 ucBSSIdx, |
| 20279 | WDI_BSSSessionType** ppSession |
| 20280 | ) |
| 20281 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20282 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20283 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20284 | |
| 20285 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20286 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20287 | -------------------------------------------------------------------------*/ |
| 20288 | if ( NULL == ppSession ) |
| 20289 | { |
| 20290 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20291 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20292 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20293 | } |
| 20294 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20295 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20296 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20297 | /*------------------------------------------------------------------------ |
| 20298 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20299 | ------------------------------------------------------------------------*/ |
| 20300 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 20301 | { |
| 20302 | if ( ucBSSIdx == pWDICtx->aBSSSessions[i].ucBSSIdx ) |
| 20303 | { |
| 20304 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20305 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20306 | return i; |
| 20307 | } |
| 20308 | } |
| 20309 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20310 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20311 | }/*WDI_FindAssocSessionByBSSIdx*/ |
| 20312 | |
| 20313 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20314 | @brief Helper routine used to find a session based on the BSSID |
| 20315 | |
| 20316 | |
| 20317 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20318 | ucBSSIdx: BSS Index of the session |
| 20319 | ppSession: out pointer to the session (if found) |
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 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20322 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20323 | */ |
| 20324 | wpt_uint8 |
| 20325 | WDI_FindAssocSessionByIdx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20326 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20327 | WDI_ControlBlockType* pWDICtx, |
| 20328 | wpt_uint16 usIdx, |
| 20329 | WDI_BSSSessionType** ppSession |
| 20330 | ) |
| 20331 | { |
| 20332 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20333 | |
| 20334 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20335 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20336 | -------------------------------------------------------------------------*/ |
| 20337 | if ( NULL == ppSession || usIdx >= WDI_MAX_BSS_SESSIONS ) |
| 20338 | { |
| 20339 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20340 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20341 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20342 | } |
| 20343 | |
| 20344 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20345 | *ppSession = &pWDICtx->aBSSSessions[usIdx]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20346 | |
| 20347 | return usIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20348 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20349 | }/*WDI_FindAssocSessionByBSSIdx*/ |
| 20350 | |
| 20351 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20352 | @brief Helper routine used to find an empty session in the WDI |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20353 | CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20354 | |
| 20355 | |
| 20356 | @param pWDICtx: pointer to the WLAN DAL context |
| 20357 | pSession: pointer to the session (if found) |
| 20358 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20359 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20360 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20361 | */ |
| 20362 | wpt_uint8 |
| 20363 | WDI_FindEmptySession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20364 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20365 | WDI_ControlBlockType* pWDICtx, |
| 20366 | WDI_BSSSessionType** ppSession |
| 20367 | ) |
| 20368 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20369 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20370 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20371 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20372 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20373 | -------------------------------------------------------------------------*/ |
| 20374 | if ( NULL == ppSession ) |
| 20375 | { |
| 20376 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20377 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20378 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20379 | } |
| 20380 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20381 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20382 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20383 | /*------------------------------------------------------------------------ |
| 20384 | Search for a session that it is not in use |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20385 | ------------------------------------------------------------------------*/ |
| 20386 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 20387 | { |
| 20388 | if ( ! pWDICtx->aBSSSessions[i].bInUse ) |
| 20389 | { |
| 20390 | /*Found a session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20391 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20392 | return i; |
| 20393 | } |
| 20394 | } |
| 20395 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20396 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20397 | }/*WDI_FindEmptySession*/ |
| 20398 | |
| 20399 | |
| 20400 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20401 | @brief Helper routine used to get the total count of active |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20402 | sessions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20403 | |
| 20404 | |
| 20405 | @param pWDICtx: pointer to the WLAN DAL context |
| 20406 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20407 | @see |
| 20408 | @return Number of sessions in use |
| 20409 | */ |
| 20410 | wpt_uint8 |
| 20411 | WDI_GetActiveSessionsCount |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20412 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20413 | WDI_ControlBlockType* pWDICtx |
| 20414 | ) |
| 20415 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20416 | wpt_uint8 i, ucCount = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20417 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20418 | |
| 20419 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20420 | Count all sessions in use |
| 20421 | ------------------------------------------------------------------------*/ |
| 20422 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 20423 | { |
| 20424 | if ( pWDICtx->aBSSSessions[i].bInUse ) |
| 20425 | { |
| 20426 | ucCount++; |
| 20427 | } |
| 20428 | } |
| 20429 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20430 | return ucCount; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20431 | }/*WDI_GetActiveSessionsCount*/ |
| 20432 | |
| 20433 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20434 | @brief Helper routine used to delete session in the WDI |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20435 | CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20436 | |
| 20437 | |
| 20438 | @param pWDICtx: pointer to the WLAN DAL context |
| 20439 | pSession: pointer to the session (if found) |
| 20440 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20441 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20442 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20443 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20444 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20445 | WDI_DeleteSession |
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_BSSSessionType* ppSession |
| 20449 | ) |
| 20450 | { |
| 20451 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20452 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20453 | -------------------------------------------------------------------------*/ |
| 20454 | if ( NULL == ppSession ) |
| 20455 | { |
| 20456 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20457 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20458 | return ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20459 | } |
| 20460 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20461 | /*------------------------------------------------------------------------ |
| 20462 | Reset the entries int session |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20463 | ------------------------------------------------------------------------*/ |
| 20464 | wpal_list_destroy(&ppSession->wptPendingQueue); |
| 20465 | wpalMemoryZero(ppSession, sizeof(*ppSession)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20466 | ppSession->wdiAssocState = WDI_ASSOC_INIT_ST; |
| 20467 | ppSession->bInUse = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20468 | ppSession->wdiBssType = WDI_INFRASTRUCTURE_MODE; |
| 20469 | wpal_list_init(&ppSession->wptPendingQueue); |
| 20470 | |
| 20471 | }/*WDI_DeleteSession*/ |
| 20472 | |
| 20473 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20474 | @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] | 20475 | The bcast STA ID is assigned by HAL and must be valid. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20476 | @param |
| 20477 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20478 | WDI_AddStaParams: - pointer to the WDI Add STA params |
| 20479 | usBcastStaIdx: - Broadcast STA index passed by HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20480 | |
| 20481 | @see |
| 20482 | @return void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20483 | */ |
| 20484 | void |
| 20485 | WDI_AddBcastSTAtoSTATable |
| 20486 | ( |
| 20487 | WDI_ControlBlockType* pWDICtx, |
| 20488 | WDI_AddStaParams * staParams, |
| 20489 | wpt_uint16 usBcastStaIdx |
| 20490 | ) |
| 20491 | { |
| 20492 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 20493 | wpt_macAddr bcastMacAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; |
| 20494 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20495 | |
| 20496 | /*--------------------------------------------------------------------- |
| 20497 | Sanity check |
| 20498 | ---------------------------------------------------------------------*/ |
| 20499 | if ( NULL == staParams ) |
| 20500 | { |
| 20501 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20502 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20503 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20504 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20505 | } |
| 20506 | |
| 20507 | wdiAddSTAParam.bcastDpuIndex = staParams->bcastDpuIndex; |
| 20508 | wdiAddSTAParam.bcastDpuSignature = staParams->bcastDpuSignature; |
| 20509 | wdiAddSTAParam.bcastMgmtDpuIndex = staParams->bcastMgmtDpuIndex; |
| 20510 | wdiAddSTAParam.bcastMgmtDpuSignature = staParams->bcastMgmtDpuSignature; |
| 20511 | wdiAddSTAParam.dpuIndex = staParams->dpuIndex; |
| 20512 | wdiAddSTAParam.dpuSig = staParams->dpuSig; |
| 20513 | wpalMemoryCopy( wdiAddSTAParam.macBSSID, staParams->macBSSID, |
| 20514 | WDI_MAC_ADDR_LEN ); |
| 20515 | wpalMemoryCopy( wdiAddSTAParam.staMacAddr, bcastMacAddr, WDI_MAC_ADDR_LEN ); |
| 20516 | wdiAddSTAParam.ucBSSIdx = staParams->ucBSSIdx; |
| 20517 | wdiAddSTAParam.ucHTCapable = staParams->ucHTCapable; |
| 20518 | wdiAddSTAParam.ucRmfEnabled = staParams->ucRmfEnabled; |
| 20519 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_BCAST; |
| 20520 | wdiAddSTAParam.ucWmmEnabled = staParams->ucWmmEnabled; |
| 20521 | wdiAddSTAParam.ucSTAIdx = usBcastStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20522 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20523 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 20524 | } |
| 20525 | |
| 20526 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20527 | @brief NV blob will be divided into fragments of size 4kb and |
| 20528 | Sent to HAL |
| 20529 | |
| 20530 | @param pWDICtx: pointer to the WLAN DAL context |
| 20531 | pEventData: pointer to the event information structure |
| 20532 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20533 | @see |
| 20534 | @return Result of the function call |
| 20535 | */ |
| 20536 | |
| 20537 | WDI_Status WDI_SendNvBlobReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20538 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20539 | WDI_ControlBlockType* pWDICtx, |
| 20540 | WDI_EventInfoType* pEventData |
| 20541 | ) |
| 20542 | { |
| 20543 | |
| 20544 | tHalNvImgDownloadReqMsg halNvImgDownloadParam; |
| 20545 | wpt_uint8* pSendBuffer = NULL; |
| 20546 | wpt_uint16 usDataOffset = 0; |
| 20547 | wpt_uint16 usSendSize = 0; |
| 20548 | wpt_uint16 usCurrentFragmentSize =0; |
| 20549 | wpt_uint8* pSrcBuffer = NULL; |
| 20550 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams =NULL ; |
| 20551 | WDI_NvDownloadRspCb wdiNvDownloadRspCb; |
| 20552 | |
| 20553 | wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pEventData->pCBfnc; |
| 20554 | WDI_ASSERT(NULL != wdiNvDownloadRspCb); |
| 20555 | pwdiNvDownloadReqParams = (WDI_NvDownloadReqParamsType*)pEventData->pEventData; |
| 20556 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20557 | /* Sanity Check is done by the caller */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20558 | pSrcBuffer =(wpt_uint8 *) pwdiNvDownloadReqParams->wdiBlobInfo.pBlobAddress; |
| 20559 | |
| 20560 | /* Update the current Fragment Number */ |
| 20561 | pWDICtx->wdiNvBlobInfo.usCurrentFragment += 1; |
| 20562 | |
| 20563 | /*Update the HAL REQ structure */ |
| 20564 | /*HAL maintaining the fragment count as 0,1,2...n where at WDI it is represented as 1,2,3.. n*/ |
| 20565 | halNvImgDownloadParam.nvImageReqParams.fragNumber = |
| 20566 | pWDICtx->wdiNvBlobInfo.usCurrentFragment-1; |
| 20567 | |
| 20568 | /* 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] | 20569 | 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] | 20570 | image will be sent to HAL*/ |
| 20571 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20572 | if(pWDICtx->wdiNvBlobInfo.usTotalFragment |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20573 | == pWDICtx->wdiNvBlobInfo.usCurrentFragment) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20574 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20575 | /* Taking care of boundry condition */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20576 | if( !(usCurrentFragmentSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20577 | pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize%FRAGMENT_SIZE )) |
| 20578 | usCurrentFragmentSize = FRAGMENT_SIZE; |
| 20579 | |
| 20580 | /*Update the HAL REQ structure */ |
| 20581 | halNvImgDownloadParam.nvImageReqParams.isLastFragment = 1; |
| 20582 | halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize= usCurrentFragmentSize; |
| 20583 | |
| 20584 | } |
| 20585 | else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20586 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20587 | usCurrentFragmentSize = FRAGMENT_SIZE; |
| 20588 | |
| 20589 | /*Update the HAL REQ structure */ |
| 20590 | halNvImgDownloadParam.nvImageReqParams.isLastFragment =0; |
| 20591 | halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize = usCurrentFragmentSize; |
| 20592 | } |
| 20593 | |
| 20594 | /*----------------------------------------------------------------------- |
| 20595 | Get message buffer |
| 20596 | -----------------------------------------------------------------------*/ |
| 20597 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,WDI_NV_DOWNLOAD_REQ, |
| 20598 | sizeof(halNvImgDownloadParam.nvImageReqParams)+ usCurrentFragmentSize, |
| 20599 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20600 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20601 | (usDataOffset + sizeof(halNvImgDownloadParam.nvImageReqParams) + usCurrentFragmentSize ))) |
| 20602 | { |
| 20603 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 20604 | "Unable to get send buffer in NV Download req %x %x ", |
| 20605 | pEventData, pwdiNvDownloadReqParams); |
| 20606 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20607 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20608 | } |
| 20609 | |
| 20610 | /* Copying the Hal NV download REQ structure */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20611 | wpalMemoryCopy(pSendBuffer + usDataOffset , |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20612 | &halNvImgDownloadParam.nvImageReqParams ,sizeof(tHalNvImgDownloadReqParams)); |
| 20613 | |
| 20614 | /* Appending the NV image fragment */ |
| 20615 | wpalMemoryCopy(pSendBuffer + usDataOffset + sizeof(tHalNvImgDownloadReqParams), |
| 20616 | (void *)(pSrcBuffer + halNvImgDownloadParam.nvImageReqParams.fragNumber * FRAGMENT_SIZE), |
| 20617 | usCurrentFragmentSize); |
| 20618 | |
| 20619 | pWDICtx->wdiReqStatusCB = pwdiNvDownloadReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20620 | pWDICtx->pReqStatusUserData = pwdiNvDownloadReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20621 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20622 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 20623 | wdiNvDownloadRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20624 | WDI_NV_DOWNLOAD_RESP); |
| 20625 | |
| 20626 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20627 | /*============================================================================ |
| 20628 | Helper inline functions for |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20629 | ============================================================================*/ |
| 20630 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20631 | @brief Helper routine used to find a session based on the BSSID |
| 20632 | @param pContext: pointer to the WLAN DAL context |
| 20633 | @param pDPContext: pointer to the Datapath context |
| 20634 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20635 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20636 | @return |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20637 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20638 | WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20639 | WDI_DS_AssignDatapathContext (void *pContext, void *pDPContext) |
| 20640 | { |
| 20641 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 20642 | |
| 20643 | pCB->pDPContext = pDPContext; |
| 20644 | return; |
| 20645 | } |
| 20646 | |
| 20647 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20648 | @brief Helper routine used to find a session based on the BSSID |
| 20649 | |
| 20650 | |
| 20651 | @param pContext: pointer to the WLAN DAL context |
| 20652 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20653 | @see |
| 20654 | @return pointer to Datapath context |
| 20655 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20656 | WPT_INLINE void * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20657 | WDI_DS_GetDatapathContext (void *pContext) |
| 20658 | { |
| 20659 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 20660 | return pCB->pDPContext; |
| 20661 | } |
| 20662 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20663 | @brief Helper routine used to find a session based on the BSSID |
| 20664 | |
| 20665 | |
| 20666 | @param pContext: pointer to the WLAN DAL context |
| 20667 | @param pDTDriverContext: pointer to the Transport Driver context |
| 20668 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20669 | @see |
| 20670 | @return void |
| 20671 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20672 | WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20673 | WDT_AssignTransportDriverContext (void *pContext, void *pDTDriverContext) |
| 20674 | { |
| 20675 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 20676 | |
| 20677 | pCB->pDTDriverContext = pDTDriverContext; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20678 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20679 | } |
| 20680 | |
| 20681 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20682 | @brief Helper routine used to find a session based on the BSSID |
| 20683 | |
| 20684 | |
| 20685 | @param pWDICtx: pointer to the WLAN DAL context |
| 20686 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20687 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20688 | @return pointer to datapath context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20689 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20690 | WPT_INLINE void * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20691 | WDT_GetTransportDriverContext (void *pContext) |
| 20692 | { |
| 20693 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20694 | return(pCB->pDTDriverContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20695 | } |
| 20696 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20697 | /*============================================================================ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20698 | Helper inline converters |
| 20699 | ============================================================================*/ |
| 20700 | /*Convert WDI driver type into HAL driver type*/ |
| 20701 | WPT_STATIC WPT_INLINE WDI_Status |
| 20702 | WDI_HAL_2_WDI_STATUS |
| 20703 | ( |
| 20704 | eHalStatus halStatus |
| 20705 | ) |
| 20706 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20707 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20708 | the chances of getting inlined*/ |
| 20709 | switch( halStatus ) |
| 20710 | { |
| 20711 | case eHAL_STATUS_SUCCESS: |
| 20712 | case eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO: |
| 20713 | case eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO: |
| 20714 | return WDI_STATUS_SUCCESS; |
| 20715 | case eHAL_STATUS_FAILURE: |
| 20716 | return WDI_STATUS_E_FAILURE; |
| 20717 | case eHAL_STATUS_FAILED_ALLOC: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20718 | return WDI_STATUS_MEM_FAILURE; |
| 20719 | /*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] | 20720 | they refer to specific internal modules of our device*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20721 | default: |
| 20722 | return WDI_STATUS_DEV_INTERNAL_FAILURE; |
| 20723 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20724 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20725 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20726 | }/*WDI_HAL_2_WDI_STATUS*/ |
| 20727 | |
| 20728 | /*Convert WDI request type into HAL request type*/ |
| 20729 | WPT_STATIC WPT_INLINE tHalHostMsgType |
| 20730 | WDI_2_HAL_REQ_TYPE |
| 20731 | ( |
| 20732 | WDI_RequestEnumType wdiReqType |
| 20733 | ) |
| 20734 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20735 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20736 | the chances of getting inlined*/ |
| 20737 | switch( wdiReqType ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20738 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20739 | case WDI_START_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20740 | return WLAN_HAL_START_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20741 | case WDI_STOP_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20742 | return WLAN_HAL_STOP_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20743 | case WDI_INIT_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20744 | return WLAN_HAL_INIT_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20745 | case WDI_START_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20746 | return WLAN_HAL_START_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20747 | case WDI_END_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20748 | return WLAN_HAL_END_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20749 | case WDI_FINISH_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20750 | return WLAN_HAL_FINISH_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20751 | case WDI_JOIN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20752 | return WLAN_HAL_JOIN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20753 | case WDI_CONFIG_BSS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20754 | return WLAN_HAL_CONFIG_BSS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20755 | case WDI_DEL_BSS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20756 | return WLAN_HAL_DELETE_BSS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20757 | case WDI_POST_ASSOC_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20758 | return WLAN_HAL_POST_ASSOC_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20759 | case WDI_DEL_STA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20760 | return WLAN_HAL_DELETE_STA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20761 | case WDI_SET_BSS_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20762 | return WLAN_HAL_SET_BSSKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20763 | case WDI_RMV_BSS_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20764 | return WLAN_HAL_RMV_BSSKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20765 | case WDI_SET_STA_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20766 | return WLAN_HAL_SET_STAKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20767 | case WDI_RMV_STA_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20768 | return WLAN_HAL_RMV_STAKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20769 | case WDI_SET_STA_BCAST_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20770 | return WLAN_HAL_SET_BCASTKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20771 | case WDI_RMV_STA_BCAST_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20772 | //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] | 20773 | return WLAN_HAL_RMV_STAKEY_REQ; |
| 20774 | case WDI_ADD_TS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20775 | return WLAN_HAL_ADD_TS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20776 | case WDI_DEL_TS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20777 | return WLAN_HAL_DEL_TS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20778 | case WDI_UPD_EDCA_PRMS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20779 | return WLAN_HAL_UPD_EDCA_PARAMS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20780 | case WDI_ADD_BA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20781 | return WLAN_HAL_ADD_BA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20782 | case WDI_DEL_BA_REQ: |
| 20783 | return WLAN_HAL_DEL_BA_REQ; |
| 20784 | #ifdef FEATURE_WLAN_CCX |
| 20785 | case WDI_TSM_STATS_REQ: |
| 20786 | return WLAN_HAL_TSM_STATS_REQ; |
| 20787 | #endif |
| 20788 | case WDI_CH_SWITCH_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20789 | return WLAN_HAL_CH_SWITCH_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20790 | case WDI_CONFIG_STA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20791 | return WLAN_HAL_CONFIG_STA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20792 | case WDI_SET_LINK_ST_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20793 | return WLAN_HAL_SET_LINK_ST_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20794 | case WDI_GET_STATS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20795 | return WLAN_HAL_GET_STATS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20796 | case WDI_UPDATE_CFG_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20797 | return WLAN_HAL_UPDATE_CFG_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20798 | case WDI_ADD_BA_SESSION_REQ: |
| 20799 | return WLAN_HAL_ADD_BA_SESSION_REQ; |
| 20800 | case WDI_TRIGGER_BA_REQ: |
| 20801 | return WLAN_HAL_TRIGGER_BA_REQ; |
| 20802 | case WDI_UPD_BCON_PRMS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20803 | return WLAN_HAL_UPDATE_BEACON_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20804 | case WDI_SND_BCON_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20805 | return WLAN_HAL_SEND_BEACON_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20806 | case WDI_UPD_PROBE_RSP_TEMPLATE_REQ: |
| 20807 | return WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ; |
| 20808 | case WDI_SET_MAX_TX_POWER_REQ: |
| 20809 | return WLAN_HAL_SET_MAX_TX_POWER_REQ; |
| 20810 | #ifdef WLAN_FEATURE_P2P |
| 20811 | case WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ: |
| 20812 | return WLAN_HAL_SET_P2P_GONOA_REQ; |
| 20813 | #endif |
| 20814 | case WDI_ENTER_IMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20815 | return WLAN_HAL_ENTER_IMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20816 | case WDI_EXIT_IMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20817 | return WLAN_HAL_EXIT_IMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20818 | case WDI_ENTER_BMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20819 | return WLAN_HAL_ENTER_BMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20820 | case WDI_EXIT_BMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20821 | return WLAN_HAL_EXIT_BMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20822 | case WDI_ENTER_UAPSD_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20823 | return WLAN_HAL_ENTER_UAPSD_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20824 | case WDI_EXIT_UAPSD_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20825 | return WLAN_HAL_EXIT_UAPSD_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20826 | case WDI_SET_UAPSD_PARAM_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20827 | return WLAN_HAL_SET_UAPSD_AC_PARAMS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20828 | case WDI_UPDATE_UAPSD_PARAM_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20829 | return WLAN_HAL_UPDATE_UAPSD_PARAM_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20830 | case WDI_CONFIGURE_RXP_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20831 | return WLAN_HAL_CONFIGURE_RXP_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20832 | case WDI_SET_BEACON_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20833 | return WLAN_HAL_ADD_BCN_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20834 | case WDI_REM_BEACON_FILTER_REQ: |
| 20835 | return WLAN_HAL_REM_BCN_FILTER_REQ; |
| 20836 | case WDI_SET_RSSI_THRESHOLDS_REQ: |
| 20837 | return WLAN_HAL_SET_RSSI_THRESH_REQ; |
| 20838 | case WDI_HOST_OFFLOAD_REQ: |
| 20839 | return WLAN_HAL_HOST_OFFLOAD_REQ; |
| 20840 | case WDI_WOWL_ADD_BC_PTRN_REQ: |
| 20841 | return WLAN_HAL_ADD_WOWL_BCAST_PTRN; |
| 20842 | case WDI_WOWL_DEL_BC_PTRN_REQ: |
| 20843 | return WLAN_HAL_DEL_WOWL_BCAST_PTRN; |
| 20844 | case WDI_WOWL_ENTER_REQ: |
| 20845 | return WLAN_HAL_ENTER_WOWL_REQ; |
| 20846 | case WDI_WOWL_EXIT_REQ: |
| 20847 | return WLAN_HAL_EXIT_WOWL_REQ; |
| 20848 | case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ: |
| 20849 | return WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ; |
| 20850 | case WDI_NV_DOWNLOAD_REQ: |
| 20851 | return WLAN_HAL_DOWNLOAD_NV_REQ; |
| 20852 | case WDI_FLUSH_AC_REQ: |
| 20853 | return WLAN_HAL_TL_HAL_FLUSH_AC_REQ; |
| 20854 | case WDI_BTAMP_EVENT_REQ: |
| 20855 | return WLAN_HAL_SIGNAL_BTAMP_EVENT_REQ; |
| 20856 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 20857 | case WDI_AGGR_ADD_TS_REQ: |
| 20858 | return WLAN_HAL_AGGR_ADD_TS_REQ; |
| 20859 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 20860 | #ifdef ANI_MANF_DIAG |
| 20861 | case WDI_FTM_CMD_REQ: |
| 20862 | return WLAN_HAL_PROCESS_PTT_REQ; |
| 20863 | #endif /* ANI_MANF_DIAG */ |
| 20864 | case WDI_ADD_STA_SELF_REQ: |
| 20865 | return WLAN_HAL_ADD_STA_SELF_REQ; |
| 20866 | case WDI_DEL_STA_SELF_REQ: |
| 20867 | return WLAN_HAL_DEL_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20868 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 20869 | case WDI_START_OEM_DATA_REQ: |
| 20870 | return WLAN_HAL_START_OEM_DATA_REQ; |
| 20871 | #endif /* FEATURE_OEM_DATA_SUPPORT */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20872 | case WDI_HOST_RESUME_REQ: |
| 20873 | return WLAN_HAL_HOST_RESUME_REQ; |
| 20874 | case WDI_HOST_SUSPEND_IND: |
| 20875 | return WLAN_HAL_HOST_SUSPEND_IND; |
| 20876 | case WDI_KEEP_ALIVE_REQ: |
| 20877 | return WLAN_HAL_KEEP_ALIVE_REQ; |
| 20878 | |
| 20879 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 20880 | case WDI_SET_PREF_NETWORK_REQ: |
| 20881 | return WLAN_HAL_SET_PREF_NETWORK_REQ; |
| 20882 | case WDI_SET_RSSI_FILTER_REQ: |
| 20883 | return WLAN_HAL_SET_RSSI_FILTER_REQ; |
| 20884 | case WDI_UPDATE_SCAN_PARAMS_REQ: |
| 20885 | return WLAN_HAL_UPDATE_SCAN_PARAM_REQ; |
| 20886 | #endif // FEATURE_WLAN_SCAN_PNO |
| 20887 | case WDI_SET_TX_PER_TRACKING_REQ: |
| 20888 | return WLAN_HAL_SET_TX_PER_TRACKING_REQ; |
| 20889 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 20890 | case WDI_8023_MULTICAST_LIST_REQ: |
| 20891 | return WLAN_HAL_8023_MULTICAST_LIST_REQ; |
| 20892 | case WDI_RECEIVE_FILTER_SET_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20893 | return WLAN_HAL_SET_PACKET_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20894 | case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ: |
| 20895 | return WLAN_HAL_PACKET_FILTER_MATCH_COUNT_REQ; |
| 20896 | case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ: |
| 20897 | return WLAN_HAL_CLEAR_PACKET_FILTER_REQ; |
| 20898 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 20899 | case WDI_HAL_DUMP_CMD_REQ: |
| 20900 | return WLAN_HAL_DUMP_COMMAND_REQ; |
| 20901 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 20902 | case WDI_GTK_OFFLOAD_REQ: |
| 20903 | return WLAN_HAL_GTK_OFFLOAD_REQ; |
| 20904 | case WDI_GTK_OFFLOAD_GETINFO_REQ: |
| 20905 | return WLAN_HAL_GTK_OFFLOAD_GETINFO_REQ; |
| 20906 | #endif /* WLAN_FEATURE_GTK_OFFLOAD */ |
| 20907 | |
| 20908 | case WDI_INIT_SCAN_CON_REQ: |
| 20909 | return WLAN_HAL_INIT_SCAN_CON_REQ; |
| 20910 | case WDI_SET_POWER_PARAMS_REQ: |
| 20911 | return WLAN_HAL_SET_POWER_PARAMS_REQ; |
| 20912 | case WDI_SET_TM_LEVEL_REQ: |
| 20913 | return WLAN_HAL_SET_THERMAL_MITIGATION_REQ; |
| 20914 | case WDI_FEATURE_CAPS_EXCHANGE_REQ: |
| 20915 | return WLAN_HAL_FEATURE_CAPS_EXCHANGE_REQ; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 20916 | #ifdef WLAN_FEATURE_11AC |
| 20917 | case WDI_UPDATE_VHT_OP_MODE_REQ: |
| 20918 | return WLAN_HAL_UPDATE_VHT_OP_MODE_REQ; |
| 20919 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20920 | default: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20921 | return WLAN_HAL_MSG_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20922 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20923 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20924 | }/*WDI_2_HAL_REQ_TYPE*/ |
| 20925 | |
| 20926 | /*Convert WDI response type into HAL response type*/ |
| 20927 | WPT_STATIC WPT_INLINE WDI_ResponseEnumType |
| 20928 | HAL_2_WDI_RSP_TYPE |
| 20929 | ( |
| 20930 | tHalHostMsgType halMsg |
| 20931 | ) |
| 20932 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20933 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20934 | the chances of getting inlined*/ |
| 20935 | switch( halMsg ) |
| 20936 | { |
| 20937 | case WLAN_HAL_START_RSP: |
| 20938 | return WDI_START_RESP; |
| 20939 | case WLAN_HAL_STOP_RSP: |
| 20940 | return WDI_STOP_RESP; |
| 20941 | case WLAN_HAL_INIT_SCAN_RSP: |
| 20942 | return WDI_INIT_SCAN_RESP; |
| 20943 | case WLAN_HAL_START_SCAN_RSP: |
| 20944 | return WDI_START_SCAN_RESP; |
| 20945 | case WLAN_HAL_END_SCAN_RSP: |
| 20946 | return WDI_END_SCAN_RESP; |
| 20947 | case WLAN_HAL_FINISH_SCAN_RSP: |
| 20948 | return WDI_FINISH_SCAN_RESP; |
| 20949 | case WLAN_HAL_CONFIG_STA_RSP: |
| 20950 | return WDI_CONFIG_STA_RESP; |
| 20951 | case WLAN_HAL_DELETE_STA_RSP: |
| 20952 | return WDI_DEL_STA_RESP; |
| 20953 | case WLAN_HAL_CONFIG_BSS_RSP: |
| 20954 | return WDI_CONFIG_BSS_RESP; |
| 20955 | case WLAN_HAL_DELETE_BSS_RSP: |
| 20956 | return WDI_DEL_BSS_RESP; |
| 20957 | case WLAN_HAL_JOIN_RSP: |
| 20958 | return WDI_JOIN_RESP; |
| 20959 | case WLAN_HAL_POST_ASSOC_RSP: |
| 20960 | return WDI_POST_ASSOC_RESP; |
| 20961 | case WLAN_HAL_SET_BSSKEY_RSP: |
| 20962 | return WDI_SET_BSS_KEY_RESP; |
| 20963 | case WLAN_HAL_SET_STAKEY_RSP: |
| 20964 | return WDI_SET_STA_KEY_RESP; |
| 20965 | case WLAN_HAL_RMV_BSSKEY_RSP: |
| 20966 | return WDI_RMV_BSS_KEY_RESP; |
| 20967 | case WLAN_HAL_RMV_STAKEY_RSP: |
| 20968 | return WDI_RMV_STA_KEY_RESP; |
| 20969 | case WLAN_HAL_SET_BCASTKEY_RSP: |
| 20970 | return WDI_SET_STA_BCAST_KEY_RESP; |
| 20971 | //Some conflict in the old code - check this: case WLAN_HAL_RMV_BCASTKEY_RSP: |
| 20972 | // return WDI_RMV_STA_BCAST_KEY_RESP; |
| 20973 | case WLAN_HAL_ADD_TS_RSP: |
| 20974 | return WDI_ADD_TS_RESP; |
| 20975 | case WLAN_HAL_DEL_TS_RSP: |
| 20976 | return WDI_DEL_TS_RESP; |
| 20977 | case WLAN_HAL_UPD_EDCA_PARAMS_RSP: |
| 20978 | return WDI_UPD_EDCA_PRMS_RESP; |
| 20979 | case WLAN_HAL_ADD_BA_RSP: |
| 20980 | return WDI_ADD_BA_RESP; |
| 20981 | case WLAN_HAL_DEL_BA_RSP: |
| 20982 | return WDI_DEL_BA_RESP; |
| 20983 | #ifdef FEATURE_WLAN_CCX |
| 20984 | case WLAN_HAL_TSM_STATS_RSP: |
| 20985 | return WDI_TSM_STATS_RESP; |
| 20986 | #endif |
| 20987 | case WLAN_HAL_CH_SWITCH_RSP: |
| 20988 | return WDI_CH_SWITCH_RESP; |
| 20989 | case WLAN_HAL_SET_LINK_ST_RSP: |
| 20990 | return WDI_SET_LINK_ST_RESP; |
| 20991 | case WLAN_HAL_GET_STATS_RSP: |
| 20992 | return WDI_GET_STATS_RESP; |
| 20993 | case WLAN_HAL_UPDATE_CFG_RSP: |
| 20994 | return WDI_UPDATE_CFG_RESP; |
| 20995 | case WLAN_HAL_ADD_BA_SESSION_RSP: |
| 20996 | return WDI_ADD_BA_SESSION_RESP; |
| 20997 | case WLAN_HAL_TRIGGER_BA_RSP: |
| 20998 | return WDI_TRIGGER_BA_RESP; |
| 20999 | case WLAN_HAL_UPDATE_BEACON_RSP: |
| 21000 | return WDI_UPD_BCON_PRMS_RESP; |
| 21001 | case WLAN_HAL_SEND_BEACON_RSP: |
| 21002 | return WDI_SND_BCON_RESP; |
| 21003 | case WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP: |
| 21004 | return WDI_UPD_PROBE_RSP_TEMPLATE_RESP; |
| 21005 | /*Indications*/ |
| 21006 | case WLAN_HAL_RSSI_NOTIFICATION_IND: |
| 21007 | return WDI_HAL_RSSI_NOTIFICATION_IND; |
| 21008 | case WLAN_HAL_MISSED_BEACON_IND: |
| 21009 | return WDI_HAL_MISSED_BEACON_IND; |
| 21010 | case WLAN_HAL_UNKNOWN_ADDR2_FRAME_RX_IND: |
| 21011 | return WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND; |
| 21012 | case WLAN_HAL_MIC_FAILURE_IND: |
| 21013 | return WDI_HAL_MIC_FAILURE_IND; |
| 21014 | case WLAN_HAL_FATAL_ERROR_IND: |
| 21015 | return WDI_HAL_FATAL_ERROR_IND; |
| 21016 | case WLAN_HAL_DELETE_STA_CONTEXT_IND: |
| 21017 | return WDI_HAL_DEL_STA_IND; |
| 21018 | case WLAN_HAL_COEX_IND: |
| 21019 | return WDI_HAL_COEX_IND; |
| 21020 | case WLAN_HAL_OTA_TX_COMPL_IND: |
| 21021 | return WDI_HAL_TX_COMPLETE_IND; |
| 21022 | #ifdef WLAN_FEATURE_P2P |
| 21023 | case WLAN_HAL_P2P_NOA_ATTR_IND: |
| 21024 | return WDI_HAL_P2P_NOA_ATTR_IND; |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 21025 | case WLAN_HAL_P2P_NOA_START_IND: |
| 21026 | return WDI_HAL_P2P_NOA_START_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21027 | #endif |
| 21028 | case WLAN_HAL_TX_PER_HIT_IND: |
| 21029 | return WDI_HAL_TX_PER_HIT_IND; |
| 21030 | case WLAN_HAL_SET_MAX_TX_POWER_RSP: |
| 21031 | return WDI_SET_MAX_TX_POWER_RESP; |
| 21032 | #ifdef WLAN_FEATURE_P2P |
| 21033 | case WLAN_HAL_SET_P2P_GONOA_RSP: |
| 21034 | return WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP; |
| 21035 | #endif |
| 21036 | case WLAN_HAL_ENTER_IMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21037 | return WDI_ENTER_IMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21038 | case WLAN_HAL_EXIT_IMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21039 | return WDI_EXIT_IMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21040 | case WLAN_HAL_ENTER_BMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21041 | return WDI_ENTER_BMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21042 | case WLAN_HAL_EXIT_BMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21043 | return WDI_EXIT_BMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21044 | case WLAN_HAL_ENTER_UAPSD_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21045 | return WDI_ENTER_UAPSD_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21046 | case WLAN_HAL_EXIT_UAPSD_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21047 | return WDI_EXIT_UAPSD_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21048 | case WLAN_HAL_SET_UAPSD_AC_PARAMS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21049 | return WDI_SET_UAPSD_PARAM_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21050 | case WLAN_HAL_UPDATE_UAPSD_PARAM_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21051 | return WDI_UPDATE_UAPSD_PARAM_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21052 | case WLAN_HAL_CONFIGURE_RXP_FILTER_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21053 | return WDI_CONFIGURE_RXP_FILTER_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21054 | case WLAN_HAL_ADD_BCN_FILTER_RSP: |
| 21055 | return WDI_SET_BEACON_FILTER_RESP; |
| 21056 | case WLAN_HAL_REM_BCN_FILTER_RSP: |
| 21057 | return WDI_REM_BEACON_FILTER_RESP; |
| 21058 | case WLAN_HAL_SET_RSSI_THRESH_RSP: |
| 21059 | return WDI_SET_RSSI_THRESHOLDS_RESP; |
| 21060 | case WLAN_HAL_HOST_OFFLOAD_RSP: |
| 21061 | return WDI_HOST_OFFLOAD_RESP; |
| 21062 | case WLAN_HAL_ADD_WOWL_BCAST_PTRN_RSP: |
| 21063 | return WDI_WOWL_ADD_BC_PTRN_RESP; |
| 21064 | case WLAN_HAL_DEL_WOWL_BCAST_PTRN_RSP: |
| 21065 | return WDI_WOWL_DEL_BC_PTRN_RESP; |
| 21066 | case WLAN_HAL_ENTER_WOWL_RSP: |
| 21067 | return WDI_WOWL_ENTER_RESP; |
| 21068 | case WLAN_HAL_EXIT_WOWL_RSP: |
| 21069 | return WDI_WOWL_EXIT_RESP; |
| 21070 | case WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP: |
| 21071 | return WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP; |
| 21072 | case WLAN_HAL_DOWNLOAD_NV_RSP: |
| 21073 | return WDI_NV_DOWNLOAD_RESP; |
| 21074 | case WLAN_HAL_TL_HAL_FLUSH_AC_RSP: |
| 21075 | return WDI_FLUSH_AC_RESP; |
| 21076 | case WLAN_HAL_SIGNAL_BTAMP_EVENT_RSP: |
| 21077 | return WDI_BTAMP_EVENT_RESP; |
| 21078 | #ifdef ANI_MANF_DIAG |
| 21079 | case WLAN_HAL_PROCESS_PTT_RSP: |
| 21080 | return WDI_FTM_CMD_RESP; |
| 21081 | #endif /* ANI_MANF_DIAG */ |
| 21082 | case WLAN_HAL_ADD_STA_SELF_RSP: |
| 21083 | return WDI_ADD_STA_SELF_RESP; |
| 21084 | case WLAN_HAL_DEL_STA_SELF_RSP: |
| 21085 | return WDI_DEL_STA_SELF_RESP; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21086 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 21087 | case WLAN_HAL_START_OEM_DATA_RSP: |
| 21088 | return WDI_START_OEM_DATA_RESP; |
| 21089 | #endif /* FEATURE_OEM_DATA_SUPPORT */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21090 | case WLAN_HAL_HOST_RESUME_RSP: |
| 21091 | return WDI_HOST_RESUME_RESP; |
| 21092 | case WLAN_HAL_KEEP_ALIVE_RSP: |
| 21093 | return WDI_KEEP_ALIVE_RESP; |
| 21094 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 21095 | case WLAN_HAL_SET_PREF_NETWORK_RSP: |
| 21096 | return WDI_SET_PREF_NETWORK_RESP; |
| 21097 | case WLAN_HAL_SET_RSSI_FILTER_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21098 | return WDI_SET_RSSI_FILTER_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21099 | case WLAN_HAL_UPDATE_SCAN_PARAM_RSP: |
| 21100 | return WDI_UPDATE_SCAN_PARAMS_RESP; |
| 21101 | case WLAN_HAL_PREF_NETW_FOUND_IND: |
| 21102 | return WDI_HAL_PREF_NETWORK_FOUND_IND; |
| 21103 | #endif // FEATURE_WLAN_SCAN_PNO |
| 21104 | case WLAN_HAL_SET_TX_PER_TRACKING_RSP: |
| 21105 | return WDI_SET_TX_PER_TRACKING_RESP; |
| 21106 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 21107 | case WLAN_HAL_8023_MULTICAST_LIST_RSP: |
| 21108 | return WDI_8023_MULTICAST_LIST_RESP; |
| 21109 | case WLAN_HAL_SET_PACKET_FILTER_RSP: |
| 21110 | return WDI_RECEIVE_FILTER_SET_FILTER_RESP; |
| 21111 | case WLAN_HAL_PACKET_FILTER_MATCH_COUNT_RSP: |
| 21112 | return WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP; |
| 21113 | case WLAN_HAL_CLEAR_PACKET_FILTER_RSP: |
| 21114 | return WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP; |
| 21115 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 21116 | |
| 21117 | case WLAN_HAL_DUMP_COMMAND_RSP: |
| 21118 | return WDI_HAL_DUMP_CMD_RESP; |
| 21119 | case WLAN_HAL_SET_POWER_PARAMS_RSP: |
| 21120 | return WDI_SET_POWER_PARAMS_RESP; |
| 21121 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 21122 | case WLAN_HAL_AGGR_ADD_TS_RSP: |
| 21123 | return WDI_AGGR_ADD_TS_RESP; |
| 21124 | #endif |
| 21125 | |
| 21126 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 21127 | case WLAN_HAL_GTK_OFFLOAD_RSP: |
| 21128 | return WDI_GTK_OFFLOAD_RESP; |
| 21129 | case WLAN_HAL_GTK_OFFLOAD_GETINFO_RSP: |
| 21130 | return WDI_GTK_OFFLOAD_GETINFO_RESP; |
| 21131 | #endif /* WLAN_FEATURE_GTK_OFFLOAD */ |
| 21132 | #ifdef WLAN_WAKEUP_EVENTS |
| 21133 | case WLAN_HAL_WAKE_REASON_IND: |
| 21134 | return WDI_HAL_WAKE_REASON_IND; |
| 21135 | #endif // WLAN_WAKEUP_EVENTS |
| 21136 | |
| 21137 | case WLAN_HAL_SET_THERMAL_MITIGATION_RSP: |
| 21138 | return WDI_SET_TM_LEVEL_RESP; |
| 21139 | case WLAN_HAL_FEATURE_CAPS_EXCHANGE_RSP: |
| 21140 | return WDI_FEATURE_CAPS_EXCHANGE_RESP; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 21141 | #ifdef WLAN_FEATURE_11AC |
| 21142 | case WLAN_HAL_UPDATE_VHT_OP_MODE_RSP: |
| 21143 | return WDI_UPDATE_VHT_OP_MODE_RESP; |
| 21144 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21145 | default: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21146 | return eDRIVER_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21147 | } |
| 21148 | |
| 21149 | }/*HAL_2_WDI_RSP_TYPE*/ |
| 21150 | |
| 21151 | |
| 21152 | /*Convert WDI driver type into HAL driver type*/ |
| 21153 | WPT_STATIC WPT_INLINE tDriverType |
| 21154 | WDI_2_HAL_DRV_TYPE |
| 21155 | ( |
| 21156 | WDI_DriverType wdiDriverType |
| 21157 | ) |
| 21158 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21159 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21160 | the chances of getting inlined*/ |
| 21161 | switch( wdiDriverType ) |
| 21162 | { |
| 21163 | case WDI_DRIVER_TYPE_PRODUCTION: |
| 21164 | return eDRIVER_TYPE_PRODUCTION; |
| 21165 | case WDI_DRIVER_TYPE_MFG: |
| 21166 | return eDRIVER_TYPE_MFG; |
| 21167 | case WDI_DRIVER_TYPE_DVT: |
| 21168 | return eDRIVER_TYPE_DVT; |
| 21169 | } |
| 21170 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21171 | return eDRIVER_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21172 | }/*WDI_2_HAL_DRV_TYPE*/ |
| 21173 | |
| 21174 | |
| 21175 | /*Convert WDI stop reason into HAL stop reason*/ |
| 21176 | WPT_STATIC WPT_INLINE tHalStopType |
| 21177 | WDI_2_HAL_STOP_REASON |
| 21178 | ( |
| 21179 | WDI_StopType wdiDriverType |
| 21180 | ) |
| 21181 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21182 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21183 | the chances of getting inlined*/ |
| 21184 | switch( wdiDriverType ) |
| 21185 | { |
| 21186 | case WDI_STOP_TYPE_SYS_RESET: |
| 21187 | return HAL_STOP_TYPE_SYS_RESET; |
| 21188 | case WDI_DRIVER_TYPE_MFG: |
| 21189 | return WDI_STOP_TYPE_SYS_DEEP_SLEEP; |
| 21190 | case WDI_STOP_TYPE_RF_KILL: |
| 21191 | return HAL_STOP_TYPE_RF_KILL; |
| 21192 | } |
| 21193 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21194 | return HAL_STOP_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21195 | }/*WDI_2_HAL_STOP_REASON*/ |
| 21196 | |
| 21197 | |
| 21198 | /*Convert WDI scan mode type into HAL scan mode type*/ |
| 21199 | WPT_STATIC WPT_INLINE eHalSysMode |
| 21200 | WDI_2_HAL_SCAN_MODE |
| 21201 | ( |
| 21202 | WDI_ScanMode wdiScanMode |
| 21203 | ) |
| 21204 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21205 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21206 | the chances of getting inlined*/ |
| 21207 | switch( wdiScanMode ) |
| 21208 | { |
| 21209 | case WDI_SCAN_MODE_NORMAL: |
| 21210 | return eHAL_SYS_MODE_NORMAL; |
| 21211 | case WDI_SCAN_MODE_LEARN: |
| 21212 | return eHAL_SYS_MODE_LEARN; |
| 21213 | case WDI_SCAN_MODE_SCAN: |
| 21214 | return eHAL_SYS_MODE_SCAN; |
| 21215 | case WDI_SCAN_MODE_PROMISC: |
| 21216 | return eHAL_SYS_MODE_PROMISC; |
| 21217 | case WDI_SCAN_MODE_SUSPEND_LINK: |
| 21218 | return eHAL_SYS_MODE_SUSPEND_LINK; |
Madan Mohan Koyyalamudi | 9b87678 | 2012-10-11 16:22:51 -0700 | [diff] [blame] | 21219 | case WDI_SCAN_MODE_ROAM_SCAN: |
| 21220 | return eHAL_SYS_MODE_ROAM_SCAN; |
| 21221 | case WDI_SCAN_MODE_ROAM_SUSPEND_LINK: |
| 21222 | return eHAL_SYS_MODE_ROAM_SUSPEND_LINK; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21223 | } |
| 21224 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21225 | return eHAL_SYS_MODE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21226 | }/*WDI_2_HAL_SCAN_MODE*/ |
| 21227 | |
| 21228 | /*Convert WDI sec ch offset into HAL sec ch offset type*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21229 | WPT_STATIC WPT_INLINE ePhyChanBondState |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21230 | WDI_2_HAL_SEC_CH_OFFSET |
| 21231 | ( |
| 21232 | WDI_HTSecondaryChannelOffset wdiSecChOffset |
| 21233 | ) |
| 21234 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21235 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21236 | the chances of getting inlined*/ |
| 21237 | switch( wdiSecChOffset ) |
| 21238 | { |
| 21239 | case WDI_SECONDARY_CHANNEL_OFFSET_NONE: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21240 | return PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21241 | case WDI_SECONDARY_CHANNEL_OFFSET_UP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21242 | return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21243 | case WDI_SECONDARY_CHANNEL_OFFSET_DOWN: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21244 | return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 21245 | #ifdef WLAN_FEATURE_11AC |
| 21246 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: |
| 21247 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 21248 | case WDI_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: |
| 21249 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 21250 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: |
| 21251 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED; |
| 21252 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 21253 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 21254 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 21255 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 21256 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 21257 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; |
| 21258 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 21259 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; |
| 21260 | #endif |
| 21261 | default: |
| 21262 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21263 | } |
| 21264 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21265 | return PHY_CHANNEL_BONDING_STATE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21266 | }/*WDI_2_HAL_SEC_CH_OFFSET*/ |
| 21267 | |
| 21268 | /*Convert WDI BSS type into HAL BSS type*/ |
| 21269 | WPT_STATIC WPT_INLINE tSirBssType |
| 21270 | WDI_2_HAL_BSS_TYPE |
| 21271 | ( |
| 21272 | WDI_BssType wdiBSSType |
| 21273 | ) |
| 21274 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21275 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21276 | the chances of getting inlined*/ |
| 21277 | switch( wdiBSSType ) |
| 21278 | { |
| 21279 | case WDI_INFRASTRUCTURE_MODE: |
| 21280 | return eSIR_INFRASTRUCTURE_MODE; |
| 21281 | case WDI_INFRA_AP_MODE: |
| 21282 | return eSIR_INFRA_AP_MODE; |
| 21283 | case WDI_IBSS_MODE: |
| 21284 | return eSIR_IBSS_MODE; |
| 21285 | case WDI_BTAMP_STA_MODE: |
| 21286 | return eSIR_BTAMP_STA_MODE; |
| 21287 | case WDI_BTAMP_AP_MODE: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21288 | return eSIR_BTAMP_AP_MODE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21289 | case WDI_BSS_AUTO_MODE: |
| 21290 | return eSIR_AUTO_MODE; |
| 21291 | } |
| 21292 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21293 | return eSIR_DONOT_USE_BSS_TYPE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21294 | }/*WDI_2_HAL_BSS_TYPE*/ |
| 21295 | |
| 21296 | /*Convert WDI NW type into HAL NW type*/ |
| 21297 | WPT_STATIC WPT_INLINE tSirNwType |
| 21298 | WDI_2_HAL_NW_TYPE |
| 21299 | ( |
| 21300 | WDI_NwType wdiNWType |
| 21301 | ) |
| 21302 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21303 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21304 | the chances of getting inlined*/ |
| 21305 | switch( wdiNWType ) |
| 21306 | { |
| 21307 | case WDI_11A_NW_TYPE: |
| 21308 | return eSIR_11A_NW_TYPE; |
| 21309 | case WDI_11B_NW_TYPE: |
| 21310 | return eSIR_11B_NW_TYPE; |
| 21311 | case WDI_11G_NW_TYPE: |
| 21312 | return eSIR_11G_NW_TYPE; |
| 21313 | case WDI_11N_NW_TYPE: |
| 21314 | return eSIR_11N_NW_TYPE; |
| 21315 | } |
| 21316 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21317 | return eSIR_DONOT_USE_NW_TYPE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21318 | }/*WDI_2_HAL_NW_TYPE*/ |
| 21319 | |
| 21320 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 21321 | WPT_STATIC WPT_INLINE ePhyChanBondState |
| 21322 | WDI_2_HAL_CB_STATE |
| 21323 | ( |
| 21324 | WDI_PhyChanBondState wdiCbState |
| 21325 | ) |
| 21326 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21327 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21328 | the chances of getting inlined*/ |
| 21329 | switch ( wdiCbState ) |
| 21330 | { |
| 21331 | case WDI_PHY_SINGLE_CHANNEL_CENTERED: |
| 21332 | return PHY_SINGLE_CHANNEL_CENTERED; |
| 21333 | case WDI_PHY_DOUBLE_CHANNEL_LOW_PRIMARY: |
| 21334 | return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 21335 | case WDI_PHY_DOUBLE_CHANNEL_CENTERED: |
| 21336 | return PHY_DOUBLE_CHANNEL_CENTERED; |
| 21337 | case WDI_PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: |
| 21338 | return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21339 | #ifdef WLAN_FEATURE_11AC |
| 21340 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: |
| 21341 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 21342 | case WDI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: |
| 21343 | return PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED; |
| 21344 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: |
| 21345 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED; |
| 21346 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 21347 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 21348 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 21349 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW; |
| 21350 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 21351 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; |
| 21352 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 21353 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; |
| 21354 | #endif |
| 21355 | case WDI_MAX_CB_STATE: |
| 21356 | default: |
| 21357 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21358 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21359 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21360 | return PHY_CHANNEL_BONDING_STATE_MAX; |
| 21361 | }/*WDI_2_HAL_CB_STATE*/ |
| 21362 | |
| 21363 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 21364 | WPT_STATIC WPT_INLINE tSirMacHTOperatingMode |
| 21365 | WDI_2_HAL_HT_OPER_MODE |
| 21366 | ( |
| 21367 | WDI_HTOperatingMode wdiHTOperMode |
| 21368 | ) |
| 21369 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21370 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21371 | the chances of getting inlined*/ |
| 21372 | switch ( wdiHTOperMode ) |
| 21373 | { |
| 21374 | case WDI_HT_OP_MODE_PURE: |
| 21375 | return eSIR_HT_OP_MODE_PURE; |
| 21376 | case WDI_HT_OP_MODE_OVERLAP_LEGACY: |
| 21377 | return eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 21378 | case WDI_HT_OP_MODE_NO_LEGACY_20MHZ_HT: |
| 21379 | return eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 21380 | case WDI_HT_OP_MODE_MIXED: |
| 21381 | return eSIR_HT_OP_MODE_MIXED; |
| 21382 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21383 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21384 | return eSIR_HT_OP_MODE_MAX; |
| 21385 | }/*WDI_2_HAL_HT_OPER_MODE*/ |
| 21386 | |
| 21387 | /*Convert WDI mimo PS type into HAL mimo PS type*/ |
| 21388 | WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState |
| 21389 | WDI_2_HAL_MIMO_PS |
| 21390 | ( |
| 21391 | WDI_HTMIMOPowerSaveState wdiHTOperMode |
| 21392 | ) |
| 21393 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21394 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21395 | the chances of getting inlined*/ |
| 21396 | switch ( wdiHTOperMode ) |
| 21397 | { |
| 21398 | case WDI_HT_MIMO_PS_STATIC: |
| 21399 | return eSIR_HT_MIMO_PS_STATIC; |
| 21400 | case WDI_HT_MIMO_PS_DYNAMIC: |
| 21401 | return eSIR_HT_MIMO_PS_DYNAMIC; |
| 21402 | case WDI_HT_MIMO_PS_NA: |
| 21403 | return eSIR_HT_MIMO_PS_NA; |
| 21404 | case WDI_HT_MIMO_PS_NO_LIMIT: |
| 21405 | return eSIR_HT_MIMO_PS_NO_LIMIT; |
| 21406 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21407 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21408 | return eSIR_HT_MIMO_PS_MAX; |
| 21409 | }/*WDI_2_HAL_MIMO_PS*/ |
| 21410 | |
| 21411 | /*Convert WDI ENC type into HAL ENC type*/ |
| 21412 | WPT_STATIC WPT_INLINE tAniEdType |
| 21413 | WDI_2_HAL_ENC_TYPE |
| 21414 | ( |
| 21415 | WDI_EncryptType wdiEncType |
| 21416 | ) |
| 21417 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21418 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21419 | the chances of getting inlined*/ |
| 21420 | switch ( wdiEncType ) |
| 21421 | { |
| 21422 | case WDI_ENCR_NONE: |
| 21423 | return eSIR_ED_NONE; |
| 21424 | |
| 21425 | case WDI_ENCR_WEP40: |
| 21426 | return eSIR_ED_WEP40; |
| 21427 | |
| 21428 | case WDI_ENCR_WEP104: |
| 21429 | return eSIR_ED_WEP104; |
| 21430 | |
| 21431 | case WDI_ENCR_TKIP: |
| 21432 | return eSIR_ED_TKIP; |
| 21433 | |
| 21434 | case WDI_ENCR_CCMP: |
| 21435 | return eSIR_ED_CCMP; |
| 21436 | |
| 21437 | case WDI_ENCR_AES_128_CMAC: |
| 21438 | return eSIR_ED_AES_128_CMAC; |
| 21439 | #if defined(FEATURE_WLAN_WAPI) |
| 21440 | case WDI_ENCR_WPI: |
| 21441 | return eSIR_ED_WPI; |
| 21442 | #endif |
| 21443 | default: |
| 21444 | return eSIR_ED_NOT_IMPLEMENTED; |
| 21445 | } |
| 21446 | |
| 21447 | }/*WDI_2_HAL_ENC_TYPE*/ |
| 21448 | |
| 21449 | /*Convert WDI WEP type into HAL WEP type*/ |
| 21450 | WPT_STATIC WPT_INLINE tAniWepType |
| 21451 | WDI_2_HAL_WEP_TYPE |
| 21452 | ( |
| 21453 | WDI_WepType wdiWEPType |
| 21454 | ) |
| 21455 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 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 | switch ( wdiWEPType ) |
| 21459 | { |
| 21460 | case WDI_WEP_STATIC: |
| 21461 | return eSIR_WEP_STATIC; |
| 21462 | |
| 21463 | case WDI_WEP_DYNAMIC: |
| 21464 | return eSIR_WEP_DYNAMIC; |
| 21465 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21466 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21467 | return eSIR_WEP_MAX; |
| 21468 | }/*WDI_2_HAL_WEP_TYPE*/ |
| 21469 | |
| 21470 | WPT_STATIC WPT_INLINE tSirLinkState |
| 21471 | WDI_2_HAL_LINK_STATE |
| 21472 | ( |
| 21473 | WDI_LinkStateType wdiLinkState |
| 21474 | ) |
| 21475 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21476 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21477 | the chances of getting inlined*/ |
| 21478 | switch ( wdiLinkState ) |
| 21479 | { |
| 21480 | case WDI_LINK_IDLE_STATE: |
| 21481 | return eSIR_LINK_IDLE_STATE; |
| 21482 | |
| 21483 | case WDI_LINK_PREASSOC_STATE: |
| 21484 | return eSIR_LINK_PREASSOC_STATE; |
| 21485 | |
| 21486 | case WDI_LINK_POSTASSOC_STATE: |
| 21487 | return eSIR_LINK_POSTASSOC_STATE; |
| 21488 | |
| 21489 | case WDI_LINK_AP_STATE: |
| 21490 | return eSIR_LINK_AP_STATE; |
| 21491 | |
| 21492 | case WDI_LINK_IBSS_STATE: |
| 21493 | return eSIR_LINK_IBSS_STATE; |
| 21494 | |
| 21495 | case WDI_LINK_BTAMP_PREASSOC_STATE: |
| 21496 | return eSIR_LINK_BTAMP_PREASSOC_STATE; |
| 21497 | |
| 21498 | case WDI_LINK_BTAMP_POSTASSOC_STATE: |
| 21499 | return eSIR_LINK_BTAMP_POSTASSOC_STATE; |
| 21500 | |
| 21501 | case WDI_LINK_BTAMP_AP_STATE: |
| 21502 | return eSIR_LINK_BTAMP_AP_STATE; |
| 21503 | |
| 21504 | case WDI_LINK_BTAMP_STA_STATE: |
| 21505 | return eSIR_LINK_BTAMP_STA_STATE; |
| 21506 | |
| 21507 | case WDI_LINK_LEARN_STATE: |
| 21508 | return eSIR_LINK_LEARN_STATE; |
| 21509 | |
| 21510 | case WDI_LINK_SCAN_STATE: |
| 21511 | return eSIR_LINK_SCAN_STATE; |
| 21512 | |
| 21513 | case WDI_LINK_FINISH_SCAN_STATE: |
| 21514 | return eSIR_LINK_FINISH_SCAN_STATE; |
| 21515 | |
| 21516 | case WDI_LINK_INIT_CAL_STATE: |
| 21517 | return eSIR_LINK_INIT_CAL_STATE; |
| 21518 | |
| 21519 | case WDI_LINK_FINISH_CAL_STATE: |
| 21520 | return eSIR_LINK_FINISH_CAL_STATE; |
| 21521 | |
| 21522 | #ifdef WLAN_FEATURE_P2P |
| 21523 | case WDI_LINK_LISTEN_STATE: |
| 21524 | return eSIR_LINK_LISTEN_STATE; |
| 21525 | #endif |
| 21526 | |
| 21527 | default: |
| 21528 | return eSIR_LINK_MAX; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21529 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21530 | } |
| 21531 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21532 | /*Translate a STA Context from WDI into HAL*/ |
| 21533 | WPT_STATIC WPT_INLINE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21534 | void |
| 21535 | WDI_CopyWDIStaCtxToHALStaCtx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21536 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21537 | tConfigStaParams* phalConfigSta, |
| 21538 | WDI_ConfigStaReqInfoType* pwdiConfigSta |
| 21539 | ) |
| 21540 | { |
| 21541 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21542 | #ifdef WLAN_FEATURE_11AC |
| 21543 | /* Get the Version 1 Handler */ |
| 21544 | tConfigStaParams_V1* phalConfigSta_V1 = NULL; |
| 21545 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
| 21546 | { |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 21547 | phalConfigSta_V1 = (tConfigStaParams_V1*)phalConfigSta; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21548 | } |
| 21549 | #endif |
| 21550 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21551 | the chances of getting inlined*/ |
| 21552 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21553 | wpalMemoryCopy(phalConfigSta->bssId, |
| 21554 | pwdiConfigSta->macBSSID, WDI_MAC_ADDR_LEN); |
| 21555 | |
| 21556 | wpalMemoryCopy(phalConfigSta->staMac, |
| 21557 | pwdiConfigSta->macSTA, WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21558 | |
| 21559 | phalConfigSta->assocId = pwdiConfigSta->usAssocId; |
| 21560 | phalConfigSta->staType = pwdiConfigSta->wdiSTAType; |
| 21561 | phalConfigSta->shortPreambleSupported = pwdiConfigSta->ucShortPreambleSupported; |
| 21562 | phalConfigSta->listenInterval = pwdiConfigSta->usListenInterval; |
| 21563 | phalConfigSta->wmmEnabled = pwdiConfigSta->ucWMMEnabled; |
| 21564 | phalConfigSta->htCapable = pwdiConfigSta->ucHTCapable; |
| 21565 | phalConfigSta->txChannelWidthSet = pwdiConfigSta->ucTXChannelWidthSet; |
| 21566 | phalConfigSta->rifsMode = pwdiConfigSta->ucRIFSMode; |
| 21567 | phalConfigSta->lsigTxopProtection = pwdiConfigSta->ucLSIGTxopProtection; |
| 21568 | phalConfigSta->maxAmpduSize = pwdiConfigSta->ucMaxAmpduSize; |
| 21569 | phalConfigSta->maxAmpduDensity = pwdiConfigSta->ucMaxAmpduDensity; |
| 21570 | phalConfigSta->maxAmsduSize = pwdiConfigSta->ucMaxAmsduSize; |
| 21571 | phalConfigSta->fShortGI40Mhz = pwdiConfigSta->ucShortGI40Mhz; |
| 21572 | phalConfigSta->fShortGI20Mhz = pwdiConfigSta->ucShortGI20Mhz; |
| 21573 | phalConfigSta->rmfEnabled = pwdiConfigSta->ucRMFEnabled; |
| 21574 | phalConfigSta->action = pwdiConfigSta->wdiAction; |
| 21575 | phalConfigSta->uAPSD = pwdiConfigSta->ucAPSD; |
| 21576 | phalConfigSta->maxSPLen = pwdiConfigSta->ucMaxSPLen; |
| 21577 | phalConfigSta->greenFieldCapable = pwdiConfigSta->ucGreenFieldCapable; |
| 21578 | phalConfigSta->delayedBASupport = pwdiConfigSta->ucDelayedBASupport; |
| 21579 | phalConfigSta->us32MaxAmpduDuration = pwdiConfigSta->us32MaxAmpduDuratio; |
| 21580 | phalConfigSta->fDsssCckMode40Mhz = pwdiConfigSta->ucDsssCckMode40Mhz; |
| 21581 | phalConfigSta->encryptType = pwdiConfigSta->ucEncryptType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21582 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21583 | phalConfigSta->mimoPS = WDI_2_HAL_MIMO_PS(pwdiConfigSta->wdiMIMOPS); |
| 21584 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21585 | phalConfigSta->supportedRates.opRateMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21586 | pwdiConfigSta->wdiSupportedRates.opRateMode; |
| 21587 | for(i = 0; i < SIR_NUM_11B_RATES; i ++) |
| 21588 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21589 | phalConfigSta->supportedRates.llbRates[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21590 | pwdiConfigSta->wdiSupportedRates.llbRates[i]; |
| 21591 | } |
| 21592 | for(i = 0; i < SIR_NUM_11A_RATES; i ++) |
| 21593 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21594 | phalConfigSta->supportedRates.llaRates[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21595 | pwdiConfigSta->wdiSupportedRates.llaRates[i]; |
| 21596 | } |
| 21597 | for(i = 0; i < SIR_NUM_POLARIS_RATES; i ++) |
| 21598 | { |
| 21599 | phalConfigSta->supportedRates.aniLegacyRates[i] = |
| 21600 | pwdiConfigSta->wdiSupportedRates.aLegacyRates[i]; |
| 21601 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21602 | phalConfigSta->supportedRates.aniEnhancedRateBitmap = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21603 | pwdiConfigSta->wdiSupportedRates.uEnhancedRateBitmap; |
| 21604 | for(i = 0; i < SIR_MAC_MAX_SUPPORTED_MCS_SET; i ++) |
| 21605 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21606 | phalConfigSta->supportedRates.supportedMCSSet[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21607 | pwdiConfigSta->wdiSupportedRates.aSupportedMCSSet[i]; |
| 21608 | } |
| 21609 | phalConfigSta->supportedRates.rxHighestDataRate = |
| 21610 | pwdiConfigSta->wdiSupportedRates.aRxHighestDataRate; |
| 21611 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21612 | #ifdef WLAN_FEATURE_11AC |
| 21613 | if(phalConfigSta_V1 != NULL) |
| 21614 | { |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 21615 | phalConfigSta_V1->supportedRates.vhtRxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtRxMCSMap; |
| 21616 | phalConfigSta_V1->supportedRates.vhtRxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtRxHighestDataRate; |
| 21617 | phalConfigSta_V1->supportedRates.vhtTxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtTxMCSMap; |
| 21618 | phalConfigSta_V1->supportedRates.vhtTxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtTxHighestDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21619 | } |
| 21620 | #endif |
| 21621 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21622 | #ifdef WLAN_FEATURE_P2P |
| 21623 | phalConfigSta->p2pCapableSta = pwdiConfigSta->ucP2pCapableSta ; |
| 21624 | #endif |
| 21625 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21626 | #ifdef WLAN_FEATURE_11AC |
| 21627 | if(phalConfigSta_V1 != NULL) |
| 21628 | { |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 21629 | phalConfigSta_V1->vhtCapable = pwdiConfigSta->ucVhtCapableSta; |
| 21630 | phalConfigSta_V1->vhtTxChannelWidthSet = pwdiConfigSta->ucVhtTxChannelWidthSet; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21631 | } |
| 21632 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21633 | }/*WDI_CopyWDIStaCtxToHALStaCtx*/; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21634 | |
| 21635 | /*Translate a Rate set info from WDI into HAL*/ |
| 21636 | WPT_STATIC WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21637 | WDI_CopyWDIRateSetToHALRateSet |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21638 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21639 | tSirMacRateSet* pHalRateSet, |
| 21640 | WDI_RateSet* pwdiRateSet |
| 21641 | ) |
| 21642 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21643 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21644 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 21645 | |
| 21646 | pHalRateSet->numRates = ( pwdiRateSet->ucNumRates <= SIR_MAC_RATESET_EID_MAX )? |
| 21647 | pwdiRateSet->ucNumRates:SIR_MAC_RATESET_EID_MAX; |
| 21648 | |
| 21649 | for ( i = 0; i < pHalRateSet->numRates; i++ ) |
| 21650 | { |
| 21651 | pHalRateSet->rate[i] = pwdiRateSet->aRates[i]; |
| 21652 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21653 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21654 | }/*WDI_CopyWDIRateSetToHALRateSet*/ |
| 21655 | |
| 21656 | |
| 21657 | /*Translate an EDCA Parameter Record from WDI into HAL*/ |
| 21658 | WPT_STATIC WPT_INLINE void |
| 21659 | WDI_CopyWDIEDCAParamsToHALEDCAParams |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21660 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21661 | tSirMacEdcaParamRecord* phalEdcaParam, |
| 21662 | WDI_EdcaParamRecord* pWDIEdcaParam |
| 21663 | ) |
| 21664 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21665 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21666 | the chances of getting inlined*/ |
| 21667 | |
| 21668 | phalEdcaParam->aci.rsvd = pWDIEdcaParam->wdiACI.rsvd; |
| 21669 | phalEdcaParam->aci.aci = pWDIEdcaParam->wdiACI.aci; |
| 21670 | phalEdcaParam->aci.acm = pWDIEdcaParam->wdiACI.acm; |
| 21671 | phalEdcaParam->aci.aifsn = pWDIEdcaParam->wdiACI.aifsn; |
| 21672 | |
| 21673 | phalEdcaParam->cw.max = pWDIEdcaParam->wdiCW.max; |
| 21674 | phalEdcaParam->cw.min = pWDIEdcaParam->wdiCW.min; |
| 21675 | phalEdcaParam->txoplimit = pWDIEdcaParam->usTXOPLimit; |
| 21676 | }/*WDI_CopyWDIEDCAParamsToHALEDCAParams*/ |
| 21677 | |
| 21678 | |
| 21679 | /*Copy a management frame header from WDI fmt into HAL fmt*/ |
| 21680 | WPT_STATIC WPT_INLINE void |
| 21681 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr |
| 21682 | ( |
| 21683 | tSirMacMgmtHdr* pmacMgmtHdr, |
| 21684 | WDI_MacMgmtHdr* pwdiMacMgmtHdr |
| 21685 | ) |
| 21686 | { |
| 21687 | pmacMgmtHdr->fc.protVer = pwdiMacMgmtHdr->fc.protVer; |
| 21688 | pmacMgmtHdr->fc.type = pwdiMacMgmtHdr->fc.type; |
| 21689 | pmacMgmtHdr->fc.subType = pwdiMacMgmtHdr->fc.subType; |
| 21690 | pmacMgmtHdr->fc.toDS = pwdiMacMgmtHdr->fc.toDS; |
| 21691 | pmacMgmtHdr->fc.fromDS = pwdiMacMgmtHdr->fc.fromDS; |
| 21692 | pmacMgmtHdr->fc.moreFrag = pwdiMacMgmtHdr->fc.moreFrag; |
| 21693 | pmacMgmtHdr->fc.retry = pwdiMacMgmtHdr->fc.retry; |
| 21694 | pmacMgmtHdr->fc.powerMgmt = pwdiMacMgmtHdr->fc.powerMgmt; |
| 21695 | pmacMgmtHdr->fc.moreData = pwdiMacMgmtHdr->fc.moreData; |
| 21696 | pmacMgmtHdr->fc.wep = pwdiMacMgmtHdr->fc.wep; |
| 21697 | pmacMgmtHdr->fc.order = pwdiMacMgmtHdr->fc.order; |
| 21698 | |
| 21699 | pmacMgmtHdr->durationLo = pwdiMacMgmtHdr->durationLo; |
| 21700 | pmacMgmtHdr->durationHi = pwdiMacMgmtHdr->durationHi; |
| 21701 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21702 | wpalMemoryCopy(pmacMgmtHdr->da, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21703 | pwdiMacMgmtHdr->da, 6); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21704 | wpalMemoryCopy(pmacMgmtHdr->sa, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21705 | pwdiMacMgmtHdr->sa, 6); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21706 | wpalMemoryCopy(pmacMgmtHdr->bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21707 | pwdiMacMgmtHdr->bssId, 6); |
| 21708 | |
| 21709 | pmacMgmtHdr->seqControl.fragNum = pwdiMacMgmtHdr->seqControl.fragNum; |
| 21710 | pmacMgmtHdr->seqControl.seqNumLo = pwdiMacMgmtHdr->seqControl.seqNumLo; |
| 21711 | pmacMgmtHdr->seqControl.seqNumHi = pwdiMacMgmtHdr->seqControl.seqNumHi; |
| 21712 | |
| 21713 | }/*WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr*/ |
| 21714 | |
| 21715 | |
| 21716 | /*Copy config bss parameters from WDI fmt into HAL fmt*/ |
| 21717 | WPT_STATIC WPT_INLINE void |
| 21718 | WDI_CopyWDIConfigBSSToHALConfigBSS |
| 21719 | ( |
| 21720 | tConfigBssParams* phalConfigBSS, |
| 21721 | WDI_ConfigBSSReqInfoType* pwdiConfigBSS |
| 21722 | ) |
| 21723 | { |
| 21724 | |
| 21725 | wpt_uint8 keyIndex = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21726 | #ifdef WLAN_FEATURE_11AC |
| 21727 | /* Get the Version 1 Handler */ |
| 21728 | tConfigBssParams_V1* phalConfigBSS_V1 = NULL; |
| 21729 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 21730 | phalConfigBSS_V1 = (tConfigBssParams_V1*)phalConfigBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21731 | #endif |
| 21732 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21733 | wpalMemoryCopy( phalConfigBSS->bssId, |
| 21734 | pwdiConfigBSS->macBSSID, |
| 21735 | WDI_MAC_ADDR_LEN); |
| 21736 | |
| 21737 | #ifdef HAL_SELF_STA_PER_BSS |
| 21738 | wpalMemoryCopy( phalConfigBSS->selfMacAddr, |
| 21739 | pwdiConfigBSS->macSelfAddr, |
| 21740 | WDI_MAC_ADDR_LEN); |
| 21741 | #endif |
| 21742 | |
| 21743 | phalConfigBSS->bssType = WDI_2_HAL_BSS_TYPE(pwdiConfigBSS->wdiBSSType); |
| 21744 | |
| 21745 | phalConfigBSS->operMode = pwdiConfigBSS->ucOperMode; |
| 21746 | phalConfigBSS->nwType = WDI_2_HAL_NW_TYPE(pwdiConfigBSS->wdiNWType); |
| 21747 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21748 | phalConfigBSS->shortSlotTimeSupported = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21749 | pwdiConfigBSS->ucShortSlotTimeSupported; |
| 21750 | phalConfigBSS->llaCoexist = pwdiConfigBSS->ucllaCoexist; |
| 21751 | phalConfigBSS->llbCoexist = pwdiConfigBSS->ucllbCoexist; |
| 21752 | phalConfigBSS->llgCoexist = pwdiConfigBSS->ucllgCoexist; |
| 21753 | phalConfigBSS->ht20Coexist = pwdiConfigBSS->ucHT20Coexist; |
| 21754 | phalConfigBSS->llnNonGFCoexist = pwdiConfigBSS->ucllnNonGFCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21755 | phalConfigBSS->fLsigTXOPProtectionFullSupport = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21756 | pwdiConfigBSS->ucTXOPProtectionFullSupport; |
| 21757 | phalConfigBSS->fRIFSMode = pwdiConfigBSS->ucRIFSMode; |
| 21758 | phalConfigBSS->beaconInterval = pwdiConfigBSS->usBeaconInterval; |
| 21759 | phalConfigBSS->dtimPeriod = pwdiConfigBSS->ucDTIMPeriod; |
| 21760 | phalConfigBSS->txChannelWidthSet = pwdiConfigBSS->ucTXChannelWidthSet; |
| 21761 | phalConfigBSS->currentOperChannel = pwdiConfigBSS->ucCurrentOperChannel; |
| 21762 | phalConfigBSS->currentExtChannel = pwdiConfigBSS->ucCurrentExtChannel; |
| 21763 | phalConfigBSS->action = pwdiConfigBSS->wdiAction; |
| 21764 | phalConfigBSS->htCapable = pwdiConfigBSS->ucHTCapable; |
| 21765 | phalConfigBSS->obssProtEnabled = pwdiConfigBSS->ucObssProtEnabled; |
| 21766 | phalConfigBSS->rmfEnabled = pwdiConfigBSS->ucRMFEnabled; |
| 21767 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21768 | phalConfigBSS->htOperMode = |
| 21769 | WDI_2_HAL_HT_OPER_MODE(pwdiConfigBSS->wdiHTOperMod); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21770 | |
| 21771 | phalConfigBSS->dualCTSProtection = pwdiConfigBSS->ucDualCTSProtection; |
| 21772 | phalConfigBSS->ucMaxProbeRespRetryLimit = pwdiConfigBSS->ucMaxProbeRespRetryLimit; |
| 21773 | phalConfigBSS->bHiddenSSIDEn = pwdiConfigBSS->bHiddenSSIDEn; |
| 21774 | phalConfigBSS->bProxyProbeRespEn = pwdiConfigBSS->bProxyProbeRespEn; |
| 21775 | |
| 21776 | #ifdef WLAN_FEATURE_VOWIFI |
| 21777 | phalConfigBSS->maxTxPower = pwdiConfigBSS->cMaxTxPower; |
| 21778 | #endif |
| 21779 | |
| 21780 | /*! Used 32 as magic number because that is how the ssid is declared inside the |
| 21781 | hal header - hal needs a macro for it */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21782 | phalConfigBSS->ssId.length = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21783 | (pwdiConfigBSS->wdiSSID.ucLength <= 32)? |
| 21784 | pwdiConfigBSS->wdiSSID.ucLength : 32; |
| 21785 | wpalMemoryCopy(phalConfigBSS->ssId.ssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21786 | pwdiConfigBSS->wdiSSID.sSSID, |
| 21787 | phalConfigBSS->ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21788 | |
| 21789 | WDI_CopyWDIStaCtxToHALStaCtx( &phalConfigBSS->staContext, |
| 21790 | &pwdiConfigBSS->wdiSTAContext); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21791 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21792 | WDI_CopyWDIRateSetToHALRateSet( &phalConfigBSS->rateSet, |
| 21793 | &pwdiConfigBSS->wdiRateSet); |
| 21794 | |
| 21795 | phalConfigBSS->edcaParamsValid = pwdiConfigBSS->ucEDCAParamsValid; |
| 21796 | |
| 21797 | if(phalConfigBSS->edcaParamsValid) |
| 21798 | { |
| 21799 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbe, |
| 21800 | &pwdiConfigBSS->wdiBEEDCAParams); |
| 21801 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbk, |
| 21802 | &pwdiConfigBSS->wdiBKEDCAParams); |
| 21803 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvi, |
| 21804 | &pwdiConfigBSS->wdiVIEDCAParams); |
| 21805 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvo, |
| 21806 | &pwdiConfigBSS->wdiVOEDCAParams); |
| 21807 | } |
| 21808 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21809 | phalConfigBSS->halPersona = pwdiConfigBSS->ucPersona; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21810 | |
| 21811 | phalConfigBSS->bSpectrumMgtEnable = pwdiConfigBSS->bSpectrumMgtEn; |
| 21812 | |
| 21813 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 21814 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21815 | phalConfigBSS->extSetStaKeyParamValid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21816 | pwdiConfigBSS->bExtSetStaKeyParamValid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21817 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21818 | if( phalConfigBSS->extSetStaKeyParamValid ) |
| 21819 | { |
| 21820 | /*----------------------------------------------------------------------- |
| 21821 | Copy the STA Key parameters into the HAL message |
| 21822 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21823 | phalConfigBSS->extSetStaKeyParam.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21824 | WDI_2_HAL_ENC_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiEncType); |
| 21825 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21826 | phalConfigBSS->extSetStaKeyParam.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21827 | WDI_2_HAL_WEP_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiWEPType ); |
| 21828 | |
| 21829 | phalConfigBSS->extSetStaKeyParam.staIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucSTAIdx; |
| 21830 | |
| 21831 | phalConfigBSS->extSetStaKeyParam.defWEPIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucDefWEPIdx; |
| 21832 | |
| 21833 | phalConfigBSS->extSetStaKeyParam.singleTidRc = pwdiConfigBSS->wdiExtSetKeyParam.ucSingleTidRc; |
| 21834 | |
| 21835 | #ifdef WLAN_SOFTAP_FEATURE |
| 21836 | for(keyIndex = 0; keyIndex < pwdiConfigBSS->wdiExtSetKeyParam.ucNumKeys ; |
| 21837 | keyIndex++) |
| 21838 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21839 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21840 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyId; |
| 21841 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].unicast = |
| 21842 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].unicast; |
| 21843 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyDirection = |
| 21844 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyDirection; |
| 21845 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21846 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21847 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21848 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21849 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21850 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21851 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyLength; |
| 21852 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21853 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21854 | WDI_MAX_KEY_LENGTH); |
| 21855 | } |
| 21856 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21857 | phalConfigBSS->extSetStaKeyParam.key.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21858 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyId; |
| 21859 | phalConfigBSS->extSetStaKeyParam.key.unicast = |
| 21860 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].unicast; |
| 21861 | phalConfigBSS->extSetStaKeyParam.key.keyDirection = |
| 21862 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyDirection; |
| 21863 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21864 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21865 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21866 | phalConfigBSS->extSetStaKeyParam.key.paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21867 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21868 | phalConfigBSS->extSetStaKeyParam.key.keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21869 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyLength; |
| 21870 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21871 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21872 | WDI_MAX_KEY_LENGTH); |
| 21873 | #endif |
| 21874 | } |
| 21875 | else/* phalConfigBSS->extSetStaKeyParamValid is not set */ |
| 21876 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21877 | wpalMemoryZero( &phalConfigBSS->extSetStaKeyParam, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21878 | sizeof(phalConfigBSS->extSetStaKeyParam) ); |
| 21879 | } |
| 21880 | |
| 21881 | #endif /*WLAN_FEATURE_VOWIFI_11R*/ |
| 21882 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21883 | #ifdef WLAN_FEATURE_11AC |
| 21884 | if(phalConfigBSS_V1 != NULL) |
| 21885 | { |
| 21886 | phalConfigBSS_V1->vhtCapable = pwdiConfigBSS->ucVhtCapableSta; |
| 21887 | phalConfigBSS_V1->vhtTxChannelWidthSet = pwdiConfigBSS->ucVhtTxChannelWidthSet; |
| 21888 | } |
| 21889 | #endif |
| 21890 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21891 | }/*WDI_CopyWDIConfigBSSToHALConfigBSS*/ |
| 21892 | |
| 21893 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21894 | /*Extract the request CB function and user data from a request structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21895 | pointed to by user data */ |
| 21896 | WPT_STATIC WPT_INLINE void |
| 21897 | WDI_ExtractRequestCBFromEvent |
| 21898 | ( |
| 21899 | WDI_EventInfoType* pEvent, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21900 | WDI_ReqStatusCb* ppfnReqCB, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21901 | void** ppUserData |
| 21902 | ) |
| 21903 | { |
| 21904 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 21905 | switch ( pEvent->wdiRequest ) |
| 21906 | { |
| 21907 | case WDI_START_REQ: |
| 21908 | *ppfnReqCB = ((WDI_StartReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21909 | *ppUserData = ((WDI_StartReqParamsType*)pEvent->pEventData)->pUserData; |
| 21910 | break; |
| 21911 | case WDI_STOP_REQ: |
| 21912 | *ppfnReqCB = ((WDI_StopReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21913 | *ppUserData = ((WDI_StopReqParamsType*)pEvent->pEventData)->pUserData; |
| 21914 | break; |
| 21915 | case WDI_INIT_SCAN_REQ: |
| 21916 | *ppfnReqCB = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21917 | *ppUserData = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 21918 | break; |
| 21919 | case WDI_START_SCAN_REQ: |
| 21920 | *ppfnReqCB = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21921 | *ppUserData = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 21922 | break; |
| 21923 | case WDI_END_SCAN_REQ: |
| 21924 | *ppfnReqCB = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21925 | *ppUserData = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 21926 | break; |
| 21927 | case WDI_FINISH_SCAN_REQ: |
| 21928 | *ppfnReqCB = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21929 | *ppUserData = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 21930 | break; |
| 21931 | case WDI_JOIN_REQ: |
| 21932 | *ppfnReqCB = ((WDI_JoinReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21933 | *ppUserData = ((WDI_JoinReqParamsType*)pEvent->pEventData)->pUserData; |
| 21934 | break; |
| 21935 | case WDI_CONFIG_BSS_REQ: |
| 21936 | *ppfnReqCB = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21937 | *ppUserData = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->pUserData; |
| 21938 | break; |
| 21939 | case WDI_DEL_BSS_REQ: |
| 21940 | *ppfnReqCB = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21941 | *ppUserData = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->pUserData; |
| 21942 | break; |
| 21943 | case WDI_POST_ASSOC_REQ: |
| 21944 | *ppfnReqCB = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21945 | *ppUserData = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->pUserData; |
| 21946 | break; |
| 21947 | case WDI_DEL_STA_REQ: |
| 21948 | *ppfnReqCB = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21949 | *ppUserData = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->pUserData; |
| 21950 | break; |
| 21951 | case WDI_DEL_STA_SELF_REQ: |
| 21952 | *ppfnReqCB = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21953 | *ppUserData = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->pUserData; |
| 21954 | break; |
| 21955 | |
| 21956 | case WDI_SET_BSS_KEY_REQ: |
| 21957 | *ppfnReqCB = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21958 | *ppUserData = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 21959 | break; |
| 21960 | case WDI_RMV_BSS_KEY_REQ: |
| 21961 | *ppfnReqCB = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21962 | *ppUserData = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 21963 | break; |
| 21964 | case WDI_SET_STA_KEY_REQ: |
| 21965 | *ppfnReqCB = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21966 | *ppUserData = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 21967 | break; |
| 21968 | case WDI_RMV_STA_KEY_REQ: |
| 21969 | *ppfnReqCB = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21970 | *ppUserData = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 21971 | break; |
| 21972 | case WDI_ADD_TS_REQ: |
| 21973 | *ppfnReqCB = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21974 | *ppUserData = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->pUserData; |
| 21975 | break; |
| 21976 | case WDI_DEL_TS_REQ: |
| 21977 | *ppfnReqCB = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21978 | *ppUserData = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->pUserData; |
| 21979 | break; |
| 21980 | case WDI_UPD_EDCA_PRMS_REQ: |
| 21981 | *ppfnReqCB = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21982 | *ppUserData = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->pUserData; |
| 21983 | break; |
| 21984 | case WDI_ADD_BA_SESSION_REQ: |
| 21985 | *ppfnReqCB = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21986 | *ppUserData = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->pUserData; |
| 21987 | break; |
| 21988 | case WDI_DEL_BA_REQ: |
| 21989 | *ppfnReqCB = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21990 | *ppUserData = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 21991 | break; |
| 21992 | #ifdef FEATURE_WLAN_CCX |
| 21993 | case WDI_TSM_STATS_REQ: |
| 21994 | *ppfnReqCB = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21995 | *ppUserData = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->pUserData; |
| 21996 | break; |
| 21997 | #endif |
| 21998 | case WDI_CH_SWITCH_REQ: |
| 21999 | *ppfnReqCB = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22000 | *ppUserData = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->pUserData; |
| 22001 | break; |
| 22002 | case WDI_CONFIG_STA_REQ: |
| 22003 | *ppfnReqCB = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22004 | *ppUserData = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->pUserData; |
| 22005 | break; |
| 22006 | case WDI_SET_LINK_ST_REQ: |
| 22007 | *ppfnReqCB = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22008 | *ppUserData = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->pUserData; |
| 22009 | break; |
| 22010 | case WDI_GET_STATS_REQ: |
| 22011 | *ppfnReqCB = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22012 | *ppUserData = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->pUserData; |
| 22013 | break; |
| 22014 | case WDI_UPDATE_CFG_REQ: |
| 22015 | *ppfnReqCB = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22016 | *ppUserData = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->pUserData; |
| 22017 | break; |
| 22018 | case WDI_ADD_BA_REQ: |
| 22019 | *ppfnReqCB = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22020 | *ppUserData = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 22021 | break; |
| 22022 | case WDI_TRIGGER_BA_REQ: |
| 22023 | *ppfnReqCB = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22024 | *ppUserData = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 22025 | break; |
| 22026 | case WDI_UPD_BCON_PRMS_REQ: |
| 22027 | *ppfnReqCB = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22028 | *ppUserData = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->pUserData; |
| 22029 | break; |
| 22030 | case WDI_SND_BCON_REQ: |
| 22031 | *ppfnReqCB = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22032 | *ppUserData = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->pUserData; |
| 22033 | break; |
| 22034 | case WDI_ENTER_BMPS_REQ: |
| 22035 | *ppfnReqCB = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22036 | *ppUserData = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->pUserData; |
| 22037 | break; |
| 22038 | case WDI_EXIT_BMPS_REQ: |
| 22039 | *ppfnReqCB = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22040 | *ppUserData = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->pUserData; |
| 22041 | break; |
| 22042 | case WDI_ENTER_UAPSD_REQ: |
| 22043 | *ppfnReqCB = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22044 | *ppUserData = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->pUserData; |
| 22045 | break; |
| 22046 | case WDI_UPDATE_UAPSD_PARAM_REQ: |
| 22047 | *ppfnReqCB = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22048 | *ppUserData = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->pUserData; |
| 22049 | break; |
| 22050 | case WDI_CONFIGURE_RXP_FILTER_REQ: |
| 22051 | *ppfnReqCB = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22052 | *ppUserData = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->pUserData; |
| 22053 | break; |
| 22054 | case WDI_SET_BEACON_FILTER_REQ: |
| 22055 | *ppfnReqCB = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22056 | *ppUserData = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->pUserData; |
| 22057 | break; |
| 22058 | case WDI_REM_BEACON_FILTER_REQ: |
| 22059 | *ppfnReqCB = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22060 | *ppUserData = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->pUserData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22061 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22062 | case WDI_SET_RSSI_THRESHOLDS_REQ: |
| 22063 | *ppfnReqCB = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22064 | *ppUserData = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->pUserData; |
| 22065 | break; |
| 22066 | case WDI_HOST_OFFLOAD_REQ: |
| 22067 | *ppfnReqCB = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22068 | *ppUserData = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->pUserData; |
| 22069 | break; |
| 22070 | case WDI_WOWL_ADD_BC_PTRN_REQ: |
| 22071 | *ppfnReqCB = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22072 | *ppUserData = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->pUserData; |
| 22073 | break; |
| 22074 | case WDI_WOWL_DEL_BC_PTRN_REQ: |
| 22075 | *ppfnReqCB = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22076 | *ppUserData = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->pUserData; |
| 22077 | break; |
| 22078 | case WDI_WOWL_ENTER_REQ: |
| 22079 | *ppfnReqCB = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22080 | *ppUserData = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->pUserData; |
| 22081 | break; |
| 22082 | case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ: |
| 22083 | *ppfnReqCB = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22084 | *ppUserData = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->pUserData; |
| 22085 | break; |
| 22086 | case WDI_FLUSH_AC_REQ: |
| 22087 | *ppfnReqCB = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22088 | *ppUserData = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->pUserData; |
| 22089 | break; |
| 22090 | case WDI_BTAMP_EVENT_REQ: |
| 22091 | *ppfnReqCB = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22092 | *ppUserData = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->pUserData; |
| 22093 | break; |
| 22094 | case WDI_KEEP_ALIVE_REQ: |
| 22095 | *ppfnReqCB = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22096 | *ppUserData = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->pUserData; |
| 22097 | break; |
| 22098 | case WDI_SET_TX_PER_TRACKING_REQ: |
| 22099 | *ppfnReqCB = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22100 | *ppUserData = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->pUserData; |
| 22101 | default: |
| 22102 | *ppfnReqCB = NULL; |
| 22103 | *ppUserData = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22104 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22105 | } |
| 22106 | }/*WDI_ExtractRequestCBFromEvent*/ |
| 22107 | |
| 22108 | |
| 22109 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22110 | @brief WDI_IsHwFrameTxTranslationCapable checks to see if HW |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22111 | frame xtl is enabled for a particular STA. |
| 22112 | |
| 22113 | WDI_PostAssocReq must have been called. |
| 22114 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22115 | @param uSTAIdx: STA index |
| 22116 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22117 | @see WDI_PostAssocReq |
| 22118 | @return Result of the function call |
| 22119 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22120 | wpt_boolean |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22121 | WDI_IsHwFrameTxTranslationCapable |
| 22122 | ( |
| 22123 | wpt_uint8 uSTAIdx |
| 22124 | ) |
| 22125 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22126 | /*!! FIX ME - this must eventually be per station - for now just feedback |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22127 | uma value*/ |
| 22128 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22129 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22130 | ------------------------------------------------------------------------*/ |
| 22131 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 22132 | { |
| 22133 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22134 | "WDI API call before module is initialized - Fail request"); |
| 22135 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22136 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22137 | } |
| 22138 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22139 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22140 | return gWDICb.bFrameTransEnabled; |
| 22141 | }/*WDI_IsHwFrameTxTranslationCapable*/ |
| 22142 | |
| 22143 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 22144 | /** |
| 22145 | @brief WDI_SetPreferredNetworkList |
| 22146 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22147 | @param pwdiPNOScanReqParams: the Set PNO as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22148 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22149 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22150 | wdiPNOScanCb: callback for passing back the response |
| 22151 | of the Set PNO operation received from the |
| 22152 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22153 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22154 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22155 | callback |
| 22156 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22157 | @return Result of the function call |
| 22158 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22159 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22160 | WDI_SetPreferredNetworkReq |
| 22161 | ( |
| 22162 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 22163 | WDI_PNOScanCb wdiPNOScanCb, |
| 22164 | void* pUserData |
| 22165 | ) |
| 22166 | { |
| 22167 | WDI_EventInfoType wdiEventData = {{0}}; |
| 22168 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22169 | |
| 22170 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22171 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22172 | ------------------------------------------------------------------------*/ |
| 22173 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 22174 | { |
| 22175 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22176 | "WDI API call before module is initialized - Fail request"); |
| 22177 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22178 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22179 | } |
| 22180 | |
| 22181 | /*------------------------------------------------------------------------ |
| 22182 | Fill in Event data and post to the Main FSM |
| 22183 | ------------------------------------------------------------------------*/ |
| 22184 | wdiEventData.wdiRequest = WDI_SET_PREF_NETWORK_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22185 | wdiEventData.pEventData = pwdiPNOScanReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22186 | wdiEventData.uEventDataSize = sizeof(*pwdiPNOScanReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22187 | wdiEventData.pCBfnc = wdiPNOScanCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22188 | wdiEventData.pUserData = pUserData; |
| 22189 | |
| 22190 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 22191 | } |
| 22192 | |
| 22193 | |
| 22194 | /** |
| 22195 | @brief WDI_SetRssiFilterReq |
| 22196 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22197 | @param pwdiRssiFilterReqParams: the Set RSSI Filter as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22198 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22199 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22200 | wdiRssiFilterCb: callback for passing back the response |
| 22201 | of the Set RSSI Filter operation received from the |
| 22202 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22203 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22204 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22205 | callback |
| 22206 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22207 | @return Result of the function call |
| 22208 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22209 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22210 | WDI_SetRssiFilterReq |
| 22211 | ( |
| 22212 | WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams, |
| 22213 | WDI_RssiFilterCb wdiRssiFilterCb, |
| 22214 | void* pUserData |
| 22215 | ) |
| 22216 | { |
| 22217 | WDI_EventInfoType wdiEventData = {{0}}; |
| 22218 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22219 | |
| 22220 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22221 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22222 | ------------------------------------------------------------------------*/ |
| 22223 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 22224 | { |
| 22225 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22226 | "WDI API call before module is initialized - Fail request"); |
| 22227 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22228 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22229 | } |
| 22230 | |
| 22231 | /*------------------------------------------------------------------------ |
| 22232 | Fill in Event data and post to the Main FSM |
| 22233 | ------------------------------------------------------------------------*/ |
| 22234 | wdiEventData.wdiRequest = WDI_SET_RSSI_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22235 | wdiEventData.pEventData = pwdiRssiFilterReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22236 | wdiEventData.uEventDataSize = sizeof(*pwdiRssiFilterReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22237 | wdiEventData.pCBfnc = wdiRssiFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22238 | wdiEventData.pUserData = pUserData; |
| 22239 | |
| 22240 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 22241 | }/*WDI_SetRssiFilterReq*/ |
| 22242 | |
| 22243 | /** |
| 22244 | @brief WDI_UpdateScanParamsReq |
| 22245 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22246 | @param pwdiUpdateScanParamsInfoType: the Update Scan Params as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22247 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22248 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22249 | wdiUpdateScanParamsCb: callback for passing back the response |
| 22250 | of the Set PNO operation received from the |
| 22251 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22252 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22253 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22254 | callback |
| 22255 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22256 | @return Result of the function call |
| 22257 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22258 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22259 | WDI_UpdateScanParamsReq |
| 22260 | ( |
| 22261 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParamsInfoType, |
| 22262 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb, |
| 22263 | void* pUserData |
| 22264 | ) |
| 22265 | { |
| 22266 | WDI_EventInfoType wdiEventData = {{0}}; |
| 22267 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22268 | |
| 22269 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22270 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22271 | ------------------------------------------------------------------------*/ |
| 22272 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 22273 | { |
| 22274 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22275 | "WDI API call before module is initialized - Fail request"); |
| 22276 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22277 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22278 | } |
| 22279 | |
| 22280 | /*------------------------------------------------------------------------ |
| 22281 | Fill in Event data and post to the Main FSM |
| 22282 | ------------------------------------------------------------------------*/ |
| 22283 | wdiEventData.wdiRequest = WDI_UPDATE_SCAN_PARAMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22284 | wdiEventData.pEventData = pwdiUpdateScanParamsInfoType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22285 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateScanParamsInfoType); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22286 | wdiEventData.pCBfnc = wdiUpdateScanParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22287 | wdiEventData.pUserData = pUserData; |
| 22288 | |
| 22289 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 22290 | } |
| 22291 | |
| 22292 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22293 | @brief Helper function to pack Set Preferred Network List |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22294 | Request parameters |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22295 | |
| 22296 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22297 | pwdiPNOScanReqParams: pointer to the info received |
| 22298 | from upper layers |
| 22299 | ppSendBuffer, pSize - out pointers of the packed buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22300 | and its size |
| 22301 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22302 | @return Result of the function call |
| 22303 | */ |
| 22304 | |
| 22305 | WDI_Status |
| 22306 | WDI_PackPreferredNetworkList |
| 22307 | ( |
| 22308 | WDI_ControlBlockType* pWDICtx, |
| 22309 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 22310 | wpt_uint8** ppSendBuffer, |
| 22311 | wpt_uint16* pSize |
| 22312 | ) |
| 22313 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22314 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22315 | wpt_uint16 usDataOffset = 0; |
| 22316 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22317 | tpPrefNetwListParams pPrefNetwListParams = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22318 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22319 | /*----------------------------------------------------------------------- |
| 22320 | Get message buffer |
| 22321 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22322 | 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] | 22323 | sizeof(tPrefNetwListParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22324 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22325 | ( usSendSize < (usDataOffset + sizeof(tPrefNetwListParams) ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22326 | { |
| 22327 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22328 | "Unable to get send buffer in Set PNO req %x ", |
| 22329 | pwdiPNOScanReqParams); |
| 22330 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22331 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22332 | } |
| 22333 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22334 | pPrefNetwListParams = (tpPrefNetwListParams)(pSendBuffer + usDataOffset); |
| 22335 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22336 | /*------------------------------------------------------------------------- |
| 22337 | Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo |
| 22338 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22339 | pPrefNetwListParams->enable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22340 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22341 | pPrefNetwListParams->modePNO = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22342 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO; |
| 22343 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22344 | pPrefNetwListParams->ucNetworksCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22345 | (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22346 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS)? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22347 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount : |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22348 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS; |
| 22349 | |
| 22350 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22351 | "WDI SET PNO: Enable %d, Mode %d, Netw Count %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22352 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable, |
| 22353 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO, |
| 22354 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount); |
| 22355 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22356 | for ( i = 0; i < pPrefNetwListParams->ucNetworksCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22357 | { |
| 22358 | /*SSID of the BSS*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22359 | pPrefNetwListParams->aNetworks[i].ssId.length |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22360 | = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength; |
| 22361 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22362 | wpalMemoryCopy( pPrefNetwListParams->aNetworks[i].ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22363 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22364 | pPrefNetwListParams->aNetworks[i].ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22365 | |
| 22366 | /*Authentication type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22367 | pPrefNetwListParams->aNetworks[i].authentication = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22368 | (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22369 | |
| 22370 | /*Encryption type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22371 | pPrefNetwListParams->aNetworks[i].encryption = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22372 | (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22373 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22374 | /*Indicate the channel on which the Network can be found |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22375 | 0 - if all channels */ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22376 | pPrefNetwListParams->aNetworks[i].ucChannelCount = |
Madan Mohan Koyyalamudi | a208d10 | 2012-10-15 15:18:18 -0700 | [diff] [blame] | 22377 | (pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount < |
| 22378 | WLAN_HAL_PNO_MAX_NETW_CHANNELS)? |
| 22379 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount : |
| 22380 | WLAN_HAL_PNO_MAX_NETW_CHANNELS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22381 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22382 | wpalMemoryCopy(pPrefNetwListParams->aNetworks[i].aChannels, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22383 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22384 | pPrefNetwListParams->aNetworks[i].ucChannelCount); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22385 | |
| 22386 | /*Indicates the RSSI threshold for the network to be considered*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22387 | pPrefNetwListParams->aNetworks[i].rssiThreshold = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22388 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold; |
| 22389 | |
| 22390 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22391 | "WDI SET PNO: SSID %d %s", |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22392 | pPrefNetwListParams->aNetworks[i].ssId.length, |
| 22393 | pPrefNetwListParams->aNetworks[i].ssId.ssId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22394 | } |
| 22395 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22396 | pPrefNetwListParams->scanTimers.ucScanTimersCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22397 | (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22398 | WLAN_HAL_PNO_MAX_SCAN_TIMERS)? |
| 22399 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount : |
| 22400 | WLAN_HAL_PNO_MAX_SCAN_TIMERS; |
| 22401 | |
| 22402 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22403 | "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] | 22404 | pPrefNetwListParams->scanTimers.ucScanTimersCount, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22405 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize, |
| 22406 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize); |
| 22407 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22408 | for ( i = 0; i < pPrefNetwListParams->scanTimers.ucScanTimersCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22409 | { |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22410 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22411 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22412 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerRepeat = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22413 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat; |
| 22414 | } |
| 22415 | |
| 22416 | /*Copy the probe template*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22417 | pPrefNetwListParams->us24GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22418 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize< |
| 22419 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 22420 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22421 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22422 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22423 | wpalMemoryCopy(pPrefNetwListParams->a24GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22424 | pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22425 | pPrefNetwListParams->us24GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22426 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22427 | pPrefNetwListParams->us5GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22428 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize < |
| 22429 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 22430 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22431 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22432 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22433 | wpalMemoryCopy(pPrefNetwListParams->a5GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22434 | pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22435 | pPrefNetwListParams->us5GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22436 | |
| 22437 | /*Set the output values*/ |
| 22438 | *ppSendBuffer = pSendBuffer; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22439 | *pSize = usSendSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22440 | |
| 22441 | return WDI_STATUS_SUCCESS; |
| 22442 | }/*WDI_PackPreferredNetworkList*/ |
| 22443 | |
| 22444 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22445 | @brief Helper function to pack Set Preferred Network List |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22446 | Request parameters |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22447 | |
| 22448 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22449 | pwdiPNOScanReqParams: pointer to the info received |
| 22450 | from upper layers |
| 22451 | ppSendBuffer, pSize - out pointers of the packed buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22452 | and its size |
| 22453 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22454 | @return Result of the function call |
| 22455 | */ |
| 22456 | |
| 22457 | WDI_Status |
| 22458 | WDI_PackPreferredNetworkListNew |
| 22459 | ( |
| 22460 | WDI_ControlBlockType* pWDICtx, |
| 22461 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 22462 | wpt_uint8** ppSendBuffer, |
| 22463 | wpt_uint16* pSize |
| 22464 | ) |
| 22465 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22466 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22467 | wpt_uint16 usDataOffset = 0; |
| 22468 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22469 | tpPrefNetwListParamsNew pPrefNetwListParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22470 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22471 | |
| 22472 | /*----------------------------------------------------------------------- |
| 22473 | Get message buffer |
| 22474 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22475 | 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] | 22476 | sizeof(tPrefNetwListParamsNew), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22477 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22478 | ( usSendSize < (usDataOffset + sizeof(tPrefNetwListParamsNew) ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22479 | { |
| 22480 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22481 | "Unable to get send buffer in Set PNO req %x ", |
| 22482 | pwdiPNOScanReqParams); |
| 22483 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22484 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22485 | } |
| 22486 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22487 | pPrefNetwListParams = (tpPrefNetwListParamsNew)(pSendBuffer + usDataOffset); |
| 22488 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22489 | /*------------------------------------------------------------------------- |
| 22490 | Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo |
| 22491 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22492 | pPrefNetwListParams->enable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22493 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22494 | pPrefNetwListParams->modePNO = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22495 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO; |
| 22496 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22497 | pPrefNetwListParams->ucNetworksCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22498 | (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22499 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS)? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22500 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount : |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22501 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS; |
| 22502 | |
| 22503 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22504 | "WDI SET PNO: Enable %d, Mode %d, Netw Count %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22505 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable, |
| 22506 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO, |
| 22507 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount); |
| 22508 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22509 | for ( i = 0; i < pPrefNetwListParams->ucNetworksCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22510 | { |
| 22511 | /*SSID of the BSS*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22512 | pPrefNetwListParams->aNetworks[i].ssId.length |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22513 | = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength; |
| 22514 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22515 | wpalMemoryCopy( pPrefNetwListParams->aNetworks[i].ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22516 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22517 | pPrefNetwListParams->aNetworks[i].ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22518 | |
| 22519 | /*Authentication type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22520 | pPrefNetwListParams->aNetworks[i].authentication = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22521 | (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22522 | |
| 22523 | /*Encryption type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22524 | pPrefNetwListParams->aNetworks[i].encryption = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22525 | (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22526 | |
| 22527 | /*SSID bcast type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22528 | pPrefNetwListParams->aNetworks[i].bcastNetworkType = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22529 | (tSSIDBcastType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiBcastNetworkType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22530 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22531 | /*Indicate the channel on which the Network can be found |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22532 | 0 - if all channels */ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22533 | pPrefNetwListParams->aNetworks[i].ucChannelCount = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22534 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount; |
| 22535 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22536 | wpalMemoryCopy(pPrefNetwListParams->aNetworks[i].aChannels, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22537 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22538 | pPrefNetwListParams->aNetworks[i].ucChannelCount); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22539 | |
| 22540 | /*Indicates the RSSI threshold for the network to be considered*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22541 | pPrefNetwListParams->aNetworks[i].rssiThreshold = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22542 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold; |
| 22543 | |
| 22544 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22545 | "WDI SET PNO: SSID %d %s", |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22546 | pPrefNetwListParams->aNetworks[i].ssId.length, |
| 22547 | pPrefNetwListParams->aNetworks[i].ssId.ssId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22548 | } |
| 22549 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22550 | pPrefNetwListParams->scanTimers.ucScanTimersCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22551 | (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22552 | WLAN_HAL_PNO_MAX_SCAN_TIMERS)? |
| 22553 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount : |
| 22554 | WLAN_HAL_PNO_MAX_SCAN_TIMERS; |
| 22555 | |
| 22556 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22557 | "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] | 22558 | pPrefNetwListParams->scanTimers.ucScanTimersCount, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22559 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize, |
| 22560 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize); |
| 22561 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22562 | for ( i = 0; i < pPrefNetwListParams->scanTimers.ucScanTimersCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22563 | { |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22564 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22565 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22566 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerRepeat = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22567 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat; |
| 22568 | } |
| 22569 | |
| 22570 | /*Copy the probe template*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22571 | pPrefNetwListParams->us24GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22572 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize< |
| 22573 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 22574 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22575 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22576 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22577 | wpalMemoryCopy(pPrefNetwListParams->a24GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22578 | pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22579 | pPrefNetwListParams->us24GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22580 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22581 | pPrefNetwListParams->us5GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22582 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize < |
| 22583 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 22584 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22585 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22586 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22587 | wpalMemoryCopy(pPrefNetwListParams->a5GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22588 | pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 22589 | pPrefNetwListParams->us5GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22590 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22591 | |
| 22592 | /*Set the output values*/ |
| 22593 | *ppSendBuffer = pSendBuffer; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22594 | *pSize = usSendSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22595 | |
| 22596 | return WDI_STATUS_SUCCESS; |
| 22597 | }/*WDI_PackPreferredNetworkListNew*/ |
| 22598 | |
| 22599 | /** |
| 22600 | @brief Process Set Preferred Network List Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22601 | |
| 22602 | @param pWDICtx: pointer to the WLAN DAL context |
| 22603 | pEventData: pointer to the event information structure |
| 22604 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22605 | @return Result of the function call |
| 22606 | */ |
| 22607 | WDI_Status |
| 22608 | WDI_ProcessSetPreferredNetworkReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22609 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22610 | WDI_ControlBlockType* pWDICtx, |
| 22611 | WDI_EventInfoType* pEventData |
| 22612 | ) |
| 22613 | { |
| 22614 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams = NULL; |
| 22615 | WDI_PNOScanCb wdiPNOScanCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22616 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22617 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22618 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22619 | |
| 22620 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22621 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22622 | -------------------------------------------------------------------------*/ |
| 22623 | if (( NULL == pEventData ) || |
| 22624 | ( NULL == (pwdiPNOScanReqParams = (WDI_PNOScanReqParamsType*)pEventData->pEventData)) || |
| 22625 | ( NULL == (wdiPNOScanCb = (WDI_PNOScanCb)pEventData->pCBfnc))) |
| 22626 | { |
| 22627 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22628 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22629 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22630 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22631 | } |
| 22632 | |
| 22633 | /*------------------------------------------------------------------------- |
| 22634 | Pack the PNO request structure based on version |
| 22635 | -------------------------------------------------------------------------*/ |
| 22636 | if ( pWDICtx->wdiPNOVersion > 0 ) |
| 22637 | { |
| 22638 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22639 | "%s: PNO new version %d ", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22640 | pWDICtx->wdiPNOVersion); |
| 22641 | |
| 22642 | wdiStatus = WDI_PackPreferredNetworkListNew( pWDICtx, pwdiPNOScanReqParams, |
| 22643 | &pSendBuffer, &usSendSize); |
| 22644 | } |
| 22645 | else |
| 22646 | { |
| 22647 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22648 | "%s: PNO old version %d ", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22649 | pWDICtx->wdiPNOVersion); |
| 22650 | |
| 22651 | wdiStatus = WDI_PackPreferredNetworkList( pWDICtx, pwdiPNOScanReqParams, |
| 22652 | &pSendBuffer, &usSendSize); |
| 22653 | } |
| 22654 | |
| 22655 | if (( WDI_STATUS_SUCCESS != wdiStatus )|| |
| 22656 | ( NULL == pSendBuffer )||( 0 == usSendSize )) |
| 22657 | { |
| 22658 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22659 | "%s: failed to pack request parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22660 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22661 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22662 | } |
| 22663 | |
| 22664 | pWDICtx->wdiReqStatusCB = pwdiPNOScanReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22665 | pWDICtx->pReqStatusUserData = pwdiPNOScanReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22666 | |
| 22667 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22668 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22669 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22670 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 22671 | wdiPNOScanCb, pEventData->pUserData, WDI_SET_PREF_NETWORK_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22672 | } |
| 22673 | |
| 22674 | /** |
| 22675 | @brief Process Set RSSI Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22676 | |
| 22677 | @param pWDICtx: pointer to the WLAN DAL context |
| 22678 | pEventData: pointer to the event information structure |
| 22679 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22680 | @see |
| 22681 | @return Result of the function call |
| 22682 | */ |
| 22683 | WDI_Status |
| 22684 | WDI_ProcessSetRssiFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22685 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22686 | WDI_ControlBlockType* pWDICtx, |
| 22687 | WDI_EventInfoType* pEventData |
| 22688 | ) |
| 22689 | { |
| 22690 | WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams = NULL; |
| 22691 | WDI_RssiFilterCb wdiRssiFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22692 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22693 | wpt_uint16 usDataOffset = 0; |
| 22694 | wpt_uint16 usSendSize = 0; |
| 22695 | wpt_uint8 ucRssiThreshold; |
| 22696 | |
| 22697 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22698 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22699 | -------------------------------------------------------------------------*/ |
| 22700 | if (( NULL == pEventData ) || |
| 22701 | ( NULL == (pwdiRssiFilterReqParams = (WDI_SetRssiFilterReqParamsType*)pEventData->pEventData)) || |
| 22702 | ( NULL == (wdiRssiFilterCb = (WDI_RssiFilterCb)pEventData->pCBfnc))) |
| 22703 | { |
| 22704 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22705 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22706 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22707 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22708 | } |
| 22709 | |
| 22710 | /*----------------------------------------------------------------------- |
| 22711 | Get message buffer |
| 22712 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22713 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22714 | sizeof(ucRssiThreshold), |
| 22715 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 22716 | ( usSendSize < (usDataOffset + sizeof(ucRssiThreshold) ))) |
| 22717 | { |
| 22718 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22719 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 22720 | pEventData, pwdiRssiFilterReqParams, wdiRssiFilterCb); |
| 22721 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22722 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22723 | } |
| 22724 | |
| 22725 | ucRssiThreshold = pwdiRssiFilterReqParams->rssiThreshold; |
| 22726 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22727 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 22728 | &ucRssiThreshold, |
| 22729 | sizeof(ucRssiThreshold)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22730 | |
| 22731 | pWDICtx->wdiReqStatusCB = pwdiRssiFilterReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22732 | pWDICtx->pReqStatusUserData = pwdiRssiFilterReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22733 | |
| 22734 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22735 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22736 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22737 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 22738 | wdiRssiFilterCb, pEventData->pUserData, WDI_SET_RSSI_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22739 | } |
| 22740 | |
| 22741 | |
| 22742 | /** |
| 22743 | @brief Process Update Scan Params function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22744 | |
| 22745 | @param pWDICtx: pointer to the WLAN DAL context |
| 22746 | pEventData: pointer to the event information structure |
| 22747 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22748 | @see |
| 22749 | @return Result of the function call |
| 22750 | */ |
| 22751 | WDI_Status |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 22752 | WDI_PackUpdateScanParamsReq |
| 22753 | ( |
| 22754 | WDI_ControlBlockType* pWDICtx, |
| 22755 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams, |
| 22756 | wpt_uint8** ppSendBuffer, |
| 22757 | wpt_uint16* pSize |
| 22758 | ) |
| 22759 | { |
| 22760 | wpt_uint8* pSendBuffer = NULL; |
| 22761 | wpt_uint16 usDataOffset = 0; |
| 22762 | wpt_uint16 usSendSize = 0; |
| 22763 | tUpdateScanParams updateScanParams = {0}; |
| 22764 | |
| 22765 | |
| 22766 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 22767 | "Begin WDI Update Scan Parameters Old Style Params"); |
| 22768 | /*----------------------------------------------------------------------- |
| 22769 | Get message buffer |
| 22770 | -----------------------------------------------------------------------*/ |
| 22771 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ, |
| 22772 | sizeof(updateScanParams), |
| 22773 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 22774 | ( usSendSize < (usDataOffset + sizeof(updateScanParams) ))) |
| 22775 | { |
| 22776 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22777 | "Unable to get send buffer in Update Scan Params req %x", |
| 22778 | pwdiUpdateScanParams); |
| 22779 | WDI_ASSERT(0); |
| 22780 | return WDI_STATUS_E_FAILURE; |
| 22781 | } |
| 22782 | |
| 22783 | // |
| 22784 | // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo |
| 22785 | // |
| 22786 | |
| 22787 | updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled; |
| 22788 | updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved; |
| 22789 | |
| 22790 | updateScanParams.ucChannelCount = |
| 22791 | (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount < |
| 22792 | WLAN_HAL_PNO_MAX_NETW_CHANNELS)? |
| 22793 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount : |
| 22794 | WLAN_HAL_PNO_MAX_NETW_CHANNELS; |
| 22795 | |
| 22796 | wpalMemoryCopy( updateScanParams.aChannels, |
| 22797 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels, |
| 22798 | updateScanParams.ucChannelCount); |
| 22799 | |
| 22800 | |
| 22801 | updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime; |
| 22802 | updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime; |
| 22803 | updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime; |
| 22804 | updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime; |
| 22805 | updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState; |
| 22806 | |
| 22807 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 22808 | &updateScanParams, |
| 22809 | sizeof(updateScanParams)); |
| 22810 | |
| 22811 | pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB; |
| 22812 | pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData; |
| 22813 | |
| 22814 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22815 | "End Update Scan Parameters Old Style"); |
| 22816 | |
| 22817 | /*Set the output values*/ |
| 22818 | *ppSendBuffer = pSendBuffer; |
| 22819 | *pSize = usSendSize; |
| 22820 | |
| 22821 | return WDI_STATUS_SUCCESS; |
| 22822 | } |
| 22823 | |
| 22824 | /** |
| 22825 | @brief Process Update Scan Params function |
| 22826 | |
| 22827 | @param pWDICtx: pointer to the WLAN DAL context |
| 22828 | pEventData: pointer to the event information structure |
| 22829 | |
| 22830 | @see |
| 22831 | @return Result of the function call |
| 22832 | */ |
| 22833 | WDI_Status |
| 22834 | WDI_PackUpdateScanParamsReqEx |
| 22835 | ( |
| 22836 | WDI_ControlBlockType* pWDICtx, |
| 22837 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams, |
| 22838 | wpt_uint8** ppSendBuffer, |
| 22839 | wpt_uint16* pSize |
| 22840 | ) |
| 22841 | { |
| 22842 | wpt_uint8* pSendBuffer = NULL; |
| 22843 | wpt_uint16 usDataOffset = 0; |
| 22844 | wpt_uint16 usSendSize = 0; |
| 22845 | tUpdateScanParamsEx updateScanParams = {0}; |
| 22846 | |
| 22847 | |
| 22848 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 22849 | "Begin WDI Update Scan Parameters New Style Params"); |
| 22850 | /*----------------------------------------------------------------------- |
| 22851 | Get message buffer |
| 22852 | -----------------------------------------------------------------------*/ |
| 22853 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ, |
| 22854 | sizeof(updateScanParams), |
| 22855 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 22856 | ( usSendSize < (usDataOffset + sizeof(updateScanParams) ))) |
| 22857 | { |
| 22858 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22859 | "Unable to get send buffer in Update Scan Params Ex req %x", |
| 22860 | pwdiUpdateScanParams); |
| 22861 | WDI_ASSERT(0); |
| 22862 | return WDI_STATUS_E_FAILURE; |
| 22863 | } |
| 22864 | |
| 22865 | // |
| 22866 | // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo |
| 22867 | // |
| 22868 | |
| 22869 | updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled; |
| 22870 | updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved; |
| 22871 | |
| 22872 | updateScanParams.ucChannelCount = |
| 22873 | (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount < |
| 22874 | WLAN_HAL_PNO_MAX_NETW_CHANNELS_EX)? |
| 22875 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount : |
| 22876 | WLAN_HAL_PNO_MAX_NETW_CHANNELS_EX; |
| 22877 | |
| 22878 | wpalMemoryCopy( updateScanParams.aChannels, |
| 22879 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels, |
| 22880 | updateScanParams.ucChannelCount); |
| 22881 | |
| 22882 | |
| 22883 | updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime; |
| 22884 | updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime; |
| 22885 | updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime; |
| 22886 | updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime; |
| 22887 | updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState; |
| 22888 | |
| 22889 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 22890 | &updateScanParams, |
| 22891 | sizeof(updateScanParams)); |
| 22892 | |
| 22893 | pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB; |
| 22894 | pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData; |
| 22895 | |
| 22896 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22897 | "End Update Scan Parameters New Style"); |
| 22898 | |
| 22899 | /*Set the output values*/ |
| 22900 | *ppSendBuffer = pSendBuffer; |
| 22901 | *pSize = usSendSize; |
| 22902 | |
| 22903 | return WDI_STATUS_SUCCESS; |
| 22904 | } |
| 22905 | |
| 22906 | /** |
| 22907 | @brief Process Update Scan Params function |
| 22908 | |
| 22909 | @param pWDICtx: pointer to the WLAN DAL context |
| 22910 | pEventData: pointer to the event information structure |
| 22911 | |
| 22912 | @see |
| 22913 | @return Result of the function call |
| 22914 | */ |
| 22915 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22916 | WDI_ProcessUpdateScanParamsReq |
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_UpdateScanParamsInfoType* pwdiUpdateScanParams = NULL; |
| 22923 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22924 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22925 | wpt_uint16 usDataOffset = 0; |
| 22926 | wpt_uint16 usSendSize = 0; |
| 22927 | tUpdateScanParams updateScanParams = {0}; |
| 22928 | |
| 22929 | |
| 22930 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22931 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22932 | -------------------------------------------------------------------------*/ |
| 22933 | if (( NULL == pEventData ) || |
| 22934 | ( NULL == (pwdiUpdateScanParams = (WDI_UpdateScanParamsInfoType*)pEventData->pEventData)) || |
| 22935 | ( NULL == (wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pEventData->pCBfnc))) |
| 22936 | { |
| 22937 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 22938 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22939 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22940 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22941 | } |
| 22942 | |
| 22943 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 22944 | "Begin WDI Update Scan Parameters"); |
| 22945 | /*----------------------------------------------------------------------- |
| 22946 | Get message buffer |
| 22947 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22948 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22949 | sizeof(updateScanParams), |
| 22950 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 22951 | ( usSendSize < (usDataOffset + sizeof(updateScanParams) ))) |
| 22952 | { |
| 22953 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22954 | "Unable to get send buffer in Update Scan Params req %x %x %x", |
| 22955 | pEventData, pwdiUpdateScanParams, wdiUpdateScanParamsCb); |
| 22956 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22957 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22958 | } |
| 22959 | |
| 22960 | // |
| 22961 | // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo |
| 22962 | // |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 22963 | if ( pWDICtx->wlanVersion.revision < 1 ) |
| 22964 | { |
| 22965 | WDI_PackUpdateScanParamsReq( pWDICtx, pwdiUpdateScanParams, |
| 22966 | &pSendBuffer, &usSendSize); |
| 22967 | } |
| 22968 | else |
| 22969 | { |
| 22970 | WDI_PackUpdateScanParamsReqEx( pWDICtx, pwdiUpdateScanParams, |
| 22971 | &pSendBuffer, &usSendSize); |
| 22972 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22973 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22974 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22975 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22976 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22977 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 22978 | wdiUpdateScanParamsCb, pEventData->pUserData, |
| 22979 | WDI_UPDATE_SCAN_PARAMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22980 | } |
| 22981 | |
| 22982 | /** |
| 22983 | @brief Process Preferred Network Found Indication function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22984 | |
| 22985 | @param pWDICtx: pointer to the WLAN DAL context |
| 22986 | pEventData: pointer to the event information structure |
| 22987 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22988 | @see |
| 22989 | @return Result of the function call |
| 22990 | */ |
| 22991 | WDI_Status |
| 22992 | WDI_ProcessPrefNetworkFoundInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22993 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22994 | WDI_ControlBlockType* pWDICtx, |
| 22995 | WDI_EventInfoType* pEventData |
| 22996 | ) |
| 22997 | { |
| 22998 | WDI_LowLevelIndType wdiInd; |
| 22999 | tPrefNetwFoundInd prefNetwFoundInd = {{0}}; |
| 23000 | |
| 23001 | |
| 23002 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23003 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23004 | -------------------------------------------------------------------------*/ |
| 23005 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23006 | ( NULL == pEventData->pEventData )) |
| 23007 | { |
| 23008 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23009 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23010 | WDI_ASSERT( 0 ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23011 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23012 | } |
| 23013 | |
| 23014 | /*------------------------------------------------------------------------- |
| 23015 | Extract indication and send it to UMAC |
| 23016 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23017 | wpalMemoryCopy( (void *)&prefNetwFoundInd.prefNetwFoundParams, |
| 23018 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23019 | sizeof(tPrefNetwFoundParams)); |
| 23020 | |
| 23021 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23022 | wdiInd.wdiIndicationType = WDI_PREF_NETWORK_FOUND_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23023 | |
| 23024 | wpalMemoryZero(wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,32); |
| 23025 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23026 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23027 | (prefNetwFoundInd.prefNetwFoundParams.ssId.length < 31 )? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23028 | prefNetwFoundInd.prefNetwFoundParams.ssId.length : 31; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23029 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23030 | wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID, |
| 23031 | prefNetwFoundInd.prefNetwFoundParams.ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23032 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength); |
| 23033 | |
| 23034 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi = |
| 23035 | prefNetwFoundInd.prefNetwFoundParams.rssi; |
| 23036 | |
| 23037 | // DEBUG |
| 23038 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 23039 | "[PNO WDI] PREF_NETWORK_FOUND_IND Type (%x) data (SSID=%s, RSSI=%d)", |
| 23040 | wdiInd.wdiIndicationType, |
| 23041 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID, |
| 23042 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi ); |
| 23043 | |
| 23044 | /*Notify UMAC*/ |
| 23045 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23046 | |
| 23047 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23048 | } |
| 23049 | |
| 23050 | /** |
| 23051 | @brief Process PNO Rsp function (called when a |
| 23052 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23053 | |
| 23054 | @param pWDICtx: pointer to the WLAN DAL context |
| 23055 | pEventData: pointer to the event information structure |
| 23056 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23057 | @see |
| 23058 | @return Result of the function call |
| 23059 | */ |
| 23060 | WDI_Status |
| 23061 | WDI_ProcessSetPreferredNetworkRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23062 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23063 | WDI_ControlBlockType* pWDICtx, |
| 23064 | WDI_EventInfoType* pEventData |
| 23065 | ) |
| 23066 | { |
| 23067 | WDI_Status wdiStatus; |
| 23068 | eHalStatus halStatus; |
| 23069 | WDI_PNOScanCb wdiPNOScanCb = NULL; |
| 23070 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23071 | |
| 23072 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23073 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23074 | -------------------------------------------------------------------------*/ |
| 23075 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23076 | ( NULL == pEventData->pEventData )) |
| 23077 | { |
| 23078 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23079 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23080 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23081 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23082 | } |
| 23083 | |
| 23084 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23085 | wdiPNOScanCb = (WDI_PNOScanCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23086 | |
| 23087 | /*------------------------------------------------------------------------- |
| 23088 | Extract response and send it to UMAC |
| 23089 | -------------------------------------------------------------------------*/ |
| 23090 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23091 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23092 | |
| 23093 | /*Notify UMAC*/ |
| 23094 | wdiPNOScanCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 23095 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23096 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23097 | }/*WDI_ProcessSetPreferredNetworkRsp*/ |
| 23098 | |
| 23099 | /** |
| 23100 | @brief Process RSSI Filter Rsp function (called when a |
| 23101 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23102 | |
| 23103 | @param pWDICtx: pointer to the WLAN DAL context |
| 23104 | pEventData: pointer to the event information structure |
| 23105 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23106 | @see |
| 23107 | @return Result of the function call |
| 23108 | */ |
| 23109 | WDI_Status |
| 23110 | WDI_ProcessSetRssiFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23111 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23112 | WDI_ControlBlockType* pWDICtx, |
| 23113 | WDI_EventInfoType* pEventData |
| 23114 | ) |
| 23115 | { |
| 23116 | WDI_Status wdiStatus; |
| 23117 | eHalStatus halStatus; |
| 23118 | WDI_RssiFilterCb wdiRssiFilterCb; |
| 23119 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23120 | |
| 23121 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23122 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23123 | -------------------------------------------------------------------------*/ |
| 23124 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23125 | ( NULL == pEventData->pEventData )) |
| 23126 | { |
| 23127 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23128 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23129 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23130 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23131 | } |
| 23132 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23133 | wdiRssiFilterCb = (WDI_RssiFilterCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23134 | |
| 23135 | /*------------------------------------------------------------------------- |
| 23136 | Extract response and send it to UMAC |
| 23137 | -------------------------------------------------------------------------*/ |
| 23138 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23139 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23140 | |
| 23141 | /*Notify UMAC*/ |
| 23142 | wdiRssiFilterCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 23143 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23144 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23145 | }/*WDI_ProcessSetRssiFilterRsp*/ |
| 23146 | |
| 23147 | /** |
| 23148 | @brief Process Update Scan Params Rsp function (called when a |
| 23149 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23150 | |
| 23151 | @param pWDICtx: pointer to the WLAN DAL context |
| 23152 | pEventData: pointer to the event information structure |
| 23153 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23154 | @see |
| 23155 | @return Result of the function call |
| 23156 | */ |
| 23157 | WDI_Status |
| 23158 | WDI_ProcessUpdateScanParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23159 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23160 | WDI_ControlBlockType* pWDICtx, |
| 23161 | WDI_EventInfoType* pEventData |
| 23162 | ) |
| 23163 | { |
| 23164 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23165 | tUpdateScanParamsResp halUpdScanParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23166 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23167 | wpt_uint32 uStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23168 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23169 | |
| 23170 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23171 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23172 | -------------------------------------------------------------------------*/ |
| 23173 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23174 | ( NULL == pEventData->pEventData )) |
| 23175 | { |
| 23176 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23177 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23178 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23179 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23180 | } |
| 23181 | |
| 23182 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23183 | "Process UPD scan params ptr : %x", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23184 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23185 | wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23186 | |
| 23187 | /*------------------------------------------------------------------------- |
| 23188 | Extract response and send it to UMAC |
| 23189 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23190 | wpalMemoryCopy( (void *)&halUpdScanParams.status, |
| 23191 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23192 | sizeof(halUpdScanParams.status)); |
| 23193 | |
| 23194 | uStatus = halUpdScanParams.status; |
| 23195 | |
| 23196 | /*Extract PNO version - 1st bit of the status */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23197 | pWDICtx->wdiPNOVersion = (uStatus & WDI_PNO_VERSION_MASK)? 1:0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23198 | |
| 23199 | /*Remove version bit*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23200 | uStatus = uStatus & ( ~(WDI_PNO_VERSION_MASK)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23201 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23202 | wdiStatus = WDI_HAL_2_WDI_STATUS(uStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23203 | |
| 23204 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23205 | "UPD Scan Parameters rsp with status: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23206 | halUpdScanParams.status); |
| 23207 | |
| 23208 | /*Notify UMAC*/ |
| 23209 | wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 23210 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23211 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23212 | } |
| 23213 | #endif // FEATURE_WLAN_SCAN_PNO |
| 23214 | |
| 23215 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23216 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23217 | WDI_8023MulticastListReq |
| 23218 | ( |
| 23219 | WDI_RcvFltPktSetMcListReqParamsType* pwdiRcvFltPktSetMcListReqInfo, |
| 23220 | WDI_8023MulticastListCb wdi8023MulticastListCallback, |
| 23221 | void* pUserData |
| 23222 | ) |
| 23223 | { |
| 23224 | WDI_EventInfoType wdiEventData; |
| 23225 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23226 | |
| 23227 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23228 | "%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23229 | |
| 23230 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23231 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23232 | ------------------------------------------------------------------------*/ |
| 23233 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23234 | { |
| 23235 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23236 | "WDI API call before module is initialized - Fail request"); |
| 23237 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23238 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23239 | } |
| 23240 | |
| 23241 | /*------------------------------------------------------------------------ |
| 23242 | Fill in Event data and post to the Main FSM |
| 23243 | ------------------------------------------------------------------------*/ |
| 23244 | wdiEventData.wdiRequest = WDI_8023_MULTICAST_LIST_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23245 | wdiEventData.pEventData = pwdiRcvFltPktSetMcListReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23246 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktSetMcListReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23247 | wdiEventData.pCBfnc = wdi8023MulticastListCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23248 | wdiEventData.pUserData = pUserData; |
| 23249 | |
| 23250 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23251 | } |
| 23252 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23253 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23254 | WDI_ReceiveFilterSetFilterReq |
| 23255 | ( |
| 23256 | WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo, |
| 23257 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCallback, |
| 23258 | void* pUserData |
| 23259 | ) |
| 23260 | { |
| 23261 | WDI_EventInfoType wdiEventData; |
| 23262 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23263 | |
| 23264 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23265 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23266 | |
| 23267 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23268 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23269 | ------------------------------------------------------------------------*/ |
| 23270 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23271 | { |
| 23272 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23273 | "WDI API call before module is initialized - Fail request"); |
| 23274 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23275 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23276 | } |
| 23277 | |
| 23278 | /*------------------------------------------------------------------------ |
| 23279 | Fill in Event data and post to the Main FSM |
| 23280 | ------------------------------------------------------------------------*/ |
| 23281 | wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_SET_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23282 | wdiEventData.pEventData = pwdiSetRcvPktFilterReqInfo; |
| 23283 | wdiEventData.uEventDataSize = sizeof(*pwdiSetRcvPktFilterReqInfo) + |
| 23284 | (pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23285 | * sizeof(WDI_RcvPktFilterFieldParams) - 1); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23286 | wdiEventData.pCBfnc = wdiReceiveFilterSetFilterCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23287 | wdiEventData.pUserData = pUserData; |
| 23288 | |
| 23289 | |
| 23290 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23291 | } |
| 23292 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23293 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23294 | WDI_FilterMatchCountReq |
| 23295 | ( |
| 23296 | WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqInfo, |
| 23297 | WDI_FilterMatchCountCb wdiFilterMatchCountCallback, |
| 23298 | void* pUserData |
| 23299 | ) |
| 23300 | { |
| 23301 | WDI_EventInfoType wdiEventData; |
| 23302 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23303 | |
| 23304 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23305 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23306 | |
| 23307 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23308 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23309 | ------------------------------------------------------------------------*/ |
| 23310 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23311 | { |
| 23312 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23313 | "WDI API call before module is initialized - Fail request"); |
| 23314 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23315 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23316 | } |
| 23317 | |
| 23318 | /*------------------------------------------------------------------------ |
| 23319 | Fill in Event data and post to the Main FSM |
| 23320 | ------------------------------------------------------------------------*/ |
| 23321 | wdiEventData.wdiRequest = WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23322 | wdiEventData.pEventData = pwdiRcvFltPktMatchCntReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23323 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktMatchCntReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23324 | wdiEventData.pCBfnc = wdiFilterMatchCountCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23325 | wdiEventData.pUserData = pUserData; |
| 23326 | |
| 23327 | |
| 23328 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23329 | } |
| 23330 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23331 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23332 | WDI_ReceiveFilterClearFilterReq |
| 23333 | ( |
| 23334 | WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqInfo, |
| 23335 | WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCallback, |
| 23336 | void* pUserData |
| 23337 | ) |
| 23338 | { |
| 23339 | WDI_EventInfoType wdiEventData; |
| 23340 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23341 | |
| 23342 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23343 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23344 | |
| 23345 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23346 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23347 | ------------------------------------------------------------------------*/ |
| 23348 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23349 | { |
| 23350 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23351 | "WDI API call before module is initialized - Fail request"); |
| 23352 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23353 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23354 | } |
| 23355 | |
| 23356 | /*------------------------------------------------------------------------ |
| 23357 | Fill in Event data and post to the Main FSM |
| 23358 | ------------------------------------------------------------------------*/ |
| 23359 | wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23360 | wdiEventData.pEventData = pwdiRcvFltPktClearReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23361 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktClearReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23362 | wdiEventData.pCBfnc = wdiReceiveFilterClearFilterCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23363 | wdiEventData.pUserData = pUserData; |
| 23364 | |
| 23365 | |
| 23366 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23367 | } |
| 23368 | |
| 23369 | /** |
| 23370 | @brief Process 8023 Multicast List Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23371 | |
| 23372 | @param pWDICtx: pointer to the WLAN DAL context |
| 23373 | pEventData: pointer to the event information structure |
| 23374 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23375 | @see |
| 23376 | @return Result of the function call |
| 23377 | */ |
| 23378 | WDI_Status |
| 23379 | WDI_Process8023MulticastListReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23380 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23381 | WDI_ControlBlockType* pWDICtx, |
| 23382 | WDI_EventInfoType* pEventData |
| 23383 | ) |
| 23384 | { |
| 23385 | WDI_RcvFltPktSetMcListReqParamsType* pwdiFltPktSetMcListReqParamsType = NULL; |
| 23386 | WDI_8023MulticastListCb wdi8023MulticastListCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23387 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23388 | wpt_uint16 usDataOffset = 0; |
| 23389 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23390 | tpHalRcvFltMcAddrListType pRcvFltMcAddrListType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23391 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23392 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 23393 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23394 | |
| 23395 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23396 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23397 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23398 | pRcvFltMcAddrListType = wpalMemoryAllocate(sizeof(tHalRcvFltMcAddrListType)) ; |
| 23399 | if( NULL == pRcvFltMcAddrListType ) |
| 23400 | { |
| 23401 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23402 | "Failed to alloc in WDI_Process8023MulticastListReq"); |
| 23403 | return WDI_STATUS_E_FAILURE; |
| 23404 | } |
| 23405 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23406 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23407 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23408 | -------------------------------------------------------------------------*/ |
| 23409 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23410 | ( NULL == (pwdiFltPktSetMcListReqParamsType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23411 | (WDI_RcvFltPktSetMcListReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23412 | ( NULL == (wdi8023MulticastListCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23413 | (WDI_8023MulticastListCb)pEventData->pCBfnc))) |
| 23414 | { |
| 23415 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23416 | "%s: Invalid parameters", __func__); |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23417 | wpalMemoryFree(pRcvFltMcAddrListType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23418 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23419 | return WDI_STATUS_E_FAILURE; |
| 23420 | } |
| 23421 | |
| 23422 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 23423 | pwdiFltPktSetMcListReqParamsType->mcAddrList.bssId, |
| 23424 | &pBSSSes); |
| 23425 | if ( NULL == pBSSSes ) |
| 23426 | { |
| 23427 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23428 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23429 | wpalMemoryFree(pRcvFltMcAddrListType); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23430 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23431 | } |
| 23432 | |
| 23433 | /*----------------------------------------------------------------------- |
| 23434 | Get message buffer |
| 23435 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23436 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 23437 | WDI_8023_MULTICAST_LIST_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23438 | sizeof(tHalRcvFltMcAddrListType), |
| 23439 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23440 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltMcAddrListType)))) |
| 23441 | { |
| 23442 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23443 | "Unable to get send buffer in " |
| 23444 | "WDI_Process8023MulticastListReq() %x %x %x", |
| 23445 | pEventData, pwdiFltPktSetMcListReqParamsType, |
| 23446 | wdi8023MulticastListCb); |
| 23447 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23448 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23449 | } |
| 23450 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23451 | pRcvFltMcAddrListType->cMulticastAddr = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23452 | pwdiFltPktSetMcListReqParamsType->mcAddrList.ulMulticastAddrCnt; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23453 | for( i = 0; i < pRcvFltMcAddrListType->cMulticastAddr; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23454 | { |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23455 | wpalMemoryCopy(pRcvFltMcAddrListType->multicastAddr[i], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23456 | pwdiFltPktSetMcListReqParamsType->mcAddrList.multicastAddr[i], |
| 23457 | sizeof(tSirMacAddr)); |
| 23458 | } |
| 23459 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23460 | pRcvFltMcAddrListType->bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23461 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23462 | pRcvFltMcAddrListType, |
| 23463 | sizeof(tHalRcvFltMcAddrListType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23464 | |
| 23465 | pWDICtx->wdiReqStatusCB = pwdiFltPktSetMcListReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23466 | pWDICtx->pReqStatusUserData = pwdiFltPktSetMcListReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23467 | |
| 23468 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23469 | wpalMemoryFree(pRcvFltMcAddrListType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23470 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23471 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23472 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23473 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23474 | wdi8023MulticastListCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23475 | WDI_8023_MULTICAST_LIST_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23476 | } |
| 23477 | |
| 23478 | /** |
| 23479 | @brief Process Receive Filter Set Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23480 | |
| 23481 | @param pWDICtx: pointer to the WLAN DAL context |
| 23482 | pEventData: pointer to the event information structure |
| 23483 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23484 | @see |
| 23485 | @return Result of the function call |
| 23486 | */ |
| 23487 | WDI_Status |
| 23488 | WDI_ProcessReceiveFilterSetFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23489 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23490 | WDI_ControlBlockType* pWDICtx, |
| 23491 | WDI_EventInfoType* pEventData |
| 23492 | ) |
| 23493 | { |
| 23494 | WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo = NULL; |
| 23495 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23496 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23497 | wpt_uint16 usDataOffset = 0; |
| 23498 | wpt_uint16 usSendSize = 0; |
| 23499 | wpt_uint32 usRcvPktFilterCfgSize; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23500 | tHalRcvPktFilterCfgType *pRcvPktFilterCfg = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23501 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23502 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 23503 | WDI_BSSSessionType* pBSSSes = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23504 | tHalSessionizedRcvPktFilterCfgType *pSessRcvPktFilterCfg = NULL; |
| 23505 | wpt_uint32 usSessRcvPktFilterCfgSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23506 | |
| 23507 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23508 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23509 | |
| 23510 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23511 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23512 | -------------------------------------------------------------------------*/ |
| 23513 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23514 | ( NULL == (pwdiSetRcvPktFilterReqInfo = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23515 | (WDI_SetRcvPktFilterReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23516 | ( NULL == (wdiReceiveFilterSetFilterCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23517 | (WDI_ReceiveFilterSetFilterCb)pEventData->pCBfnc))) |
| 23518 | { |
| 23519 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23520 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23521 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23522 | return WDI_STATUS_E_FAILURE; |
| 23523 | } |
| 23524 | |
| 23525 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 23526 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.bssId, |
| 23527 | &pBSSSes); |
| 23528 | if ( NULL == pBSSSes ) |
| 23529 | { |
| 23530 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23531 | " %s : Association for this BSSID does not exist",__func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23532 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23533 | } |
| 23534 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23535 | if( WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION) ) |
| 23536 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23537 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23538 | usSessRcvPktFilterCfgSize = sizeof(tHalSessionizedRcvPktFilterCfgType) + |
| 23539 | ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1) |
| 23540 | * sizeof(tHalSessionizedRcvPktFilterCfgType)); |
| 23541 | |
| 23542 | pSessRcvPktFilterCfg = (tHalSessionizedRcvPktFilterCfgType *)wpalMemoryAllocate( |
| 23543 | usSessRcvPktFilterCfgSize); |
| 23544 | |
| 23545 | if(NULL == pSessRcvPktFilterCfg) |
| 23546 | { |
| 23547 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23548 | "%s: Failed to allocate memory for " |
| 23549 | "tHalRcvPktFilterCfgType: %x %x %x ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23550 | __func__, pWDICtx, pEventData, pEventData->pEventData); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23551 | WDI_ASSERT(0); |
| 23552 | return WDI_STATUS_E_FAILURE; |
| 23553 | } |
| 23554 | |
| 23555 | wpalMemoryZero(pSessRcvPktFilterCfg, usSessRcvPktFilterCfgSize); |
| 23556 | |
| 23557 | /*----------------------------------------------------------------------- |
| 23558 | Get message buffer |
| 23559 | -----------------------------------------------------------------------*/ |
| 23560 | |
| 23561 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ, |
| 23562 | usSessRcvPktFilterCfgSize, |
| 23563 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23564 | ( usSendSize < (usDataOffset + usSessRcvPktFilterCfgSize))) |
| 23565 | { |
| 23566 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23567 | "Unable to get send buffer in " |
| 23568 | "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x", |
| 23569 | pEventData, pwdiSetRcvPktFilterReqInfo, |
| 23570 | wdiReceiveFilterSetFilterCb); |
| 23571 | WDI_ASSERT(0); |
| 23572 | wpalMemoryFree(pSessRcvPktFilterCfg); |
| 23573 | return WDI_STATUS_E_FAILURE; |
| 23574 | } |
| 23575 | |
| 23576 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23577 | "UsData Off %d UsSend %d cfg %d",usDataOffset, |
| 23578 | usSendSize,pSessRcvPktFilterCfg); |
| 23579 | |
| 23580 | pSessRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId; |
| 23581 | pSessRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType; |
| 23582 | pSessRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams; |
| 23583 | pSessRcvPktFilterCfg->coleasceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime; |
| 23584 | |
| 23585 | pSessRcvPktFilterCfg->bssIdx = pBSSSes->ucBSSIdx; |
| 23586 | |
| 23587 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23588 | "Out: FID %d FT %d",pSessRcvPktFilterCfg->filterId, |
| 23589 | pSessRcvPktFilterCfg->filterType); |
| 23590 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23591 | "NParams %d CT %d",pSessRcvPktFilterCfg->numParams, |
| 23592 | pSessRcvPktFilterCfg->coleasceTime); |
| 23593 | |
| 23594 | for ( i = 0; i < pSessRcvPktFilterCfg->numParams; i++ ) |
| 23595 | { |
| 23596 | pSessRcvPktFilterCfg->paramsData[i].protocolLayer = |
| 23597 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer; |
| 23598 | pSessRcvPktFilterCfg->paramsData[i].cmpFlag = |
| 23599 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag; |
| 23600 | pSessRcvPktFilterCfg->paramsData[i].dataOffset = |
| 23601 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset; |
| 23602 | pSessRcvPktFilterCfg->paramsData[i].dataLength = |
| 23603 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength; |
| 23604 | |
| 23605 | wpalMemoryCopy(&pSessRcvPktFilterCfg->paramsData[i].compareData, |
| 23606 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData, |
| 23607 | 8); |
| 23608 | wpalMemoryCopy(&pSessRcvPktFilterCfg->paramsData[i].dataMask, |
| 23609 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask, |
| 23610 | 8); |
| 23611 | |
| 23612 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23613 | "Out:Proto %d Comp Flag %d \n", |
| 23614 | pSessRcvPktFilterCfg->paramsData[i].protocolLayer, |
| 23615 | pSessRcvPktFilterCfg->paramsData[i].cmpFlag); |
| 23616 | |
| 23617 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23618 | "Data Offset %d Data Len %d\n", |
| 23619 | pSessRcvPktFilterCfg->paramsData[i].dataOffset, |
| 23620 | pSessRcvPktFilterCfg->paramsData[i].dataLength); |
| 23621 | |
| 23622 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23623 | "CData: %d:%d:%d:%d:%d:%d\n", |
| 23624 | pSessRcvPktFilterCfg->paramsData[i].compareData[0], |
| 23625 | pSessRcvPktFilterCfg->paramsData[i].compareData[1], |
| 23626 | pSessRcvPktFilterCfg->paramsData[i].compareData[2], |
| 23627 | pSessRcvPktFilterCfg->paramsData[i].compareData[3], |
| 23628 | pSessRcvPktFilterCfg->paramsData[i].compareData[4], |
| 23629 | pSessRcvPktFilterCfg->paramsData[i].compareData[5]); |
| 23630 | |
| 23631 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23632 | "MData: %d:%d:%d:%d:%d:%d\n", |
| 23633 | pSessRcvPktFilterCfg->paramsData[i].dataMask[0], |
| 23634 | pSessRcvPktFilterCfg->paramsData[i].dataMask[1], |
| 23635 | pSessRcvPktFilterCfg->paramsData[i].dataMask[2], |
| 23636 | pSessRcvPktFilterCfg->paramsData[i].dataMask[3], |
| 23637 | pSessRcvPktFilterCfg->paramsData[i].dataMask[4], |
| 23638 | pSessRcvPktFilterCfg->paramsData[i].dataMask[5]); |
| 23639 | } |
| 23640 | |
| 23641 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 23642 | pSessRcvPktFilterCfg, |
| 23643 | usSessRcvPktFilterCfgSize); |
| 23644 | |
| 23645 | |
| 23646 | pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB; |
| 23647 | pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData; |
| 23648 | |
| 23649 | wpalMemoryFree(pSessRcvPktFilterCfg); |
| 23650 | |
| 23651 | } |
| 23652 | /*If SLM_SESSIONIZATION is not supported then do this */ |
| 23653 | else |
| 23654 | { |
| 23655 | usRcvPktFilterCfgSize = sizeof(tHalRcvPktFilterCfgType) + |
| 23656 | ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1) |
| 23657 | * sizeof(tHalRcvPktFilterParams)); |
| 23658 | |
| 23659 | pRcvPktFilterCfg = (tHalRcvPktFilterCfgType *)wpalMemoryAllocate( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23660 | usRcvPktFilterCfgSize); |
| 23661 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23662 | if(NULL == pRcvPktFilterCfg) |
| 23663 | { |
| 23664 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23665 | "%s: Failed to allocate memory for " |
| 23666 | "tHalRcvPktFilterCfgType: %x %x %x ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23667 | __func__, pWDICtx, pEventData, pEventData->pEventData); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23668 | WDI_ASSERT(0); |
| 23669 | return WDI_STATUS_E_FAILURE; |
| 23670 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23671 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23672 | wpalMemoryZero(pRcvPktFilterCfg, usRcvPktFilterCfgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23673 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23674 | /*----------------------------------------------------------------------- |
| 23675 | Get message buffer |
| 23676 | -----------------------------------------------------------------------*/ |
| 23677 | 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] | 23678 | usRcvPktFilterCfgSize, |
| 23679 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23680 | ( usSendSize < (usDataOffset + usRcvPktFilterCfgSize))) |
| 23681 | { |
| 23682 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23683 | "Unable to get send buffer in " |
| 23684 | "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x", |
| 23685 | pEventData, pwdiSetRcvPktFilterReqInfo, |
| 23686 | wdiReceiveFilterSetFilterCb); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23687 | WDI_ASSERT(0); |
| 23688 | wpalMemoryFree(pRcvPktFilterCfg); |
| 23689 | return WDI_STATUS_E_FAILURE; |
| 23690 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23691 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23692 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23693 | "UsData Off %d UsSend %d cfg %d",usDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23694 | usSendSize,usRcvPktFilterCfgSize); |
| 23695 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23696 | pRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId; |
| 23697 | pRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType; |
| 23698 | pRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams; |
| 23699 | pRcvPktFilterCfg->coalesceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23700 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23701 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23702 | "Out: FID %d FT %d",pRcvPktFilterCfg->filterId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23703 | pRcvPktFilterCfg->filterType); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23704 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23705 | "NParams %d CT %d",pRcvPktFilterCfg->numParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23706 | pRcvPktFilterCfg->coalesceTime); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23707 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23708 | for ( i = 0; i < pRcvPktFilterCfg->numParams; i++ ) |
| 23709 | { |
| 23710 | pRcvPktFilterCfg->paramsData[i].protocolLayer = |
| 23711 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer; |
| 23712 | pRcvPktFilterCfg->paramsData[i].cmpFlag = |
| 23713 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag; |
| 23714 | pRcvPktFilterCfg->paramsData[i].dataOffset = |
| 23715 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset; |
| 23716 | pRcvPktFilterCfg->paramsData[i].dataLength = |
| 23717 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23718 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23719 | wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].compareData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23720 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData, |
| 23721 | 8); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23722 | wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].dataMask, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23723 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask, |
| 23724 | 8); |
| 23725 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23726 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23727 | "Out:Proto %d Comp Flag %d \n", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23728 | pRcvPktFilterCfg->paramsData[i].protocolLayer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23729 | pRcvPktFilterCfg->paramsData[i].cmpFlag); |
| 23730 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23731 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23732 | "Data Offset %d Data Len %d\n", |
| 23733 | pRcvPktFilterCfg->paramsData[i].dataOffset, |
| 23734 | pRcvPktFilterCfg->paramsData[i].dataLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23735 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23736 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23737 | "CData: %d:%d:%d:%d:%d:%d\n", |
| 23738 | pRcvPktFilterCfg->paramsData[i].compareData[0], |
| 23739 | pRcvPktFilterCfg->paramsData[i].compareData[1], |
| 23740 | pRcvPktFilterCfg->paramsData[i].compareData[2], |
| 23741 | pRcvPktFilterCfg->paramsData[i].compareData[3], |
| 23742 | pRcvPktFilterCfg->paramsData[i].compareData[4], |
| 23743 | pRcvPktFilterCfg->paramsData[i].compareData[5]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23744 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23745 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23746 | "MData: %d:%d:%d:%d:%d:%d\n", |
| 23747 | pRcvPktFilterCfg->paramsData[i].dataMask[0], |
| 23748 | pRcvPktFilterCfg->paramsData[i].dataMask[1], |
| 23749 | pRcvPktFilterCfg->paramsData[i].dataMask[2], |
| 23750 | pRcvPktFilterCfg->paramsData[i].dataMask[3], |
| 23751 | pRcvPktFilterCfg->paramsData[i].dataMask[4], |
| 23752 | pRcvPktFilterCfg->paramsData[i].dataMask[5]); |
| 23753 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23754 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23755 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23756 | pRcvPktFilterCfg, |
| 23757 | usRcvPktFilterCfgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23758 | |
| 23759 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23760 | pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB; |
| 23761 | pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23762 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23763 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23764 | "%s",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23765 | wpalMemoryFree(pRcvPktFilterCfg); |
| 23766 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23767 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23768 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23769 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23770 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23771 | wdiReceiveFilterSetFilterCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23772 | WDI_RECEIVE_FILTER_SET_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23773 | } |
| 23774 | |
| 23775 | /** |
| 23776 | @brief Process Packet Filter Match Count Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23777 | |
| 23778 | @param pWDICtx: pointer to the WLAN DAL context |
| 23779 | pEventData: pointer to the event information structure |
| 23780 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23781 | @see |
| 23782 | @return Result of the function call |
| 23783 | */ |
| 23784 | WDI_Status |
| 23785 | WDI_ProcessFilterMatchCountReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23786 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23787 | WDI_ControlBlockType* pWDICtx, |
| 23788 | WDI_EventInfoType* pEventData |
| 23789 | ) |
| 23790 | { |
| 23791 | WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqParamsType = |
| 23792 | NULL; |
| 23793 | WDI_FilterMatchCountCb wdiFilterMatchCountCb = |
| 23794 | NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23795 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23796 | wpt_uint16 usDataOffset = 0; |
| 23797 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23798 | tHalRcvFltPktMatchCntReqParams rcvFltPktMatchCntReqParam = {0}; |
| 23799 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 23800 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23801 | |
| 23802 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23803 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23804 | |
| 23805 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23806 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23807 | -------------------------------------------------------------------------*/ |
| 23808 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23809 | ( NULL == (pwdiRcvFltPktMatchCntReqParamsType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23810 | (WDI_RcvFltPktMatchCntReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23811 | ( NULL == (wdiFilterMatchCountCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23812 | (WDI_FilterMatchCountCb)pEventData->pCBfnc))) |
| 23813 | { |
| 23814 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23815 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23816 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23817 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23818 | } |
| 23819 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23820 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 23821 | pwdiRcvFltPktMatchCntReqParamsType->bssId, |
| 23822 | &pBSSSes); |
| 23823 | if ( NULL == pBSSSes ) |
| 23824 | { |
| 23825 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23826 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23827 | return WDI_STATUS_E_FAILURE; |
| 23828 | } |
| 23829 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23830 | /*----------------------------------------------------------------------- |
| 23831 | Get message buffer |
| 23832 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23833 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 23834 | WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23835 | sizeof(tHalRcvFltPktMatchCntReqParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23836 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23837 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktMatchCntReqParams)))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23838 | { |
| 23839 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23840 | "Unable to get send buffer in " |
| 23841 | "WDI_ProcessFilterMatchCountReq() %x %x %x", |
| 23842 | pEventData, pwdiRcvFltPktMatchCntReqParamsType, |
| 23843 | wdiFilterMatchCountCb); |
| 23844 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23845 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23846 | } |
| 23847 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23848 | rcvFltPktMatchCntReqParam.bssIdx = pBSSSes->ucBSSIdx; |
| 23849 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 23850 | &rcvFltPktMatchCntReqParam, |
| 23851 | sizeof(rcvFltPktMatchCntReqParam)); |
| 23852 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23853 | // |
| 23854 | // Don't need to fill send buffer other than header |
| 23855 | // |
| 23856 | pWDICtx->wdiReqStatusCB = pwdiRcvFltPktMatchCntReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23857 | pWDICtx->pReqStatusUserData = pwdiRcvFltPktMatchCntReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23858 | |
| 23859 | |
| 23860 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23861 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23862 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23863 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 23864 | wdiFilterMatchCountCb, |
| 23865 | pEventData->pUserData, |
| 23866 | WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23867 | } |
| 23868 | |
| 23869 | /** |
| 23870 | @brief Process Receive Filter Clear Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23871 | |
| 23872 | @param pWDICtx: pointer to the WLAN DAL context |
| 23873 | pEventData: pointer to the event information structure |
| 23874 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23875 | @see |
| 23876 | @return Result of the function call |
| 23877 | */ |
| 23878 | WDI_Status |
| 23879 | WDI_ProcessReceiveFilterClearFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23880 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23881 | WDI_ControlBlockType* pWDICtx, |
| 23882 | WDI_EventInfoType* pEventData |
| 23883 | ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23884 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23885 | WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqParamsType = NULL; |
| 23886 | WDI_ReceiveFilterClearFilterCb wdiRcvFltPktClearFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23887 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23888 | wpt_uint16 usDataOffset = 0; |
| 23889 | wpt_uint16 usSendSize = 0; |
| 23890 | tHalRcvFltPktClearParam rcvFltPktClearParam; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23891 | wpt_uint8 ucCurrentSessionId = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23892 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23893 | |
| 23894 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23895 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23896 | |
| 23897 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23898 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23899 | -------------------------------------------------------------------------*/ |
| 23900 | if (( NULL == pEventData ) || |
| 23901 | ( NULL == (pwdiRcvFltPktClearReqParamsType = |
| 23902 | (WDI_RcvFltPktClearReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23903 | ( NULL == (wdiRcvFltPktClearFilterCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23904 | (WDI_ReceiveFilterClearFilterCb)pEventData->pCBfnc))) |
| 23905 | { |
| 23906 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23907 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23908 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23909 | return WDI_STATUS_E_FAILURE; |
| 23910 | } |
| 23911 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23912 | ucCurrentSessionId = WDI_FindAssocSession( pWDICtx, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23913 | pwdiRcvFltPktClearReqParamsType->filterClearParam.bssId, |
| 23914 | &pBSSSes); |
| 23915 | if ( NULL == pBSSSes ) |
| 23916 | { |
| 23917 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23918 | " %s : Association for this BSSID does not exist",__func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23919 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23920 | } |
| 23921 | |
| 23922 | /*----------------------------------------------------------------------- |
| 23923 | Get message buffer |
| 23924 | -----------------------------------------------------------------------*/ |
| 23925 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23926 | WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23927 | sizeof(tHalRcvFltPktClearParam), |
| 23928 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23929 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktClearParam)))) |
| 23930 | { |
| 23931 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23932 | "Unable to get send buffer in " |
| 23933 | "WDI_ProcessReceiveFilterClearFilterReq() %x %x %x", |
| 23934 | pEventData, pwdiRcvFltPktClearReqParamsType, |
| 23935 | wdiRcvFltPktClearFilterCb); |
| 23936 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23937 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23938 | } |
| 23939 | |
| 23940 | |
| 23941 | rcvFltPktClearParam.status = pwdiRcvFltPktClearReqParamsType-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23942 | filterClearParam.status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23943 | rcvFltPktClearParam.filterId = pwdiRcvFltPktClearReqParamsType-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23944 | filterClearParam.filterId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23945 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23946 | rcvFltPktClearParam.bssIdx = pBSSSes->ucBSSIdx; |
| 23947 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 23948 | &rcvFltPktClearParam, |
| 23949 | sizeof(rcvFltPktClearParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23950 | |
| 23951 | pWDICtx->wdiReqStatusCB = pwdiRcvFltPktClearReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23952 | pWDICtx->pReqStatusUserData = pwdiRcvFltPktClearReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23953 | |
| 23954 | |
| 23955 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23956 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23957 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23958 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23959 | wdiRcvFltPktClearFilterCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23960 | WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23961 | } |
| 23962 | |
| 23963 | /** |
| 23964 | @brief Process 8023 Multicast List Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23965 | |
| 23966 | @param pWDICtx: pointer to the WLAN DAL context |
| 23967 | pEventData: pointer to the event information structure |
| 23968 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23969 | @see |
| 23970 | @return Result of the function call |
| 23971 | */ |
| 23972 | WDI_Status |
| 23973 | WDI_Process8023MulticastListRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23974 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23975 | WDI_ControlBlockType* pWDICtx, |
| 23976 | WDI_EventInfoType* pEventData |
| 23977 | ) |
| 23978 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23979 | eHalStatus halStatus; |
| 23980 | WDI_8023MulticastListCb wdi8023MulticastListCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 23981 | tHalRcvFltPktSetMcListRspType halRcvFltPktSetMcListRsp; |
| 23982 | WDI_RcvFltPktSetMcListRspParamsType wdiRcvFltPktSetMcListRspInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23983 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23984 | |
| 23985 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23986 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23987 | |
| 23988 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23989 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23990 | -------------------------------------------------------------------------*/ |
| 23991 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23992 | ( NULL == pEventData->pEventData )) |
| 23993 | { |
| 23994 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23995 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23996 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23997 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23998 | } |
| 23999 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24000 | wdi8023MulticastListCb = (WDI_8023MulticastListCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24001 | |
| 24002 | /*------------------------------------------------------------------------- |
| 24003 | Extract response and send it to UMAC |
| 24004 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24005 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 24006 | { |
| 24007 | wpalMemoryCopy( &halRcvFltPktSetMcListRsp, |
| 24008 | pEventData->pEventData, |
| 24009 | sizeof(halRcvFltPktSetMcListRsp)); |
| 24010 | |
| 24011 | wdiRcvFltPktSetMcListRspInfo.wdiStatus = |
| 24012 | WDI_HAL_2_WDI_STATUS(halRcvFltPktSetMcListRsp.status); |
| 24013 | wdiRcvFltPktSetMcListRspInfo.bssIdx = |
| 24014 | halRcvFltPktSetMcListRsp.bssIdx; |
| 24015 | } |
| 24016 | else |
| 24017 | { |
| 24018 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24019 | wdiRcvFltPktSetMcListRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24020 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24021 | |
| 24022 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24023 | wdi8023MulticastListCb(&wdiRcvFltPktSetMcListRspInfo, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24024 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24025 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24026 | } |
| 24027 | |
| 24028 | /** |
| 24029 | @brief Process Set Rsp function (called when a |
| 24030 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24031 | |
| 24032 | @param pWDICtx: pointer to the WLAN DAL context |
| 24033 | pEventData: pointer to the event information structure |
| 24034 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24035 | @see |
| 24036 | @return Result of the function call |
| 24037 | */ |
| 24038 | WDI_Status |
| 24039 | WDI_ProcessReceiveFilterSetFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24040 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24041 | WDI_ControlBlockType* pWDICtx, |
| 24042 | WDI_EventInfoType* pEventData |
| 24043 | ) |
| 24044 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24045 | eHalStatus halStatus; |
| 24046 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24047 | tHalSetPktFilterRspParams halSetPktFilterRspParams; |
| 24048 | WDI_SetRcvPktFilterRspParamsType wdiSetRcvPktFilterRspInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24049 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24050 | |
| 24051 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24052 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24053 | |
| 24054 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24055 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24056 | -------------------------------------------------------------------------*/ |
| 24057 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24058 | ( NULL == pEventData->pEventData )) |
| 24059 | { |
| 24060 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24061 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24062 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24063 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24064 | } |
| 24065 | |
| 24066 | wdiReceiveFilterSetFilterCb = (WDI_ReceiveFilterSetFilterCb)pWDICtx-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24067 | pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24068 | |
| 24069 | /*------------------------------------------------------------------------- |
| 24070 | Extract response and send it to UMAC |
| 24071 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24072 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 24073 | { |
| 24074 | wpalMemoryCopy( &halSetPktFilterRspParams, |
| 24075 | pEventData->pEventData, |
| 24076 | sizeof(halSetPktFilterRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24077 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24078 | wdiSetRcvPktFilterRspInfo.bssIdx = halSetPktFilterRspParams.bssIdx; |
| 24079 | wdiSetRcvPktFilterRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halSetPktFilterRspParams.status); |
| 24080 | } |
| 24081 | else |
| 24082 | { |
| 24083 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24084 | wdiSetRcvPktFilterRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24085 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24086 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24087 | wdiReceiveFilterSetFilterCb(&wdiSetRcvPktFilterRspInfo, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24088 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24089 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24090 | } |
| 24091 | |
| 24092 | /** |
| 24093 | @brief Process Packet Filter Match Count Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24094 | |
| 24095 | @param pWDICtx: pointer to the WLAN DAL context |
| 24096 | pEventData: pointer to the event information structure |
| 24097 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24098 | @see |
| 24099 | @return Result of the function call |
| 24100 | */ |
| 24101 | WDI_Status |
| 24102 | WDI_ProcessFilterMatchCountRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24103 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24104 | WDI_ControlBlockType* pWDICtx, |
| 24105 | WDI_EventInfoType* pEventData |
| 24106 | ) |
| 24107 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24108 | eHalStatus halStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24109 | WDI_FilterMatchCountCb wdiFilterMatchCountCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24110 | tHalRcvFltPktMatchRspParams halRcvFltrPktMatachRsp; |
| 24111 | WDI_RcvFltPktMatchCntRspParamsType wdiRcvFltPktMatchRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24112 | |
| 24113 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24114 | |
| 24115 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24116 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24117 | |
| 24118 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24119 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24120 | -------------------------------------------------------------------------*/ |
| 24121 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24122 | ( NULL == pEventData->pEventData )) |
| 24123 | { |
| 24124 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24125 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24126 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24127 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24128 | } |
| 24129 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24130 | wdiFilterMatchCountCb = (WDI_FilterMatchCountCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24131 | |
| 24132 | /*------------------------------------------------------------------------- |
| 24133 | Extract response and send it to UMAC |
| 24134 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24135 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 24136 | { |
| 24137 | wpalMemoryCopy( &halRcvFltrPktMatachRsp, |
| 24138 | pEventData->pEventData, |
| 24139 | sizeof(halRcvFltrPktMatachRsp)); |
| 24140 | |
| 24141 | wdiRcvFltPktMatchRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halRcvFltrPktMatachRsp.status); |
| 24142 | wdiRcvFltPktMatchRspParams.bssIdx = halRcvFltrPktMatachRsp.bssIdx; |
| 24143 | } |
| 24144 | else |
| 24145 | { |
| 24146 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24147 | wdiRcvFltPktMatchRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24148 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24149 | |
| 24150 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24151 | wdiFilterMatchCountCb(&wdiRcvFltPktMatchRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24152 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24153 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24154 | } |
| 24155 | |
| 24156 | /** |
| 24157 | @brief Process Receive Filter Clear Filter Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24158 | |
| 24159 | @param pWDICtx: pointer to the WLAN DAL context |
| 24160 | pEventData: pointer to the event information structure |
| 24161 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24162 | @see |
| 24163 | @return Result of the function call |
| 24164 | */ |
| 24165 | WDI_Status |
| 24166 | WDI_ProcessReceiveFilterClearFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24167 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24168 | WDI_ControlBlockType* pWDICtx, |
| 24169 | WDI_EventInfoType* pEventData |
| 24170 | ) |
| 24171 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24172 | eHalStatus halStatus; |
| 24173 | WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24174 | tHalRcvFltPktClearParam halRcvFltPktClearRspMsg; |
| 24175 | WDI_RcvFltPktClearRspParamsType wdiRcvFltPktClearRspParamsType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24176 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24177 | |
| 24178 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24179 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24180 | |
| 24181 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24182 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24183 | -------------------------------------------------------------------------*/ |
| 24184 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24185 | ( NULL == pEventData->pEventData )) |
| 24186 | { |
| 24187 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24188 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24189 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24190 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24191 | } |
| 24192 | |
| 24193 | wdiReceiveFilterClearFilterCb = (WDI_ReceiveFilterClearFilterCb)pWDICtx-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24194 | pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24195 | |
| 24196 | /*------------------------------------------------------------------------- |
| 24197 | Extract response and send it to UMAC |
| 24198 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24199 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 24200 | { |
| 24201 | wpalMemoryCopy( &halRcvFltPktClearRspMsg, |
| 24202 | pEventData->pEventData, |
| 24203 | sizeof(halRcvFltPktClearRspMsg)); |
| 24204 | |
| 24205 | wdiRcvFltPktClearRspParamsType.wdiStatus = |
| 24206 | WDI_HAL_2_WDI_STATUS(halRcvFltPktClearRspMsg.status); |
| 24207 | wdiRcvFltPktClearRspParamsType.bssIdx = |
| 24208 | halRcvFltPktClearRspMsg.bssIdx; |
| 24209 | } |
| 24210 | else |
| 24211 | { |
| 24212 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24213 | wdiRcvFltPktClearRspParamsType.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24214 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24215 | |
| 24216 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24217 | wdiReceiveFilterClearFilterCb(&wdiRcvFltPktClearRspParamsType, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24218 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24219 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24220 | } |
| 24221 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 24222 | |
| 24223 | /** |
| 24224 | @brief Process Shutdown Rsp function |
| 24225 | There is no shutdown response comming from HAL |
| 24226 | - function just kept for simmetry |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24227 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24228 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24229 | pEventData: pointer to the event information structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24230 | |
| 24231 | @see |
| 24232 | @return Result of the function call |
| 24233 | */ |
| 24234 | WDI_Status |
| 24235 | WDI_ProcessShutdownRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24236 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24237 | WDI_ControlBlockType* pWDICtx, |
| 24238 | WDI_EventInfoType* pEventData |
| 24239 | ) |
| 24240 | { |
| 24241 | /*There is no shutdown response comming from HAL - function just kept for |
| 24242 | simmetry */ |
| 24243 | WDI_ASSERT(0); |
| 24244 | return WDI_STATUS_SUCCESS; |
| 24245 | }/*WDI_ProcessShutdownRsp*/ |
| 24246 | |
| 24247 | /** |
| 24248 | @brief WDI_SetPowerParamsReq |
| 24249 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24250 | @param pwdiPowerParamsReqParams: the Set Power Params as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24251 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24252 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24253 | wdiPowerParamsCb: callback for passing back the response |
| 24254 | of the Set Power Params operation received from the |
| 24255 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24256 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24257 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24258 | callback |
| 24259 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24260 | @return Result of the function call |
| 24261 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24262 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24263 | WDI_SetPowerParamsReq |
| 24264 | ( |
| 24265 | WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams, |
| 24266 | WDI_SetPowerParamsCb wdiPowerParamsCb, |
| 24267 | void* pUserData |
| 24268 | ) |
| 24269 | { |
| 24270 | WDI_EventInfoType wdiEventData; |
| 24271 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24272 | |
| 24273 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24274 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24275 | ------------------------------------------------------------------------*/ |
| 24276 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24277 | { |
| 24278 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24279 | "WDI API call before module is initialized - Fail request"); |
| 24280 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24281 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24282 | } |
| 24283 | |
| 24284 | /*------------------------------------------------------------------------ |
| 24285 | Fill in Event data and post to the Main FSM |
| 24286 | ------------------------------------------------------------------------*/ |
| 24287 | wdiEventData.wdiRequest = WDI_SET_POWER_PARAMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24288 | wdiEventData.pEventData = pwdiPowerParamsReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24289 | wdiEventData.uEventDataSize = sizeof(*pwdiPowerParamsReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24290 | wdiEventData.pCBfnc = wdiPowerParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24291 | wdiEventData.pUserData = pUserData; |
| 24292 | |
| 24293 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24294 | }/*WDI_SetPowerParamsReq*/ |
| 24295 | |
| 24296 | /** |
| 24297 | @brief Process Set Power Params Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24298 | |
| 24299 | @param pWDICtx: pointer to the WLAN DAL context |
| 24300 | pEventData: pointer to the event information structure |
| 24301 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24302 | @see |
| 24303 | @return Result of the function call |
| 24304 | */ |
| 24305 | WDI_Status |
| 24306 | WDI_ProcessSetPowerParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24307 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24308 | WDI_ControlBlockType* pWDICtx, |
| 24309 | WDI_EventInfoType* pEventData |
| 24310 | ) |
| 24311 | { |
| 24312 | WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams = NULL; |
| 24313 | WDI_SetPowerParamsCb wdiPowerParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24314 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24315 | wpt_uint16 usDataOffset = 0; |
| 24316 | wpt_uint16 usSendSize = 0; |
| 24317 | tSetPowerParamsType powerParams; |
| 24318 | |
| 24319 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24320 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24321 | -------------------------------------------------------------------------*/ |
| 24322 | if (( NULL == pEventData ) || |
| 24323 | ( NULL == (pwdiPowerParamsReqParams = (WDI_SetPowerParamsReqParamsType*)pEventData->pEventData)) || |
| 24324 | ( NULL == (wdiPowerParamsCb = (WDI_SetPowerParamsCb)pEventData->pCBfnc))) |
| 24325 | { |
| 24326 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24327 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24328 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24329 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24330 | } |
| 24331 | |
| 24332 | /*----------------------------------------------------------------------- |
| 24333 | Get message buffer |
| 24334 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24335 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_POWER_PARAMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24336 | sizeof(powerParams), |
| 24337 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24338 | ( usSendSize < (usDataOffset + sizeof(powerParams) ))) |
| 24339 | { |
| 24340 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24341 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 24342 | pEventData, pwdiPowerParamsReqParams, wdiPowerParamsCb); |
| 24343 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24344 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24345 | } |
| 24346 | |
| 24347 | /* Ignore DTIM */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24348 | powerParams.uIgnoreDTIM = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24349 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uIgnoreDTIM; |
| 24350 | |
| 24351 | /*DTIM Period*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24352 | powerParams.uDTIMPeriod = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24353 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uDTIMPeriod; |
| 24354 | |
| 24355 | /* Listen Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24356 | powerParams.uListenInterval= |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24357 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uListenInterval; |
| 24358 | |
| 24359 | /* Broadcast Multicas Filter */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24360 | powerParams.uBcastMcastFilter = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24361 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBcastMcastFilter; |
| 24362 | |
| 24363 | /* Beacon Early Termination */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24364 | powerParams.uEnableBET = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24365 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uEnableBET; |
| 24366 | |
| 24367 | /* Beacon Early Termination Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24368 | powerParams.uBETInterval = |
| 24369 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBETInterval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24370 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24371 | |
| 24372 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24373 | &powerParams, |
| 24374 | sizeof(powerParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24375 | |
| 24376 | pWDICtx->wdiReqStatusCB = pwdiPowerParamsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24377 | pWDICtx->pReqStatusUserData = pwdiPowerParamsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24378 | |
| 24379 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24380 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24381 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24382 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 24383 | wdiPowerParamsCb, pEventData->pUserData, WDI_SET_POWER_PARAMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24384 | } |
| 24385 | |
| 24386 | /** |
| 24387 | @brief Process Power Params Rsp function (called when a |
| 24388 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24389 | |
| 24390 | @param pWDICtx: pointer to the WLAN DAL context |
| 24391 | pEventData: pointer to the event information structure |
| 24392 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24393 | @see |
| 24394 | @return Result of the function call |
| 24395 | */ |
| 24396 | WDI_Status |
| 24397 | WDI_ProcessSetPowerParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24398 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24399 | WDI_ControlBlockType* pWDICtx, |
| 24400 | WDI_EventInfoType* pEventData |
| 24401 | ) |
| 24402 | { |
| 24403 | WDI_Status wdiStatus; |
| 24404 | eHalStatus halStatus; |
| 24405 | WDI_SetPowerParamsCb wdiPowerParamsCb; |
| 24406 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24407 | |
| 24408 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24409 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24410 | -------------------------------------------------------------------------*/ |
| 24411 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24412 | ( NULL == pEventData->pEventData )) |
| 24413 | { |
| 24414 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24415 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24416 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24417 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24418 | } |
| 24419 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24420 | wdiPowerParamsCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24421 | |
| 24422 | /*------------------------------------------------------------------------- |
| 24423 | Extract response and send it to UMAC |
| 24424 | -------------------------------------------------------------------------*/ |
| 24425 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24426 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24427 | |
| 24428 | /*Notify UMAC*/ |
| 24429 | wdiPowerParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24430 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24431 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24432 | }/*WDI_ProcessSetPowerParamsRsp*/ |
| 24433 | |
| 24434 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 24435 | /** |
| 24436 | @brief WDI_GTKOffloadReq will be called when the upper MAC |
| 24437 | wants to set GTK Rekey Counter while in power save. Upon |
| 24438 | the call of this API the WLAN DAL will pack and send a |
| 24439 | HAL GTK offload request message to the lower RIVA |
| 24440 | sub-system if DAL is in state STARTED. |
| 24441 | |
| 24442 | In state BUSY this request will be queued. Request won't |
| 24443 | be allowed in any other state. |
| 24444 | |
| 24445 | WDI_PostAssocReq must have been called. |
| 24446 | |
| 24447 | @param pwdiGtkOffloadParams: the GTK offload as specified |
| 24448 | by the Device Interface |
| 24449 | |
| 24450 | wdiGtkOffloadCb: callback for passing back the response |
| 24451 | of the GTK offload operation received from the device |
| 24452 | |
| 24453 | pUserData: user data will be passed back with the |
| 24454 | callback |
| 24455 | |
| 24456 | @see WDI_PostAssocReq |
| 24457 | @return Result of the function call |
| 24458 | */ |
| 24459 | WDI_Status |
| 24460 | WDI_GTKOffloadReq |
| 24461 | ( |
| 24462 | WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg, |
| 24463 | WDI_GtkOffloadCb wdiGtkOffloadCb, |
| 24464 | void* pUserData |
| 24465 | ) |
| 24466 | { |
| 24467 | WDI_EventInfoType wdiEventData = {0}; |
| 24468 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24469 | |
| 24470 | /*------------------------------------------------------------------------ |
| 24471 | Sanity Check |
| 24472 | ------------------------------------------------------------------------*/ |
| 24473 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24474 | { |
| 24475 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24476 | "WDI API call before module is initialized - Fail request"); |
| 24477 | |
| 24478 | return WDI_STATUS_E_NOT_ALLOWED; |
| 24479 | } |
| 24480 | |
| 24481 | /*------------------------------------------------------------------------ |
| 24482 | Fill in Event data and post to the Main FSM |
| 24483 | ------------------------------------------------------------------------*/ |
| 24484 | wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_REQ; |
| 24485 | wdiEventData.pEventData = pwdiGtkOffloadReqMsg; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 24486 | wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadReqMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24487 | wdiEventData.pCBfnc = wdiGtkOffloadCb; |
| 24488 | wdiEventData.pUserData = pUserData; |
| 24489 | |
| 24490 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24491 | } |
| 24492 | |
| 24493 | |
| 24494 | /** |
| 24495 | @brief WDI_GTKOffloadGetInfoReq will be called when the upper |
| 24496 | MAC wants to get GTK Rekey Counter while in power save. |
| 24497 | Upon the call of this API the WLAN DAL will pack and |
| 24498 | send a HAL GTK offload request message to the lower RIVA |
| 24499 | sub-system if DAL is in state STARTED. |
| 24500 | |
| 24501 | In state BUSY this request will be queued. Request won't |
| 24502 | be allowed in any other state. |
| 24503 | |
| 24504 | WDI_PostAssocReq must have been called. |
| 24505 | |
| 24506 | @param pwdiGtkOffloadGetInfoReqMsg: the GTK Offload |
| 24507 | Information Message as specified by the |
| 24508 | Device Interface |
| 24509 | |
| 24510 | wdiGtkOffloadGetInfoCb: callback for passing back the |
| 24511 | response of the GTK offload operation received from the |
| 24512 | device |
| 24513 | |
| 24514 | pUserData: user data will be passed back with the |
| 24515 | callback |
| 24516 | |
| 24517 | @see WDI_PostAssocReq |
| 24518 | @return Result of the function call |
| 24519 | */ |
| 24520 | WDI_Status |
| 24521 | WDI_GTKOffloadGetInfoReq |
| 24522 | ( |
| 24523 | WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg, |
| 24524 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb, |
| 24525 | void* pUserData |
| 24526 | ) |
| 24527 | { |
| 24528 | WDI_EventInfoType wdiEventData = {0}; |
| 24529 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24530 | |
| 24531 | /*------------------------------------------------------------------------ |
| 24532 | Sanity Check |
| 24533 | ------------------------------------------------------------------------*/ |
| 24534 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24535 | { |
| 24536 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24537 | "WDI API call before module is initialized - Fail request"); |
| 24538 | |
| 24539 | return WDI_STATUS_E_NOT_ALLOWED; |
| 24540 | } |
| 24541 | |
| 24542 | /*------------------------------------------------------------------------ |
| 24543 | Fill in Event data and post to the Main FSM |
| 24544 | ------------------------------------------------------------------------*/ |
| 24545 | wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_GETINFO_REQ; |
| 24546 | wdiEventData.pEventData = pwdiGtkOffloadGetInfoReqMsg; |
| 24547 | wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadGetInfoReqMsg); |
| 24548 | wdiEventData.pCBfnc = wdiGtkOffloadGetInfoCb; |
| 24549 | wdiEventData.pUserData = pUserData; |
| 24550 | |
| 24551 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24552 | } |
| 24553 | |
| 24554 | |
| 24555 | /** |
| 24556 | @brief Process set GTK Offload Request function |
| 24557 | |
| 24558 | @param pWDICtx: pointer to the WLAN DAL context |
| 24559 | pEventData: pointer to the event information structure |
| 24560 | |
| 24561 | @see |
| 24562 | @return Result of the function call |
| 24563 | */ |
| 24564 | WDI_Status |
| 24565 | WDI_ProcessGTKOffloadReq |
| 24566 | ( |
| 24567 | WDI_ControlBlockType* pWDICtx, |
| 24568 | WDI_EventInfoType* pEventData |
| 24569 | ) |
| 24570 | { |
| 24571 | WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg = NULL; |
| 24572 | WDI_GtkOffloadCb wdiGtkOffloadCb = NULL; |
| 24573 | wpt_uint8* pSendBuffer = NULL; |
| 24574 | wpt_uint16 usDataOffset = 0; |
| 24575 | wpt_uint16 usSendSize = 0; |
| 24576 | tHalGtkOffloadReqParams gtkOffloadReqParams = {0}; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24577 | wpt_uint8 ucCurrentSessionId = 0; |
| 24578 | WDI_BSSSessionType* pBSSSes = NULL; |
| 24579 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24580 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24581 | |
| 24582 | /*------------------------------------------------------------------------- |
| 24583 | Sanity check |
| 24584 | -------------------------------------------------------------------------*/ |
| 24585 | if (( NULL == pEventData ) || |
| 24586 | ( NULL == (pwdiGtkOffloadReqMsg = (WDI_GtkOffloadReqMsg*)pEventData->pEventData)) || |
| 24587 | ( NULL == (wdiGtkOffloadCb = (WDI_GtkOffloadCb)pEventData->pCBfnc))) |
| 24588 | { |
| 24589 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24590 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24591 | WDI_ASSERT(0); |
| 24592 | return WDI_STATUS_E_FAILURE; |
| 24593 | } |
| 24594 | |
| 24595 | /*----------------------------------------------------------------------- |
| 24596 | Get message buffer |
| 24597 | -----------------------------------------------------------------------*/ |
| 24598 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_REQ, |
| 24599 | sizeof(gtkOffloadReqParams), |
| 24600 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24601 | ( usSendSize < (usDataOffset + sizeof(gtkOffloadReqParams) ))) |
| 24602 | { |
| 24603 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24604 | "Unable to get send buffer in GTK offload req %x %x %x", |
| 24605 | pEventData, pwdiGtkOffloadReqMsg, wdiGtkOffloadCb); |
| 24606 | WDI_ASSERT(0); |
| 24607 | return WDI_STATUS_E_FAILURE; |
| 24608 | } |
| 24609 | |
| 24610 | // |
| 24611 | // Fill gtkOffloadReqParams from pwdiGtkOffloadReqMsg->gtkOffloadReqParams |
| 24612 | // |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24613 | ucCurrentSessionId = WDI_FindAssocSession( pWDICtx, |
| 24614 | pwdiGtkOffloadReqMsg->gtkOffloadReqParams.bssId, |
| 24615 | &pBSSSes); |
| 24616 | if ( NULL == pBSSSes ) |
| 24617 | { |
| 24618 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24619 | " %s : Association for this BSSID does not exist", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24620 | return WDI_STATUS_E_FAILURE; |
| 24621 | } |
| 24622 | |
| 24623 | gtkOffloadReqParams.bssIdx = pBSSSes->ucBSSIdx; |
| 24624 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24625 | gtkOffloadReqParams.ulFlags = pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ulFlags; |
| 24626 | // Copy KCK |
| 24627 | wpalMemoryCopy(&(gtkOffloadReqParams.aKCK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKCK[0]), 16); |
| 24628 | // Copy KEK |
| 24629 | wpalMemoryCopy(&(gtkOffloadReqParams.aKEK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKEK[0]), 16); |
| 24630 | // Copy KeyReplayCounter |
| 24631 | wpalMemoryCopy(&(gtkOffloadReqParams.ullKeyReplayCounter), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ullKeyReplayCounter), sizeof(v_U64_t)); |
| 24632 | |
| 24633 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24634 | >kOffloadReqParams, |
| 24635 | sizeof(gtkOffloadReqParams)); |
| 24636 | |
| 24637 | pWDICtx->wdiReqStatusCB = pwdiGtkOffloadReqMsg->wdiReqStatusCB; |
| 24638 | pWDICtx->pReqStatusUserData = pwdiGtkOffloadReqMsg->pUserData; |
| 24639 | |
| 24640 | /*------------------------------------------------------------------------- |
| 24641 | Send Get STA Request to HAL |
| 24642 | -------------------------------------------------------------------------*/ |
| 24643 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 24644 | wdiGtkOffloadCb, pEventData->pUserData, WDI_GTK_OFFLOAD_RESP); |
| 24645 | } |
| 24646 | |
| 24647 | |
| 24648 | /** |
| 24649 | @brief Process GTK Offload Get Information Request function |
| 24650 | |
| 24651 | @param pWDICtx: pointer to the WLAN DAL context |
| 24652 | pEventData: pointer to the event information structure |
| 24653 | |
| 24654 | @see |
| 24655 | @return Result of the function call |
| 24656 | */ |
| 24657 | WDI_Status |
| 24658 | WDI_ProcessGTKOffloadGetInfoReq |
| 24659 | ( |
| 24660 | WDI_ControlBlockType* pWDICtx, |
| 24661 | WDI_EventInfoType* pEventData |
| 24662 | ) |
| 24663 | { |
| 24664 | WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg = NULL; |
| 24665 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL; |
| 24666 | wpt_uint8* pSendBuffer = NULL; |
| 24667 | wpt_uint16 usDataOffset = 0; |
| 24668 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24669 | tHalGtkOffloadGetInfoReqParams halGtkOffloadGetInfoReqParams; |
| 24670 | wpt_uint8 ucCurrentSessionId = 0; |
| 24671 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24672 | |
| 24673 | /*------------------------------------------------------------------------- |
| 24674 | Sanity check |
| 24675 | -------------------------------------------------------------------------*/ |
| 24676 | if (( NULL == pEventData ) || |
| 24677 | ( NULL == (pwdiGtkOffloadGetInfoReqMsg = (WDI_GtkOffloadGetInfoReqMsg*)pEventData->pEventData)) || |
| 24678 | ( NULL == (wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pEventData->pCBfnc))) |
| 24679 | { |
| 24680 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24681 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24682 | WDI_ASSERT(0); |
| 24683 | return WDI_STATUS_E_FAILURE; |
| 24684 | } |
| 24685 | |
| 24686 | /*----------------------------------------------------------------------- |
| 24687 | Get message buffer |
| 24688 | -----------------------------------------------------------------------*/ |
| 24689 | 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] | 24690 | sizeof(halGtkOffloadGetInfoReqParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24691 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24692 | ( usSendSize < ( usDataOffset + sizeof(halGtkOffloadGetInfoReqParams))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24693 | { |
| 24694 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24695 | "Unable to get send buffer in WDI_ProcessGTKOffloadGetInfoReq() %x %x %x", |
| 24696 | pEventData, pwdiGtkOffloadGetInfoReqMsg, wdiGtkOffloadGetInfoCb); |
| 24697 | WDI_ASSERT(0); |
| 24698 | return WDI_STATUS_E_FAILURE; |
| 24699 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24700 | ucCurrentSessionId = WDI_FindAssocSession( pWDICtx, |
| 24701 | pwdiGtkOffloadGetInfoReqMsg->WDI_GtkOffloadGetInfoReqParams.bssId, |
| 24702 | &pBSSSes); |
| 24703 | if ( NULL == pBSSSes ) |
| 24704 | { |
| 24705 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24706 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24707 | return WDI_STATUS_E_FAILURE; |
| 24708 | } |
| 24709 | halGtkOffloadGetInfoReqParams.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24710 | |
| 24711 | // |
| 24712 | // Don't need to fill send buffer other than header |
| 24713 | // |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24714 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24715 | &halGtkOffloadGetInfoReqParams, |
| 24716 | sizeof(halGtkOffloadGetInfoReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24717 | |
| 24718 | pWDICtx->wdiReqStatusCB = pwdiGtkOffloadGetInfoReqMsg->wdiReqStatusCB; |
| 24719 | pWDICtx->pReqStatusUserData = pwdiGtkOffloadGetInfoReqMsg->pUserData; |
| 24720 | |
| 24721 | /*------------------------------------------------------------------------- |
| 24722 | Send Get STA Request to HAL |
| 24723 | -------------------------------------------------------------------------*/ |
| 24724 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 24725 | wdiGtkOffloadGetInfoCb, pEventData->pUserData, WDI_GTK_OFFLOAD_GETINFO_RESP); |
| 24726 | } |
| 24727 | |
| 24728 | /** |
| 24729 | @brief Process host offload Rsp function (called when a |
| 24730 | response is being received over the bus from HAL) |
| 24731 | |
| 24732 | @param pWDICtx: pointer to the WLAN DAL context |
| 24733 | pEventData: pointer to the event information structure |
| 24734 | |
| 24735 | @see |
| 24736 | @return Result of the function call |
| 24737 | */ |
| 24738 | WDI_Status |
| 24739 | WDI_ProcessGtkOffloadRsp |
| 24740 | ( |
| 24741 | WDI_ControlBlockType* pWDICtx, |
| 24742 | WDI_EventInfoType* pEventData |
| 24743 | ) |
| 24744 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24745 | eHalStatus halStatus; |
| 24746 | WDI_GtkOffloadCb wdiGtkOffloadCb = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24747 | tHalGtkOffloadRspParams halGtkOffloadRspParams; |
| 24748 | WDI_GtkOffloadRspParams wdiGtkOffloadRsparams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24749 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24750 | |
| 24751 | wdiGtkOffloadCb = (WDI_GtkOffloadCb)pWDICtx->pfncRspCB; |
| 24752 | |
| 24753 | /*------------------------------------------------------------------------- |
| 24754 | Sanity check |
| 24755 | -------------------------------------------------------------------------*/ |
| 24756 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24757 | ( NULL == pEventData->pEventData)) |
| 24758 | { |
| 24759 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24760 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24761 | WDI_ASSERT(0); |
| 24762 | return WDI_STATUS_E_FAILURE; |
| 24763 | } |
| 24764 | |
| 24765 | /*------------------------------------------------------------------------- |
| 24766 | Extract response and send it to UMAC |
| 24767 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24768 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 24769 | { |
| 24770 | wpalMemoryCopy( &halGtkOffloadRspParams, |
| 24771 | pEventData->pEventData, |
| 24772 | sizeof(halGtkOffloadRspParams)); |
| 24773 | |
| 24774 | wdiGtkOffloadRsparams.ulStatus = |
| 24775 | WDI_HAL_2_WDI_STATUS(halGtkOffloadRspParams.status); |
| 24776 | wdiGtkOffloadRsparams.bssIdx = |
| 24777 | halGtkOffloadRspParams.bssIdx; |
| 24778 | } |
| 24779 | else |
| 24780 | { |
| 24781 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24782 | wdiGtkOffloadRsparams.ulStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24783 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24784 | |
| 24785 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24786 | wdiGtkOffloadCb( &wdiGtkOffloadRsparams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24787 | |
| 24788 | return WDI_STATUS_SUCCESS; |
| 24789 | } |
| 24790 | |
| 24791 | /** |
| 24792 | @brief Process GTK Offload Get Information Response function |
| 24793 | |
| 24794 | @param pWDICtx: pointer to the WLAN DAL context |
| 24795 | pEventData: pointer to the event information structure |
| 24796 | |
| 24797 | @see |
| 24798 | @return Result of the function call |
| 24799 | */ |
| 24800 | WDI_Status |
| 24801 | WDI_ProcessGTKOffloadGetInfoRsp |
| 24802 | ( |
| 24803 | WDI_ControlBlockType* pWDICtx, |
| 24804 | WDI_EventInfoType* pEventData |
| 24805 | ) |
| 24806 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24807 | eHalStatus halStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24808 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24809 | tHalGtkOffloadGetInfoRspParams halGtkOffloadGetInfoRspParams; |
| 24810 | WDI_GtkOffloadGetInfoRspParams wdiGtkOffloadGetInfoRsparams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24811 | |
| 24812 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24813 | |
| 24814 | wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pWDICtx->pfncRspCB; |
| 24815 | |
| 24816 | /*------------------------------------------------------------------------- |
| 24817 | Sanity check |
| 24818 | -------------------------------------------------------------------------*/ |
| 24819 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24820 | ( NULL == pEventData->pEventData )) |
| 24821 | { |
| 24822 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24823 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24824 | WDI_ASSERT(0); |
| 24825 | return WDI_STATUS_E_FAILURE; |
| 24826 | } |
| 24827 | |
| 24828 | /*------------------------------------------------------------------------- |
| 24829 | Extract response and send it to UMAC |
| 24830 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24831 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 24832 | { |
| 24833 | wpalMemoryCopy( &halGtkOffloadGetInfoRspParams, |
| 24834 | pEventData->pEventData, |
| 24835 | sizeof(halGtkOffloadGetInfoRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24836 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24837 | wdiGtkOffloadGetInfoRsparams.ulStatus = |
| 24838 | WDI_HAL_2_WDI_STATUS(halGtkOffloadGetInfoRspParams.status); |
| 24839 | wdiGtkOffloadGetInfoRsparams.ullKeyReplayCounter = |
| 24840 | halGtkOffloadGetInfoRspParams.ullKeyReplayCounter; |
| 24841 | wdiGtkOffloadGetInfoRsparams.ulTotalRekeyCount = |
| 24842 | halGtkOffloadGetInfoRspParams.ulTotalRekeyCount; |
| 24843 | wdiGtkOffloadGetInfoRsparams.ulGTKRekeyCount = |
| 24844 | halGtkOffloadGetInfoRspParams.ulGTKRekeyCount; |
| 24845 | wdiGtkOffloadGetInfoRsparams.ulIGTKRekeyCount = |
| 24846 | halGtkOffloadGetInfoRspParams.ulIGTKRekeyCount; |
| 24847 | wdiGtkOffloadGetInfoRsparams.bssIdx = |
| 24848 | halGtkOffloadGetInfoRspParams.bssIdx; |
| 24849 | } |
| 24850 | else |
| 24851 | { |
| 24852 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24853 | wdiGtkOffloadGetInfoRsparams.ulStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24854 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24855 | /*Notify UMAC*/ |
| 24856 | //wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24857 | //wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24858 | wdiGtkOffloadGetInfoCb(&wdiGtkOffloadGetInfoRsparams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24859 | |
| 24860 | return WDI_STATUS_SUCCESS; |
| 24861 | } |
| 24862 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 24863 | |
| 24864 | #ifdef WLAN_WAKEUP_EVENTS |
| 24865 | WDI_Status |
| 24866 | WDI_ProcessWakeReasonInd |
| 24867 | ( |
| 24868 | WDI_ControlBlockType* pWDICtx, |
| 24869 | WDI_EventInfoType* pEventData |
| 24870 | ) |
| 24871 | { |
| 24872 | WDI_LowLevelIndType *pWdiInd; |
| 24873 | tpWakeReasonParams pWakeReasonParams; |
| 24874 | wpt_uint32 allocSize = 0; |
| 24875 | |
| 24876 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24877 | "+%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24878 | |
| 24879 | /*------------------------------------------------------------------------- |
| 24880 | Sanity check |
| 24881 | -------------------------------------------------------------------------*/ |
| 24882 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24883 | ( NULL == pEventData->pEventData )) |
| 24884 | { |
| 24885 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24886 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24887 | WDI_ASSERT( 0 ); |
| 24888 | return WDI_STATUS_E_FAILURE; |
| 24889 | } |
| 24890 | |
| 24891 | /*------------------------------------------------------------------------- |
| 24892 | Extract indication and send it to UMAC |
| 24893 | -------------------------------------------------------------------------*/ |
| 24894 | pWakeReasonParams = (tpWakeReasonParams)(pEventData->pEventData); |
| 24895 | |
| 24896 | allocSize = sizeof(WDI_LowLevelIndType) + (pWakeReasonParams->ulStoredDataLen - 1); |
| 24897 | |
| 24898 | //Allocate memory for WDI_WakeReasonIndType structure |
| 24899 | pWdiInd = wpalMemoryAllocate(allocSize) ; |
| 24900 | |
| 24901 | if(NULL == pWdiInd) |
| 24902 | { |
| 24903 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24904 | "%s: Failed to allocate memory for WDI_WakeReasonIndType: %x %x %x ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24905 | __func__, pWDICtx, pEventData, pEventData->pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24906 | WDI_ASSERT(0); |
| 24907 | return WDI_STATUS_E_FAILURE; |
| 24908 | } |
| 24909 | |
| 24910 | wpalMemoryZero(pWdiInd, allocSize); |
| 24911 | |
| 24912 | /* Fill in the indication parameters*/ |
| 24913 | // Fill wdiInd.wdiIndicationData.wakeReasonInd structure from wakeReasonInd.wakeReasonParams |
| 24914 | pWdiInd->wdiIndicationType = WDI_WAKE_REASON_IND; |
| 24915 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReason = pWakeReasonParams->ulReason; |
| 24916 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg = pWakeReasonParams->ulReasonArg; |
| 24917 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen = pWakeReasonParams->ulStoredDataLen; |
| 24918 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulActualDataLen = pWakeReasonParams->ulActualDataLen; |
| 24919 | wpalMemoryCopy( (void *)&(pWdiInd->wdiIndicationData.wdiWakeReasonInd.aDataStart[0]), |
| 24920 | &(pWakeReasonParams->aDataStart[0]), |
| 24921 | pWakeReasonParams->ulStoredDataLen); |
| 24922 | |
| 24923 | /*Notify UMAC*/ |
| 24924 | pWDICtx->wdiLowLevelIndCB( pWdiInd, pWDICtx->pIndUserData ); |
| 24925 | |
| 24926 | //Free memory allocated for WDI_WakeReasonIndType structure |
| 24927 | wpalMemoryFree(pWdiInd); |
| 24928 | |
| 24929 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24930 | "-%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24931 | |
| 24932 | return WDI_STATUS_SUCCESS; |
| 24933 | } |
| 24934 | #endif // WLAN_WAKEUP_EVENTS |
| 24935 | |
| 24936 | void WDI_GetWcnssCompiledApiVersion |
| 24937 | ( |
| 24938 | WDI_WlanVersionType *pWcnssApiVersion |
| 24939 | ) |
| 24940 | { |
| 24941 | pWcnssApiVersion->major = WLAN_HAL_VER_MAJOR; |
| 24942 | pWcnssApiVersion->minor = WLAN_HAL_VER_MINOR; |
| 24943 | pWcnssApiVersion->version = WLAN_HAL_VER_VERSION; |
| 24944 | pWcnssApiVersion->revision = WLAN_HAL_VER_REVISION; |
| 24945 | } |
| 24946 | |
| 24947 | /** |
| 24948 | @brief Process Set TM Level Rsp function (called when a |
| 24949 | response is being received over the bus from HAL) |
| 24950 | |
| 24951 | @param pWDICtx: pointer to the WLAN DAL context |
| 24952 | pEventData: pointer to the event information structure |
| 24953 | |
| 24954 | @see |
| 24955 | @return Result of the function call |
| 24956 | */ |
| 24957 | WDI_Status |
| 24958 | WDI_ProcessSetTmLevelRsp |
| 24959 | ( |
| 24960 | WDI_ControlBlockType* pWDICtx, |
| 24961 | WDI_EventInfoType* pEventData |
| 24962 | ) |
| 24963 | { |
| 24964 | WDI_Status wdiStatus; |
| 24965 | eHalStatus halStatus; |
| 24966 | WDI_SetTmLevelCb wdiSetTmLevelCb; |
| 24967 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24968 | |
| 24969 | /*------------------------------------------------------------------------- |
| 24970 | Sanity check |
| 24971 | -------------------------------------------------------------------------*/ |
| 24972 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24973 | ( NULL == pEventData->pEventData )) |
| 24974 | { |
| 24975 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24976 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24977 | WDI_ASSERT(0); |
| 24978 | return WDI_STATUS_E_FAILURE; |
| 24979 | } |
| 24980 | |
| 24981 | wdiSetTmLevelCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB; |
| 24982 | |
| 24983 | /*------------------------------------------------------------------------- |
| 24984 | Extract response and send it to UMAC |
| 24985 | -------------------------------------------------------------------------*/ |
| 24986 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24987 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24988 | |
| 24989 | /*Notify UMAC*/ |
| 24990 | wdiSetTmLevelCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24991 | |
| 24992 | return WDI_STATUS_SUCCESS; |
| 24993 | }/*WDI_ProcessSetTmLevelRsp*/ |
| 24994 | |
| 24995 | /** |
| 24996 | @brief Process Set Thermal Mitigation level Changed request |
| 24997 | |
| 24998 | @param pWDICtx: pointer to the WLAN DAL context |
| 24999 | pEventData: pointer to the event information structure |
| 25000 | |
| 25001 | @see |
| 25002 | @return Result of the function call |
| 25003 | */ |
| 25004 | WDI_Status |
| 25005 | WDI_ProcessSetTmLevelReq |
| 25006 | ( |
| 25007 | WDI_ControlBlockType* pWDICtx, |
| 25008 | WDI_EventInfoType* pEventData |
| 25009 | ) |
| 25010 | { |
| 25011 | WDI_SetTmLevelReqType *pwdiSetTmLevelReq = NULL; |
| 25012 | WDI_SetTmLevelCb wdiSetTmLevelCb = NULL; |
| 25013 | wpt_uint8* pSendBuffer = NULL; |
| 25014 | wpt_uint16 usDataOffset = 0; |
| 25015 | wpt_uint16 usSendSize = 0; |
| 25016 | tSetThermalMitgationType halTmMsg; |
| 25017 | |
| 25018 | /*------------------------------------------------------------------------- |
| 25019 | Sanity check |
| 25020 | -------------------------------------------------------------------------*/ |
| 25021 | if (( NULL == pEventData ) || |
| 25022 | ( NULL == (pwdiSetTmLevelReq = (WDI_SetTmLevelReqType*)pEventData->pEventData)) || |
| 25023 | ( NULL == (wdiSetTmLevelCb = (WDI_SetTmLevelCb)pEventData->pCBfnc))) |
| 25024 | { |
| 25025 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25026 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25027 | WDI_ASSERT(0); |
| 25028 | return WDI_STATUS_E_FAILURE; |
| 25029 | } |
| 25030 | |
| 25031 | /*----------------------------------------------------------------------- |
| 25032 | Get message buffer |
| 25033 | -----------------------------------------------------------------------*/ |
| 25034 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TM_LEVEL_REQ, |
| 25035 | sizeof(halTmMsg), |
| 25036 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 25037 | ( usSendSize < (usDataOffset + sizeof(halTmMsg) ))) |
| 25038 | { |
| 25039 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25040 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 25041 | pEventData, pwdiSetTmLevelReq, wdiSetTmLevelCb); |
| 25042 | WDI_ASSERT(0); |
| 25043 | return WDI_STATUS_E_FAILURE; |
| 25044 | } |
| 25045 | |
| 25046 | halTmMsg.thermalMitMode = pwdiSetTmLevelReq->tmMode; |
| 25047 | halTmMsg.thermalMitLevel = pwdiSetTmLevelReq->tmLevel; |
| 25048 | |
| 25049 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 25050 | &halTmMsg, |
| 25051 | sizeof(halTmMsg)); |
| 25052 | |
| 25053 | pWDICtx->pReqStatusUserData = pwdiSetTmLevelReq->pUserData; |
| 25054 | pWDICtx->pfncRspCB = NULL; |
| 25055 | /*------------------------------------------------------------------------- |
| 25056 | Send Get STA Request to HAL |
| 25057 | -------------------------------------------------------------------------*/ |
| 25058 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 25059 | wdiSetTmLevelCb, pEventData->pUserData, WDI_SET_TM_LEVEL_RESP); |
| 25060 | } |
| 25061 | |
| 25062 | /* Fill the value from the global features enabled array to the global capabilities |
| 25063 | * bitmap struct |
| 25064 | */ |
| 25065 | static void |
| 25066 | FillAllFeatureCaps(tWlanFeatCaps *fCaps, placeHolderInCapBitmap *enabledFeat, wpt_int8 len) |
| 25067 | { |
| 25068 | wpt_int8 i; |
| 25069 | for (i=0; i<len; i++) |
| 25070 | { |
| 25071 | setFeatCaps(fCaps, enabledFeat[i]); |
| 25072 | } |
| 25073 | } |
| 25074 | |
| 25075 | /** |
| 25076 | @brief WDI_featureCapsExchangeReq |
| 25077 | Post feature capability bitmap exchange event. |
| 25078 | Host will send its own capability to FW in this req and |
| 25079 | expect FW to send its capability back as a bitmap in Response |
| 25080 | |
| 25081 | @param |
| 25082 | |
| 25083 | wdiFeatureCapsExchangeCb: callback called on getting the response. |
| 25084 | It is kept to mantain similarity between WDI reqs and if needed, can |
| 25085 | be used in future. Currently, It is set to NULL |
| 25086 | |
| 25087 | pUserData: user data will be passed back with the |
| 25088 | callback |
| 25089 | |
| 25090 | @see |
| 25091 | @return Result of the function call |
| 25092 | */ |
| 25093 | WDI_Status |
| 25094 | WDI_featureCapsExchangeReq |
| 25095 | ( |
| 25096 | WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb, |
| 25097 | void* pUserData |
| 25098 | ) |
| 25099 | { |
| 25100 | WDI_EventInfoType wdiEventData; |
| 25101 | wpt_int32 fCapsStructSize; |
| 25102 | |
| 25103 | /*------------------------------------------------------------------------ |
| 25104 | Sanity Check |
| 25105 | ------------------------------------------------------------------------*/ |
| 25106 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 25107 | { |
| 25108 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25109 | "WDI API call before module is initialized - Fail request"); |
| 25110 | |
| 25111 | return WDI_STATUS_E_NOT_ALLOWED; |
| 25112 | } |
| 25113 | |
| 25114 | /* Allocate memory separately for global variable carrying FW caps */ |
| 25115 | fCapsStructSize = sizeof(tWlanFeatCaps); |
| 25116 | gpHostWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize); |
| 25117 | if ( NULL == gpHostWlanFeatCaps ) |
| 25118 | { |
| 25119 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25120 | "Cannot allocate memory for host capability info\n"); |
| 25121 | WDI_ASSERT(0); |
| 25122 | return WDI_STATUS_MEM_FAILURE; |
| 25123 | } |
| 25124 | |
| 25125 | wpalMemoryZero(gpHostWlanFeatCaps, fCapsStructSize); |
| 25126 | |
| 25127 | /*------------------------------------------------------------------------ |
| 25128 | Fill in Event data and post to the Main FSM |
| 25129 | ------------------------------------------------------------------------*/ |
| 25130 | FillAllFeatureCaps(gpHostWlanFeatCaps, supportEnabledFeatures, |
| 25131 | (sizeof(supportEnabledFeatures)/sizeof(supportEnabledFeatures[0]))); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25132 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 25133 | "Host caps %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25134 | gpHostWlanFeatCaps->featCaps[0], |
| 25135 | gpHostWlanFeatCaps->featCaps[1], |
| 25136 | gpHostWlanFeatCaps->featCaps[2], |
| 25137 | gpHostWlanFeatCaps->featCaps[3] |
| 25138 | ); |
| 25139 | |
| 25140 | wdiEventData.wdiRequest = WDI_FEATURE_CAPS_EXCHANGE_REQ; |
| 25141 | wdiEventData.pEventData = gpHostWlanFeatCaps; |
| 25142 | wdiEventData.uEventDataSize = fCapsStructSize; |
| 25143 | wdiEventData.pCBfnc = wdiFeatureCapsExchangeCb; |
| 25144 | wdiEventData.pUserData = pUserData; |
| 25145 | |
| 25146 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 25147 | } |
| 25148 | |
| 25149 | /** |
Yathish | d871319 | 2012-12-10 14:21:35 -0800 | [diff] [blame^] | 25150 | @brief Disable Active mode offload in Host |
| 25151 | |
| 25152 | @param void |
| 25153 | @see |
| 25154 | @return void |
| 25155 | */ |
| 25156 | void |
| 25157 | WDI_disableCapablityFeature(wpt_uint8 feature_index) |
| 25158 | { |
| 25159 | supportEnabledFeatures[feature_index] = 0; |
| 25160 | return; |
| 25161 | } |
| 25162 | |
| 25163 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25164 | @brief Process Host-FW Capability Exchange Request function |
| 25165 | |
| 25166 | @param pWDICtx: pointer to the WLAN DAL context |
| 25167 | pEventData: pointer to the event information structure |
| 25168 | |
| 25169 | @see |
| 25170 | @return Result of the function call |
| 25171 | */ |
| 25172 | WDI_Status |
| 25173 | WDI_ProcessFeatureCapsExchangeReq |
| 25174 | ( |
| 25175 | WDI_ControlBlockType* pWDICtx, |
| 25176 | WDI_EventInfoType* pEventData |
| 25177 | ) |
| 25178 | { |
| 25179 | wpt_uint8* pSendBuffer = NULL; |
| 25180 | wpt_uint16 usDataOffset = 0; |
| 25181 | wpt_uint16 usSendSize = 0; |
| 25182 | wpt_uint16 usLen = 0; |
| 25183 | |
| 25184 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25185 | |
| 25186 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25187 | "%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25188 | |
| 25189 | /*------------------------------------------------------------------------- |
| 25190 | Sanity check |
| 25191 | -------------------------------------------------------------------------*/ |
| 25192 | /* Call back function is NULL since not required for cap exchange req */ |
| 25193 | if (( NULL == pEventData ) || |
| 25194 | ( NULL == (tWlanFeatCaps *)pEventData->pEventData)) |
| 25195 | { |
| 25196 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25197 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25198 | WDI_ASSERT(0); |
| 25199 | return WDI_STATUS_E_FAILURE; |
| 25200 | } |
| 25201 | |
| 25202 | /*----------------------------------------------------------------------- |
| 25203 | Get message buffer |
| 25204 | -----------------------------------------------------------------------*/ |
| 25205 | usLen = sizeof(tWlanFeatCaps); |
| 25206 | |
| 25207 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 25208 | WDI_FEATURE_CAPS_EXCHANGE_REQ, |
| 25209 | usLen, |
| 25210 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 25211 | ( usSendSize < (usDataOffset + usLen ))) |
| 25212 | { |
| 25213 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 25214 | "Unable to get send buffer in feat caps exchange req %x %x", |
| 25215 | pEventData, (tWlanFeatCaps *)pEventData->pEventData); |
| 25216 | WDI_ASSERT(0); |
| 25217 | return WDI_STATUS_E_FAILURE; |
| 25218 | } |
| 25219 | |
| 25220 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25221 | "Host Caps - %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25222 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[0], |
| 25223 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[1], |
| 25224 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[2], |
| 25225 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[3] |
| 25226 | ); |
| 25227 | |
| 25228 | /* Copy host caps after the offset in the send buffer */ |
| 25229 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 25230 | (tWlanFeatCaps *)pEventData->pEventData, |
| 25231 | usLen); |
| 25232 | |
| 25233 | /*------------------------------------------------------------------------- |
| 25234 | Send Start Request to HAL |
| 25235 | -------------------------------------------------------------------------*/ |
| 25236 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 25237 | (WDI_StartRspCb)pEventData->pCBfnc, |
| 25238 | pEventData->pUserData, WDI_FEATURE_CAPS_EXCHANGE_RESP); |
| 25239 | |
| 25240 | }/*WDI_ProcessFeatureCapsExchangeReq*/ |
| 25241 | |
| 25242 | /** |
| 25243 | @brief Process Host-FW Capability Exchange Response function |
| 25244 | |
| 25245 | @param pWDICtx: pointer to the WLAN DAL context |
| 25246 | pEventData: pointer to the event information structure |
| 25247 | |
| 25248 | @see |
| 25249 | @return Result of the function call |
| 25250 | */ |
| 25251 | WDI_Status |
| 25252 | WDI_ProcessFeatureCapsExchangeRsp |
| 25253 | ( |
| 25254 | WDI_ControlBlockType* pWDICtx, |
| 25255 | WDI_EventInfoType* pEventData |
| 25256 | ) |
| 25257 | { |
| 25258 | WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb; |
| 25259 | wpt_int32 fCapsStructSize; |
| 25260 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25261 | |
| 25262 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25263 | "%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25264 | |
| 25265 | /*------------------------------------------------------------------------- |
| 25266 | Sanity check |
| 25267 | -------------------------------------------------------------------------*/ |
| 25268 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25269 | ( NULL == pEventData->pEventData )) |
| 25270 | { |
| 25271 | /* It will go here when riva is old (doesn't understand this msg) and host is new */ |
| 25272 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25273 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25274 | WDI_ASSERT(0); |
| 25275 | return WDI_STATUS_E_FAILURE; |
| 25276 | } |
| 25277 | |
| 25278 | /* Allocate memory separately for global variable carrying FW caps */ |
| 25279 | fCapsStructSize = sizeof(tWlanFeatCaps); |
| 25280 | gpFwWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize); |
| 25281 | if ( NULL == gpFwWlanFeatCaps ) |
| 25282 | { |
| 25283 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25284 | "Cannot allocate memory for host capability info\n"); |
| 25285 | WDI_ASSERT(0); |
| 25286 | return WDI_STATUS_MEM_FAILURE; |
| 25287 | } |
| 25288 | |
| 25289 | /*------------------------------------------------------------------------- |
| 25290 | Unpack HAL Response Message - the header was already extracted by the |
| 25291 | main Response Handling procedure |
| 25292 | -------------------------------------------------------------------------*/ |
| 25293 | /*------------------------------------------------------------------------- |
| 25294 | Extract response and send it to UMAC |
| 25295 | -------------------------------------------------------------------------*/ |
| 25296 | |
| 25297 | wpalMemoryCopy(gpFwWlanFeatCaps,(tWlanFeatCaps *) pEventData -> pEventData, |
| 25298 | fCapsStructSize); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25299 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 25300 | "FW caps %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25301 | gpFwWlanFeatCaps->featCaps[0], |
| 25302 | gpFwWlanFeatCaps->featCaps[1], |
| 25303 | gpFwWlanFeatCaps->featCaps[2], |
| 25304 | gpFwWlanFeatCaps->featCaps[3] |
| 25305 | ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25306 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25307 | wdiFeatureCapsExchangeCb = (WDI_featureCapsExchangeCb) pWDICtx -> pfncRspCB; |
| 25308 | |
| 25309 | /*Notify UMAC - there is no callback right now but can be used in future if reqd */ |
| 25310 | if (wdiFeatureCapsExchangeCb != NULL) |
| 25311 | wdiFeatureCapsExchangeCb(NULL, NULL); |
| 25312 | |
| 25313 | return WDI_STATUS_SUCCESS; |
| 25314 | } |
| 25315 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 25316 | #ifdef WLAN_FEATURE_11AC |
| 25317 | WDI_Status |
| 25318 | WDI_ProcessUpdateVHTOpModeRsp |
| 25319 | ( |
| 25320 | WDI_ControlBlockType* pWDICtx, |
| 25321 | WDI_EventInfoType* pEventData |
| 25322 | ) |
| 25323 | { |
| 25324 | WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL; |
| 25325 | WDI_Status wdiStatus; |
| 25326 | eHalStatus halStatus; |
| 25327 | |
| 25328 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25329 | |
| 25330 | /*------------------------------------------------------------------------- |
| 25331 | Sanity check |
| 25332 | -------------------------------------------------------------------------*/ |
| 25333 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25334 | ( NULL == pEventData->pEventData)) |
| 25335 | { |
| 25336 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25337 | "%s: Invalid parameters", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 25338 | WDI_ASSERT(0); |
| 25339 | return WDI_STATUS_E_FAILURE; |
| 25340 | } |
| 25341 | wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc; |
| 25342 | |
| 25343 | /*------------------------------------------------------------------------- |
| 25344 | Extract response and send it to UMAC |
| 25345 | -------------------------------------------------------------------------*/ |
| 25346 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 25347 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 25348 | |
| 25349 | /*Notify UMAC*/ |
| 25350 | wdiVHTOpModeCb( wdiStatus, pEventData->pUserData); |
| 25351 | |
| 25352 | return WDI_STATUS_SUCCESS; |
| 25353 | } |
| 25354 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25355 | /** |
| 25356 | @brief WDI_getHostWlanFeatCaps |
| 25357 | WDI API that returns whether the feature passed to it as enum value in |
| 25358 | "placeHolderInCapBitmap" is supported by Host or not. It uses WDI global |
| 25359 | variable storing host capability bitmap to find this. This can be used by |
| 25360 | other moduels to decide certain things like call different APIs based on |
| 25361 | whether a particular feature is supported. |
| 25362 | |
| 25363 | @param |
| 25364 | |
| 25365 | feat_enum_value: enum value for the feature as in placeHolderInCapBitmap in wlan_hal_msg.h. |
| 25366 | |
| 25367 | @see |
| 25368 | @return |
| 25369 | 0 - if the feature is NOT supported in host |
| 25370 | any non-zero value - if the feature is SUPPORTED in host. |
| 25371 | */ |
| 25372 | wpt_uint8 WDI_getHostWlanFeatCaps(wpt_uint8 feat_enum_value) |
| 25373 | { |
| 25374 | wpt_uint8 featSupported = 0; |
| 25375 | if (gpHostWlanFeatCaps != NULL) |
| 25376 | { |
| 25377 | getFeatCaps(gpHostWlanFeatCaps, feat_enum_value, featSupported); |
| 25378 | } |
| 25379 | else |
| 25380 | { |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 25381 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 25382 | "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] | 25383 | } |
| 25384 | return featSupported; |
| 25385 | } |
| 25386 | |
| 25387 | /** |
| 25388 | @brief WDI_getFwWlanFeatCaps |
| 25389 | WDI API that returns whether the feature passed to it as enum value in |
| 25390 | "placeHolderInCapBitmap" is supported by FW or not. It uses WDI global |
| 25391 | variable storing host capability bitmap to find this. This can be used by |
| 25392 | other moduels to decide certain things like call different APIs based on |
| 25393 | whether a particular feature is supported. |
| 25394 | |
| 25395 | @param |
| 25396 | |
| 25397 | feat_enum_value: enum value for the feature as in placeHolderInCapBitmap |
| 25398 | in wlan_hal_msg.h. |
| 25399 | |
| 25400 | @see |
| 25401 | @return |
| 25402 | 0 - if the feature is NOT supported in FW |
| 25403 | any non-zero value - if the feature is SUPPORTED in FW. |
| 25404 | */ |
| 25405 | wpt_uint8 WDI_getFwWlanFeatCaps(wpt_uint8 feat_enum_value) |
| 25406 | { |
| 25407 | wpt_uint8 featSupported = 0; |
| 25408 | if (gpFwWlanFeatCaps != NULL) |
| 25409 | { |
| 25410 | getFeatCaps(gpFwWlanFeatCaps, feat_enum_value, featSupported); |
| 25411 | } |
| 25412 | else |
| 25413 | { |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 25414 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 25415 | "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] | 25416 | } |
| 25417 | return featSupported; |
| 25418 | } |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 25419 | |
| 25420 | #ifdef WLAN_FEATURE_11AC |
| 25421 | WDI_Status |
| 25422 | WDI_ProcessUpdateVHTOpModeReq |
| 25423 | ( |
| 25424 | WDI_ControlBlockType* pWDICtx, |
| 25425 | WDI_EventInfoType* pEventData |
| 25426 | ) |
| 25427 | { |
| 25428 | WDI_UpdateVHTOpMode* pwdiVHTOpModeParams = NULL; |
| 25429 | WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL; |
| 25430 | wpt_uint8* pSendBuffer = NULL; |
| 25431 | wpt_uint16 usDataOffset = 0; |
| 25432 | wpt_uint16 usSendSize = 0; |
| 25433 | |
| 25434 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25435 | |
| 25436 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25437 | "%s", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 25438 | |
| 25439 | /*------------------------------------------------------------------------- |
| 25440 | Sanity check |
| 25441 | -------------------------------------------------------------------------*/ |
| 25442 | if (( NULL == pEventData ) || |
| 25443 | ( NULL == (pwdiVHTOpModeParams = (WDI_UpdateVHTOpMode*)pEventData->pEventData)) || |
| 25444 | ( NULL == (wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc))) |
| 25445 | { |
| 25446 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25447 | "%s: Invalid parameters", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 25448 | WDI_ASSERT(0); |
| 25449 | return WDI_STATUS_E_FAILURE; |
| 25450 | } |
| 25451 | |
| 25452 | /*----------------------------------------------------------------------- |
| 25453 | Get message buffer |
| 25454 | -----------------------------------------------------------------------*/ |
| 25455 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_VHT_OP_MODE_REQ, |
| 25456 | sizeof(WDI_UpdateVHTOpMode), |
| 25457 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 25458 | ( usSendSize < (usDataOffset + sizeof(WDI_UpdateVHTOpMode) ))) |
| 25459 | { |
| 25460 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25461 | "Unable to get send buffer in update vht opMode req"); |
| 25462 | WDI_ASSERT(0); |
| 25463 | return WDI_STATUS_E_FAILURE; |
| 25464 | } |
| 25465 | |
| 25466 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25467 | "pwdiVHTOpModeParams->opMode=%d, pwdiVHTOpModeParams->staId=%d\n", pwdiVHTOpModeParams->opMode, pwdiVHTOpModeParams->staId); |
| 25468 | |
| 25469 | wpalMemoryCopy( pSendBuffer+usDataOffset, pwdiVHTOpModeParams, |
| 25470 | sizeof(WDI_UpdateVHTOpMode)); |
| 25471 | |
| 25472 | /*------------------------------------------------------------------------- |
| 25473 | Send Start Request to HAL |
| 25474 | -------------------------------------------------------------------------*/ |
| 25475 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 25476 | wdiVHTOpModeCb, |
| 25477 | pEventData->pUserData, WDI_UPDATE_VHT_OP_MODE_RESP); |
| 25478 | |
| 25479 | } |
| 25480 | |
| 25481 | WDI_Status |
| 25482 | WDI_UpdateVHTOpModeReq |
| 25483 | ( |
| 25484 | WDI_UpdateVHTOpMode *pData, |
| 25485 | WDI_UpdateVHTOpModeCb wdiUpdateVHTOpModeCb, |
| 25486 | void* pUserData |
| 25487 | ) |
| 25488 | { |
| 25489 | WDI_EventInfoType wdiEventData; |
| 25490 | |
| 25491 | /*------------------------------------------------------------------------ |
| 25492 | Sanity Check |
| 25493 | ------------------------------------------------------------------------*/ |
| 25494 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 25495 | { |
| 25496 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25497 | "WDI API call before module is initialized - Fail request"); |
| 25498 | |
| 25499 | return WDI_STATUS_E_NOT_ALLOWED; |
| 25500 | } |
| 25501 | |
| 25502 | /*------------------------------------------------------------------------ |
| 25503 | Fill in Event data and post to the Main FSM |
| 25504 | ------------------------------------------------------------------------*/ |
| 25505 | wdiEventData.wdiRequest = WDI_UPDATE_VHT_OP_MODE_REQ; |
| 25506 | wdiEventData.pEventData = pData; |
| 25507 | wdiEventData.uEventDataSize = sizeof(WDI_UpdateVHTOpMode); |
| 25508 | wdiEventData.pCBfnc = wdiUpdateVHTOpModeCb; |
| 25509 | wdiEventData.pUserData = pUserData; |
| 25510 | |
| 25511 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25512 | "pData->opMode=%d, pData->staId=%d\n", pData->opMode, pData->staId); |
| 25513 | |
| 25514 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 25515 | |
| 25516 | } |
| 25517 | #endif |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 25518 | |
| 25519 | /** |
| 25520 | @brief WDI_TransportChannelDebug - |
| 25521 | Display DXE Channel debugging information |
| 25522 | User may request to display DXE channel snapshot |
| 25523 | Or if host driver detects any abnormal stcuk may display |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 25524 | |
Jeff Johnson | bf9616f | 2012-12-10 13:34:59 -0800 | [diff] [blame] | 25525 | @param displaySnapshot : Display DXE snapshot option |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 25526 | @param enableStallDetect : Enable stall detect feature |
| 25527 | This feature will take effect to data performance |
| 25528 | Not integrate till fully verification |
| 25529 | @see |
| 25530 | @return none |
| 25531 | */ |
| 25532 | void WDI_TransportChannelDebug |
| 25533 | ( |
| 25534 | wpt_boolean displaySnapshot, |
Madan Mohan Koyyalamudi | 24a00f9 | 2012-10-22 15:21:02 -0700 | [diff] [blame] | 25535 | wpt_boolean toggleStallDetect |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 25536 | ) |
| 25537 | { |
Madan Mohan Koyyalamudi | 24a00f9 | 2012-10-22 15:21:02 -0700 | [diff] [blame] | 25538 | WDTS_ChannelDebug(displaySnapshot, toggleStallDetect); |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 25539 | return; |
Madan Mohan Koyyalamudi | 3352adb | 2012-09-28 14:57:24 -0700 | [diff] [blame] | 25540 | } |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 25541 | /** |
| 25542 | @brief WDI_SsrTimerCB |
| 25543 | Callback function for SSR timer, if this is called then the graceful |
| 25544 | shutdown for Riva did not happen. |
| 25545 | |
| 25546 | @param pUserData : user data to timer |
| 25547 | |
| 25548 | @see |
| 25549 | @return none |
| 25550 | */ |
| 25551 | void |
| 25552 | WDI_SsrTimerCB |
| 25553 | ( |
| 25554 | void *pUserData |
| 25555 | ) |
| 25556 | { |
| 25557 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData; |
| 25558 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25559 | |
| 25560 | if (NULL == pWDICtx ) |
| 25561 | { |
| 25562 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25563 | "%s: Invalid parameters", __func__); |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 25564 | WDI_ASSERT(0); |
| 25565 | return; |
| 25566 | } |
| 25567 | wpalRivaSubystemRestart(); |
| 25568 | |
| 25569 | return; |
| 25570 | |
| 25571 | }/*WDI_SsrTimerCB*/ |