summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajeev Kumar <rajekuma@qca.qualcomm.com>2014-06-05 15:08:46 -0700
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-06-09 17:46:23 -0700
commit46343110153c1feff2a85ef3f73a226256c3f8fc (patch)
tree6c155948d20c221cddfd81d13e48cafb804a3f41
parent87451bf977324393d1c14d346a9d519dd9880acb (diff)
qcacld: Serialize roam pre auth events to MC thread
Serialize roam pre auth events to MC thread Change-Id: Ib57dffe4a72d77a72d37f3be790e4ebaf1ec570c CRs-Fixed: 672587
-rw-r--r--CORE/MAC/src/include/sirParams.h2
-rw-r--r--CORE/SERVICES/WMA/wma.c86
-rw-r--r--CORE/WDA/inc/wlan_qct_wda.h2
3 files changed, 70 insertions, 20 deletions
diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h
index 388d51f8c10c..5200c0d1c8a5 100644
--- a/CORE/MAC/src/include/sirParams.h
+++ b/CORE/MAC/src/include/sirParams.h
@@ -681,6 +681,8 @@ typedef struct sSirMbMsgP2p
#define SIR_HAL_VDEV_START_RSP_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 262)
#define SIR_HAL_GET_LINK_SPEED (SIR_HAL_ITC_MSG_TYPES_BEGIN + 263)
+#define SIR_HAL_ROAM_PREAUTH_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 264)
+
#define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF)
// CFG message types
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c
index c921aec07d24..fe60a7e925d2 100644
--- a/CORE/SERVICES/WMA/wma.c
+++ b/CORE/SERVICES/WMA/wma.c
@@ -4962,9 +4962,11 @@ VOS_STATUS wma_start_scan(tp_wma_handle wma_handle,
goto error;
}
- if (msg_type == WDA_CHNL_SWITCH_REQ) {
- wma_handle->roam_preauth_scan_id = cmd->scan_id;
- }
+ if (msg_type == WDA_CHNL_SWITCH_REQ) {
+ adf_os_spin_lock_bh(&wma_handle->roam_preauth_lock);
+ wma_handle->roam_preauth_scan_id = cmd->scan_id;
+ adf_os_spin_unlock_bh(&wma_handle->roam_preauth_lock);
+ }
WMA_LOGI("WMA --> WMI_START_SCAN_CMDID");
@@ -6837,6 +6839,9 @@ void wma_vdev_resp_timer(void *data)
WMA_LOGA("%s: WDA_SWITCH_CHANNEL_REQ timedout", __func__);
wma_send_msg(wma, WDA_SWITCH_CHANNEL_RSP, (void *)params, 0);
wma->roam_preauth_chan_context = NULL;
+ adf_os_spin_lock_bh(&wma->roam_preauth_lock);
+ wma->roam_preauth_scan_id = -1;
+ adf_os_spin_unlock_bh(&wma->roam_preauth_lock);
} else if (tgt_req->msg_type == WDA_DELETE_BSS_REQ) {
tpDeleteBssParams params =
(tpDeleteBssParams)tgt_req->user_data;
@@ -7040,15 +7045,12 @@ VOS_STATUS wma_roam_preauth_chan_set(tp_wma_handle wma_handle,
WMA_LOGI("%s: channel %d", __func__, params->channelNumber);
/* Check for prior operation in progress */
- adf_os_spin_lock_bh(&wma_handle->roam_preauth_lock);
if (wma_handle->roam_preauth_chan_context != NULL) {
- adf_os_spin_unlock_bh(&wma_handle->roam_preauth_lock);
vos_status = VOS_STATUS_E_FAILURE;
WMA_LOGE("%s: Rejected request. Previous operation in progress", __func__);
goto send_resp;
}
wma_handle->roam_preauth_chan_context = params;
- adf_os_spin_unlock_bh(&wma_handle->roam_preauth_lock);
/* Prepare a dummy scan request and get the
* wmi_start_scan_cmd_fixed_param structure filled properly
@@ -7077,9 +7079,7 @@ VOS_STATUS wma_roam_preauth_chan_set(tp_wma_handle wma_handle,
return vos_status;
wma_handle->roam_preauth_scan_state = WMA_ROAM_PREAUTH_CHAN_NONE;
/* Failed operation. Safely clear context */
- adf_os_spin_lock_bh(&wma_handle->roam_preauth_lock);
wma_handle->roam_preauth_chan_context = NULL;
- adf_os_spin_unlock_bh(&wma_handle->roam_preauth_lock);
send_resp:
WMA_LOGI("%s: sending WDA_SWITCH_CHANNEL_RSP, status = 0x%x",
@@ -7099,15 +7099,12 @@ VOS_STATUS wma_roam_preauth_chan_cancel(tp_wma_handle wma_handle,
WMA_LOGI("%s: channel %d", __func__, params->channelNumber);
/* Check for prior operation in progress */
- adf_os_spin_lock_bh(&wma_handle->roam_preauth_lock);
if (wma_handle->roam_preauth_chan_context != NULL) {
- adf_os_spin_unlock_bh(&wma_handle->roam_preauth_lock);
vos_status = VOS_STATUS_E_FAILURE;
WMA_LOGE("%s: Rejected request. Previous operation in progress", __func__);
goto send_resp;
}
wma_handle->roam_preauth_chan_context = params;
- adf_os_spin_unlock_bh(&wma_handle->roam_preauth_lock);
abort_scan_req.SessionId = vdev_id;
wma_handle->roam_preauth_scan_state = WMA_ROAM_PREAUTH_CHAN_CANCEL_REQUESTED;
@@ -7115,9 +7112,7 @@ VOS_STATUS wma_roam_preauth_chan_cancel(tp_wma_handle wma_handle,
if (vos_status == VOS_STATUS_SUCCESS)
return vos_status;
/* Failed operation. Safely clear context */
- adf_os_spin_lock_bh(&wma_handle->roam_preauth_lock);
wma_handle->roam_preauth_chan_context = NULL;
- adf_os_spin_unlock_bh(&wma_handle->roam_preauth_lock);
send_resp:
WMA_LOGI("%s: sending WDA_SWITCH_CHANNEL_RSP, status = 0x%x",
@@ -7178,13 +7173,32 @@ static void wma_roam_preauth_scan_event_handler(tp_wma_handle wma_handle,
params->smpsMode = SMPS_MODE_DISABLED;
params->status = vos_status;
wma_send_msg(wma_handle, WDA_SWITCH_CHANNEL_RSP, (void *)params, 0);
- adf_os_spin_lock_bh(&wma_handle->roam_preauth_lock);
wma_handle->roam_preauth_chan_context = NULL;
- adf_os_spin_unlock_bh(&wma_handle->roam_preauth_lock);
}
}
+void wma_roam_preauth_ind(tp_wma_handle wma_handle, u_int8_t *buf) {
+ wmi_scan_event_fixed_param *wmi_event = NULL;
+ u_int8_t vdev_id;
+
+ wmi_event = (wmi_scan_event_fixed_param *)buf;
+ if (wmi_event == NULL) {
+ WMA_LOGE("%s: Invalid param wmi_event is null", __func__);
+ return;
+ }
+
+ vdev_id = wmi_event->vdev_id;
+ if (vdev_id >= wma_handle->max_bssid) {
+ WMA_LOGE("%s: Invalid vdev_id %d wmi_event %p", __func__,
+ vdev_id, wmi_event);
+ return;
+ }
+
+ wma_roam_preauth_scan_event_handler(wma_handle, vdev_id, wmi_event);
+ return;
+}
+
/*
* wma_set_channel
* If this request is called when station is connected, it should use
@@ -17119,6 +17133,11 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg)
vos_mem_free(msg->bodyptr);
break;
+ case WDA_ROAM_PREAUTH_IND:
+ wma_roam_preauth_ind(wma_handle, msg->bodyptr);
+ vos_mem_free(msg->bodyptr);
+ break;
+
default:
WMA_LOGD("unknow msg type %x", msg->type);
/* Do Nothing? MSG Body should be freed at here */
@@ -17140,6 +17159,8 @@ static int wma_scan_event_callback(WMA_HANDLE handle, u_int8_t *data,
tSirScanOffloadEvent *scan_event;
u_int8_t vdev_id;
v_U32_t scan_id;
+ u_int8_t *buf;
+ vos_msg_t vos_msg = {0};
VOS_STATUS vos_status = VOS_STATUS_SUCCESS;
param_buf = (WMI_SCAN_EVENTID_param_tlvs *) data;
@@ -17147,8 +17168,10 @@ static int wma_scan_event_callback(WMA_HANDLE handle, u_int8_t *data,
vdev_id = wmi_event->vdev_id;
scan_id = wma_handle->interfaces[vdev_id].scan_info.scan_id;
- if (wma_handle->roam_preauth_scan_id == wmi_event->scan_id) {
- /* This is the scan requested by roam preauth set_channel operation */
+ adf_os_spin_lock_bh(&wma_handle->roam_preauth_lock);
+ if (wma_handle->roam_preauth_scan_id == wmi_event->scan_id) {
+ /* This is the scan requested by roam preauth set_channel operation */
+ adf_os_spin_unlock_bh(&wma_handle->roam_preauth_lock);
if (wmi_event->event == WMI_SCAN_EVENT_COMPLETED) {
WMA_LOGE(" roam scan complete - scan_id %x, vdev_id %x",
@@ -17156,9 +17179,32 @@ static int wma_scan_event_callback(WMA_HANDLE handle, u_int8_t *data,
wma_reset_scan_info(wma_handle, vdev_id);
}
- wma_roam_preauth_scan_event_handler(wma_handle, vdev_id, wmi_event);
- return 0;
- }
+ buf = vos_mem_malloc(sizeof(wmi_scan_event_fixed_param));
+ if (!buf) {
+ WMA_LOGE("%s: Memory alloc failed for roam preauth ind",
+ __func__);
+ return -ENOMEM;
+ }
+ vos_mem_zero(buf, sizeof(wmi_scan_event_fixed_param));
+ vos_mem_copy(buf, (u_int8_t *)wmi_event,
+ sizeof(wmi_scan_event_fixed_param));
+
+ vos_msg.type = WDA_ROAM_PREAUTH_IND;
+ vos_msg.bodyptr = buf;
+ vos_msg.bodyval = 0;
+
+ if (VOS_STATUS_SUCCESS !=
+ vos_mq_post_message(VOS_MQ_ID_WDA, &vos_msg)) {
+ WMA_LOGE("%s: Failed to post WDA_ROAM_PREAUTH_IND msg",
+ __func__);
+ vos_mem_free(buf);
+ return -1;
+ }
+ WMA_LOGD("%s: WDA_ROAM_PREAUTH_IND posted", __func__);
+ return 0;
+ }
+ adf_os_spin_unlock_bh(&wma_handle->roam_preauth_lock);
+
scan_event = (tSirScanOffloadEvent *) vos_mem_malloc
(sizeof(tSirScanOffloadEvent));
if (!scan_event) {
diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h
index 8030023408bd..3c8726bea64f 100644
--- a/CORE/WDA/inc/wlan_qct_wda.h
+++ b/CORE/WDA/inc/wlan_qct_wda.h
@@ -1350,6 +1350,8 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb);
#define WDA_VDEV_START_RSP_IND SIR_HAL_VDEV_START_RSP_IND
+#define WDA_ROAM_PREAUTH_IND SIR_HAL_ROAM_PREAUTH_IND
+
tSirRetStatus wdaPostCtrlMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg);
#define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 // Bit 6 will be used to control BD rate for Management frames