diff options
| author | Chandrasekaran, Manishekar <cmshekar@qti.qualcomm.com> | 2015-01-21 20:40:17 +0530 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2015-01-23 16:44:06 +0530 |
| commit | 20085c61d23ee3eb028d3cc48a4b96b30fb6f5e2 (patch) | |
| tree | f63fbdeff905713c62bc1d39d475868e4578138b | |
| parent | 80f96b5b4b36b9f74dcf0b750665393bfe240d3d (diff) | |
qcacld: Fix rest time to 400ms for normal scan during miracast
If miracast is running concurrently with STA interface and
if they are on MCC, the rest time set to 400ms to provide
better video quality on the P2P link.
Change-Id: I07ecc94e3abcf81eafc3e2a007bb83d83812b1d9
CRs-Fixed: 775989
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 72 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.h | 3 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiScan.c | 5 |
3 files changed, 74 insertions, 6 deletions
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 2fffeb458dba..73d3543be4a0 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -183,6 +183,9 @@ #define LINK_SUPPORT_MIMO 0x8 #define LINK_RATE_VHT 0x3 + +#define WMA_MCC_MIRACAST_REST_TIME 400 + /* Data rate 100KBPS based on IE Index */ struct index_data_rate_type { @@ -6790,6 +6793,39 @@ v_BOOL_t wma_is_STA_active(tp_wma_handle wma_handle) return FALSE; } +/** + * wma_is_mcc_24G() - Function to check MCC in 2.4GHz band + * @handle: WMA handle + * + * This function is used to check MCC in 2.4GHz band + * + * Return: True if WMA is in MCC in 2.4GHz band + * + */ +static bool wma_is_mcc_24G(WMA_HANDLE handle) +{ + tp_wma_handle wma_handle = (tp_wma_handle) handle; + int32_t prev_chan = 0; + int32_t i; + + if (NULL == wma_handle) { + WMA_LOGE("%s: wma_handle is NULL", __func__); + return false; + } + for (i = 0; i < wma_handle->max_bssid; i++) { + if (wma_handle->interfaces[i].handle && + wma_handle->interfaces[i].conn_state) { + if ((prev_chan != 0 && + prev_chan != wma_handle->interfaces[i].mhz) && + (wma_handle->interfaces[i].mhz <= + VOS_CHAN_14_FREQ)) + return true; + else + prev_chan = wma_handle->interfaces[i].mhz; + } + } + return false; +} /* function : wma_get_buf_start_scan_cmd * Description : @@ -6961,13 +6997,17 @@ VOS_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, cmd->burst_duration = 0; break; } + if (wma_handle->miracast_value && + wma_is_mcc_24G(wma_handle)) { + cmd->max_rest_time = WMA_MCC_MIRACAST_REST_TIME; + } if (wma_is_P2P_GO_active(wma_handle)) { /* Background scan while GO is sending beacons. * Every off-channel transition has overhead of 2 beacon * intervals for NOA. Maximize number of channels in * every transition by using burst scan. */ - if (IS_MIRACAST_SESSION_PRESENT(pMac)) { + if (wma_handle->miracast_value) { /* When miracast is running, burst duration * needs to be minimum to avoid any stutter * or glitch in miracast during station scan @@ -7032,7 +7072,7 @@ VOS_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, * than the dwell time in normal scenarios. */ if (scan_req->channelList.numChannels == P2P_SOCIAL_CHANNELS - && (!IS_MIRACAST_SESSION_PRESENT(pMac))) + && (!(wma_handle->miracast_value))) cmd->repeat_probe_time = scan_req->maxChannelTime/5; else cmd->repeat_probe_time = scan_req->maxChannelTime/3; @@ -23154,6 +23194,29 @@ VOS_STATUS wma_process_set_mas(tp_wma_handle wma, return VOS_STATUS_SUCCESS; } +/** + * wma_process_set_miracast() - Function to set miracast value in WMA + * @wma: Pointer to WMA handle + * @miracast_val: 0-Disabled,1-Source,2-Sink + * + * This function stores the miracast value in WMA + * + * Return: VOS_STATUS_SUCCESS for success otherwise failure + * + */ +VOS_STATUS wma_process_set_miracast(tp_wma_handle wma, u_int32_t *miracast_val) +{ + if (NULL == wma || NULL == miracast_val) { + WMA_LOGE("%s: Invalid input to store miracast value", __func__); + return VOS_STATUS_E_FAILURE; + } + + wma->miracast_value = *miracast_val; + WMA_LOGE("%s: Miracast value is %d", __func__, wma->miracast_value); + + return VOS_STATUS_SUCCESS; +} + /* * function : wma_mc_process_msg * Description : @@ -23848,6 +23911,11 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg) (u_int32_t *)msg->bodyptr); vos_mem_free(msg->bodyptr); break; + case SIR_HAL_SET_MIRACAST: + wma_process_set_miracast(wma_handle, + (u_int32_t *)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 */ diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h index 5bc1a0ba0bb6..0d5ac43c302c 100644 --- a/CORE/SERVICES/WMA/wma.h +++ b/CORE/SERVICES/WMA/wma.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -755,6 +755,7 @@ typedef struct { /* OCB Set Schedule Response */ ocb_set_sched_callback_t ocb_callback; sir_ocb_set_sched_response_t *ocb_resp; + uint32_t miracast_value; }t_wma_handle, *tp_wma_handle; struct wma_target_cap { diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c index d779140442ba..42f2558f603c 100644 --- a/CORE/SME/src/csr/csrApiScan.c +++ b/CORE/SME/src/csr/csrApiScan.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -691,8 +691,7 @@ eHalStatus csrScanRequest(tpAniSirGlobal pMac, tANI_U16 sessionId, /* Increase dwell time in case P2P Search and Miracast is not present*/ if(pScanRequest->p2pSearch && pScanRequest->ChannelInfo.numOfChannels == P2P_SOCIAL_CHANNELS - && (!IS_MIRACAST_SESSION_PRESENT(pMac))) - { + && (!(pMac->sme.miracast_value))) { pScanRequest->maxChnTime += P2P_SEARCH_DWELL_TIME_INCREASE; } |
