diff options
| author | Srinivas Girigowda <sgirigow@qca.qualcomm.com> | 2015-08-14 10:29:35 -0700 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2015-08-17 15:44:18 +0530 |
| commit | 221b60b9b28732cbd7edcda0b0639388c9ae1306 (patch) | |
| tree | 77a618c698bcec424a6ffb5f15f9cd99c4603446 | |
| parent | 1bc890051ce724fa655c404a7fada9e840961529 (diff) | |
qcacld-2.0: Serialize wma_extscan_operations_event_handler
If the WMI events are received back to back, then there are
chances where we are missing processing of this event.
Hence serialize wma_extscan_operations_event_handler through MC thread.
Change-Id: I81f37a9adf157e98705deef6f5ad0ac87142c842
CRs-Fixed: 890801
| -rw-r--r-- | CORE/MAC/src/include/sirParams.h | 1 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 97 | ||||
| -rw-r--r-- | CORE/WDA/inc/wlan_qct_wda.h | 1 |
3 files changed, 80 insertions, 19 deletions
diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h index db814397d494..12320ea7e2cb 100644 --- a/CORE/MAC/src/include/sirParams.h +++ b/CORE/MAC/src/include/sirParams.h @@ -724,6 +724,7 @@ typedef struct sSirMbMsgP2p #define SIR_HAL_BAD_PEER_TX_CTL_INI_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 332) #define SIR_HAL_SET_RSSI_MONITOR_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 333) #define SIR_HAL_SET_PDEV_IE_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 334) +#define SIR_HAL_EXTSCAN_OPERATION_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 335) #define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF) diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index c31ade60db7f..e1cb4a5e27e7 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -2857,31 +2857,35 @@ static int wma_extscan_start_stop_event_handler(void *handle, return 0; } - -static int wma_extscan_operations_event_handler(void *handle, - u_int8_t *cmd_param_info, u_int32_t len) +/** + * wma_extscan_operations_ind_handler() - extscan operations handler + * @wma: WMA global handle + * @buf: command event data + * + * This function extracts the event data, fill in appropriate structures + * and invoke upper layer callback. + * + * Return: 0 on success, error number otherwise + */ +static int wma_extscan_operations_ind_handler(tp_wma_handle wma, uint8_t *buf) { - tp_wma_handle wma = (tp_wma_handle)handle; - WMI_EXTSCAN_OPERATION_EVENTID_param_tlvs *param_buf; - wmi_extscan_operation_event_fixed_param *oprn_event; + wmi_extscan_operation_event_fixed_param *event; tSirExtScanOnScanEventIndParams *oprn_ind; - tpAniSirGlobal pMac = (tpAniSirGlobal)vos_get_context( + tpAniSirGlobal mac_ctx = (tpAniSirGlobal)vos_get_context( VOS_MODULE_ID_PE, wma->vos_context); - if (!pMac) { - WMA_LOGE("%s: Invalid pMac", __func__); + if (!mac_ctx) { + WMA_LOGE("%s: Invalid mac_ctx", __func__); return -EINVAL; } - if (!pMac->sme.pExtScanIndCb) { + if (!mac_ctx->sme.pExtScanIndCb) { WMA_LOGE("%s: Callback not registered", __func__); return -EINVAL; } - param_buf = (WMI_EXTSCAN_OPERATION_EVENTID_param_tlvs *) - cmd_param_info; - if (!param_buf) { - WMA_LOGE("%s: Invalid scan operation event", __func__); + if (!buf) { + WMA_LOGE("%s: Invalid event buffer", __func__); return -EINVAL; } - oprn_event = param_buf->fixed_param; + event = (wmi_extscan_operation_event_fixed_param *)buf; oprn_ind = vos_mem_malloc(sizeof(*oprn_ind)); if (!oprn_ind) { WMA_LOGE("%s: extscan memory allocation failed", __func__); @@ -2889,9 +2893,9 @@ static int wma_extscan_operations_event_handler(void *handle, return -EINVAL; } - oprn_ind->requestId = oprn_event->request_id; + oprn_ind->requestId = event->request_id; - switch (oprn_event->event) { + switch (event->event) { case WMI_EXTSCAN_BUCKET_COMPLETED_EVENT: oprn_ind->scanEventType = WIFI_SCAN_COMPLETE; oprn_ind->status = 0; @@ -2913,11 +2917,11 @@ static int wma_extscan_operations_event_handler(void *handle, goto exit_handler; default: WMA_LOGE("%s: Unknown event %d from target", - __func__, oprn_event->event); + __func__, event->event); vos_mem_free(oprn_ind); return -EINVAL; } - pMac->sme.pExtScanIndCb(pMac->hHdd, + mac_ctx->sme.pExtScanIndCb(mac_ctx->hHdd, eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND, oprn_ind); WMA_LOGD("%s: sending scan progress event to hdd", __func__); @@ -2927,6 +2931,56 @@ exit_handler: return 0; } +/** + * wma_extscan_operations_event_handler() - extscan operations event handler + * @handle: WMA global handle + * @cmd_param_info: command event data + * @len: Length of @cmd_param_info + * + * Return: 0 on success, error number otherwise + */ +static int wma_extscan_operations_event_handler(void *handle, + uint8_t *cmd_param_info, uint32_t len) +{ + WMI_EXTSCAN_OPERATION_EVENTID_param_tlvs *param_buf; + wmi_extscan_operation_event_fixed_param *event, *buf; + int buf_len = sizeof(*event); + vos_msg_t vos_msg = {0}; + + WMA_LOGI("%s: Enter", __func__); + param_buf = (WMI_EXTSCAN_OPERATION_EVENTID_param_tlvs *) + cmd_param_info; + if (!param_buf) { + WMA_LOGE("%s: Invalid extscan event", __func__); + return -EINVAL; + } + + event = param_buf->fixed_param; + buf = vos_mem_malloc(buf_len); + if (!buf) { + WMA_LOGE("%s: extscan memory allocation failed", __func__); + return -ENOMEM; + } + + *buf = *event; + + vos_msg.type = WDA_EXTSCAN_OPERATION_IND; + vos_msg.bodyptr = buf; + vos_msg.bodyval = 0; + + if (VOS_STATUS_SUCCESS != + vos_mq_post_message(VOS_MQ_ID_WDA, &vos_msg)) { + WMA_LOGP("%s: Failed to post WDA_EXTSCAN_OPERATION_IND msg", + __func__); + vos_mem_free(buf); + return -EINVAL; + } + WMA_LOGI("WDA_EXTSCAN_OPERATION_IND posted"); + + return 0; +} + + static int wma_extscan_table_usage_event_handler (void *handle, u_int8_t *cmd_param_info, u_int32_t len) { @@ -26311,6 +26365,11 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg) wma_extscan_rsp_handler(wma_handle, msg->bodyptr); vos_mem_free(msg->bodyptr); break; + case WDA_EXTSCAN_OPERATION_IND: + wma_extscan_operations_ind_handler(wma_handle, + msg->bodyptr); + vos_mem_free(msg->bodyptr); + break; #endif case WDA_SET_SCAN_MAC_OUI_REQ: wma_scan_probe_setoui(wma_handle, msg->bodyptr); diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h index 250271960ee0..9498d2e1ceba 100644 --- a/CORE/WDA/inc/wlan_qct_wda.h +++ b/CORE/WDA/inc/wlan_qct_wda.h @@ -983,6 +983,7 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); #define WDA_RESET_PASSPOINT_LIST_REQ SIR_HAL_RESET_PASSPOINT_LIST_REQ #define WDA_EXTSCAN_SET_SSID_HOTLIST_REQ SIR_HAL_EXTSCAN_SET_SSID_HOTLIST_REQ #define WDA_EXTSCAN_STATUS_IND SIR_HAL_EXTSCAN_STATUS_IND +#define WDA_EXTSCAN_OPERATION_IND SIR_HAL_EXTSCAN_OPERATION_IND #endif /* FEATURE_WLAN_EXTSCAN */ |
