summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrishna Kumaar Natarajan <kknatara@qca.qualcomm.com>2014-08-29 12:35:19 -0700
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-09-08 18:27:47 -0700
commit776bd3e270a0740904df3bc5e54625538ce2b666 (patch)
treea608f931a1e553326df72d8b7913ea4b4b6ad3be
parentc7d208116bf3bb3ec2ca377afee2e86c2d638295 (diff)
qcacld: Updating Probe response template using WMI command
Currently Host sends only beacon template and FW uses the same template for Probe response as well. FW interface is already available for updating the probe response. This commit makes use of the WMI_PRB_TMPL_CMDID and updates the probe response template in the FW. Change-Id: Ibcd9952e73d36acac2a07ecc476a646926fd7129 CRs-Fixed: 715662
-rw-r--r--CORE/MAC/src/include/sirParams.h2
-rw-r--r--CORE/MAC/src/pe/sch/schApi.c3
-rw-r--r--CORE/MAC/src/pe/sch/schBeaconGen.c6
-rw-r--r--CORE/SERVICES/WMA/wma.c111
-rw-r--r--CORE/SYS/legacy/src/utils/src/macTrace.c2
-rw-r--r--CORE/WDA/inc/wlan_qct_wda.h2
6 files changed, 117 insertions, 9 deletions
diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h
index a5ea8654ad03..084e1cdb24d7 100644
--- a/CORE/MAC/src/include/sirParams.h
+++ b/CORE/MAC/src/include/sirParams.h
@@ -383,7 +383,7 @@ typedef struct sSirMbMsgP2p
#define SIR_HAL_BTC_SET_CFG (SIR_HAL_ITC_MSG_TYPES_BEGIN + 138)
#define SIR_HAL_SIGNAL_BT_EVENT (SIR_HAL_ITC_MSG_TYPES_BEGIN + 139)
#define SIR_HAL_HANDLE_FW_MBOX_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 140)
-#define SIR_HAL_UPDATE_PROBE_RSP_TEMPLATE_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 141)
+#define SIR_HAL_SEND_PROBE_RSP_TMPL (SIR_HAL_ITC_MSG_TYPES_BEGIN + 141)
/* PE <-> HAL addr2 mismatch message */
#define SIR_LIM_ADDR2_MISS_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 142)
diff --git a/CORE/MAC/src/pe/sch/schApi.c b/CORE/MAC/src/pe/sch/schApi.c
index b05c952b9547..88f8b862884f 100644
--- a/CORE/MAC/src/pe/sch/schApi.c
+++ b/CORE/MAC/src/pe/sch/schApi.c
@@ -349,7 +349,6 @@ tSirRetStatus schSendBeaconReq( tpAniSirGlobal pMac, tANI_U8 *beaconPayload, tAN
FL("Successfully posted WDA_SEND_BEACON_REQ to HAL"));
if( (psessionEntry->limSystemRole == eLIM_AP_ROLE )
- && (psessionEntry->proxyProbeRspEn)
&& (pMac->sch.schObject.fBeaconChanged))
{
if(eSIR_SUCCESS != (retCode = limSendProbeRspTemplateToHal(pMac,psessionEntry,
@@ -489,7 +488,7 @@ tANI_U32 limSendProbeRspTemplateToHal(tpAniSirGlobal pMac,tpPESession psessionEn
pprobeRespParams->pProbeRespTemplate = pFrame2Hal;
pprobeRespParams->probeRespTemplateLen = nBytes;
vos_mem_copy(pprobeRespParams->ucProxyProbeReqValidIEBmap,IeBitmap,(sizeof(tANI_U32) * 8));
- msgQ.type = WDA_UPDATE_PROBE_RSP_TEMPLATE_IND;
+ msgQ.type = WDA_SEND_PROBE_RSP_TMPL;
msgQ.reserved = 0;
msgQ.bodyptr = pprobeRespParams;
msgQ.bodyval = 0;
diff --git a/CORE/MAC/src/pe/sch/schBeaconGen.c b/CORE/MAC/src/pe/sch/schBeaconGen.c
index e87d7f6b257f..70365e7a6316 100644
--- a/CORE/MAC/src/pe/sch/schBeaconGen.c
+++ b/CORE/MAC/src/pe/sch/schBeaconGen.c
@@ -266,8 +266,7 @@ tSirRetStatus schSetFixedBeaconFields(tpAniSirGlobal pMac,tpPESession psessionEn
offset = sizeof( tAniBeaconStruct );
ptr = psessionEntry->pSchBeaconFrameBegin + offset;
- if((psessionEntry->limSystemRole == eLIM_AP_ROLE)
- && (psessionEntry->proxyProbeRspEn))
+ if((psessionEntry->limSystemRole == eLIM_AP_ROLE))
{
/* Initialize the default IE bitmap to zero */
vos_mem_set(( tANI_U8* )&(psessionEntry->DefProbeRspIeBitmap), (sizeof( tANI_U32 ) * 8), 0);
@@ -428,8 +427,7 @@ tSirRetStatus schSetFixedBeaconFields(tpAniSirGlobal pMac,tpPESession psessionEn
}
}
- if((psessionEntry->limSystemRole == eLIM_AP_ROLE)
- && (psessionEntry->proxyProbeRspEn))
+ if((psessionEntry->limSystemRole == eLIM_AP_ROLE))
{
/* Can be efficiently updated whenever new IE added in Probe response in future */
limUpdateProbeRspTemplateIeBitmapBeacon2(pMac,pBcn2,&psessionEntry->DefProbeRspIeBitmap[0],
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c
index c22c203ff386..4d3d72453750 100644
--- a/CORE/SERVICES/WMA/wma.c
+++ b/CORE/SERVICES/WMA/wma.c
@@ -14612,6 +14612,77 @@ fail:
return VOS_STATUS_E_FAILURE;
}
+static int wmi_unified_probe_rsp_tmpl_send(tp_wma_handle wma,
+ u_int8_t vdev_id,
+ tpSendProbeRespParams probe_rsp_info)
+{
+ wmi_prb_tmpl_cmd_fixed_param *cmd;
+ wmi_bcn_prb_info *bcn_prb_info;
+ wmi_buf_t wmi_buf;
+ u_int32_t tmpl_len, tmpl_len_aligned, wmi_buf_len;
+ u_int8_t *frm, *buf_ptr;
+ int ret;
+ u_int64_t adjusted_tsf_le;
+ struct ieee80211_frame *wh;
+
+ WMA_LOGD(FL("Send probe response template for vdev %d"), vdev_id);
+
+ frm = probe_rsp_info->pProbeRespTemplate;
+ tmpl_len = probe_rsp_info->probeRespTemplateLen;
+ tmpl_len_aligned = roundup(tmpl_len, sizeof(A_UINT32));
+ /*
+ * Make the TSF offset negative so probe response in the same
+ * staggered batch have the same TSF.
+ */
+ adjusted_tsf_le = cpu_to_le64(0ULL -
+ wma->interfaces[vdev_id].tsfadjust);
+ /* Update the timstamp in the probe response buffer with adjusted TSF */
+ wh = (struct ieee80211_frame *)frm;
+ A_MEMCPY(&wh[1], &adjusted_tsf_le, sizeof(adjusted_tsf_le));
+
+ wmi_buf_len = sizeof(wmi_prb_tmpl_cmd_fixed_param) +
+ sizeof(wmi_bcn_prb_info) + WMI_TLV_HDR_SIZE +
+ tmpl_len_aligned;
+
+ wmi_buf = wmi_buf_alloc(wma->wmi_handle, wmi_buf_len);
+ if (!wmi_buf) {
+ WMA_LOGE(FL("wmi_buf_alloc failed"));
+ return -ENOMEM;
+ }
+
+ buf_ptr = (u_int8_t *) wmi_buf_data(wmi_buf);
+
+ cmd = (wmi_prb_tmpl_cmd_fixed_param *)buf_ptr;
+ WMITLV_SET_HDR(&cmd->tlv_header,
+ WMITLV_TAG_STRUC_wmi_prb_tmpl_cmd_fixed_param,
+ WMITLV_GET_STRUCT_TLVLEN(wmi_prb_tmpl_cmd_fixed_param));
+ cmd->vdev_id = vdev_id;
+ cmd->buf_len = tmpl_len;
+ buf_ptr += sizeof(wmi_prb_tmpl_cmd_fixed_param);
+
+ bcn_prb_info = (wmi_bcn_prb_info *)buf_ptr;
+ WMITLV_SET_HDR(&bcn_prb_info->tlv_header,
+ WMITLV_TAG_STRUC_wmi_bcn_prb_info,
+ WMITLV_GET_STRUCT_TLVLEN(wmi_bcn_prb_info));
+ bcn_prb_info->caps = 0;
+ bcn_prb_info->erp = 0;
+ buf_ptr += sizeof(wmi_bcn_prb_info);
+
+ WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE, tmpl_len_aligned);
+ buf_ptr += WMI_TLV_HDR_SIZE;
+ vos_mem_copy(buf_ptr, frm, tmpl_len);
+
+ ret = wmi_unified_cmd_send(wma->wmi_handle,
+ wmi_buf, wmi_buf_len,
+ WMI_PRB_TMPL_CMDID);
+ if (ret) {
+ WMA_LOGE(FL("Failed to send PRB RSP tmpl: %d"), ret);
+ wmi_buf_free(wmi_buf);
+ }
+
+ return ret;
+}
+
static int wmi_unified_bcn_tmpl_send(tp_wma_handle wma,
u_int8_t vdev_id,
tpSendbeaconParams bcn_info,
@@ -14940,6 +15011,41 @@ static int wma_p2p_go_set_beacon_ie(t_wma_handle *wma_handle,
return ret;
}
+static void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
+ tpSendProbeRespParams probe_rsp_info)
+{
+ ol_txrx_vdev_handle vdev;
+ u_int8_t vdev_id;
+ tpAniProbeRspStruct probe_rsp;
+
+ if(!probe_rsp_info) {
+ WMA_LOGE(FL("probe_rsp_info is NULL"));
+ return;
+ }
+
+ probe_rsp = (tpAniProbeRspStruct)(probe_rsp_info->pProbeRespTemplate);
+ if(!probe_rsp) {
+ WMA_LOGE(FL("probe_rsp is NULL"));
+ return;
+ }
+
+ vdev = wma_find_vdev_by_addr(wma, probe_rsp->macHdr.sa, &vdev_id);
+ if (!vdev) {
+ WMA_LOGE(FL("failed to get vdev handle"));
+ return;
+ }
+
+ if (WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap,
+ WMI_SERVICE_BEACON_OFFLOAD)) {
+ WMA_LOGA("Beacon Offload Enabled Sending Unified command");
+ if (wmi_unified_probe_rsp_tmpl_send(wma, vdev_id,
+ probe_rsp_info) < 0){
+ WMA_LOGE(FL("wmi_unified_probe_rsp_tmpl_send Failed "));
+ return;
+ }
+ }
+}
+
static void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info)
{
ol_txrx_vdev_handle vdev;
@@ -21631,6 +21737,11 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg)
(tpSendbeaconParams)msg->bodyptr);
vos_mem_free(msg->bodyptr);
break;
+ case WDA_SEND_PROBE_RSP_TMPL:
+ wma_send_probe_rsp_tmpl(wma_handle,
+ (tpSendProbeRespParams)msg->bodyptr);
+ vos_mem_free(msg->bodyptr);
+ break;
case WDA_CLI_SET_CMD:
wma_process_cli_set_cmd(wma_handle,
(wda_cli_set_cmd_t *)msg->bodyptr);
diff --git a/CORE/SYS/legacy/src/utils/src/macTrace.c b/CORE/SYS/legacy/src/utils/src/macTrace.c
index 323106db780d..53a942e7b6cd 100644
--- a/CORE/SYS/legacy/src/utils/src/macTrace.c
+++ b/CORE/SYS/legacy/src/utils/src/macTrace.c
@@ -709,7 +709,7 @@ tANI_U8* macTraceGetWdaMsgString( tANI_U16 wdaMsg )
CASE_RETURN_STRING(WDA_BTC_SET_CFG);
CASE_RETURN_STRING(WDA_SIGNAL_BT_EVENT);
CASE_RETURN_STRING(WDA_HANDLE_FW_MBOX_RSP);
- CASE_RETURN_STRING(WDA_UPDATE_PROBE_RSP_TEMPLATE_IND);
+ CASE_RETURN_STRING(WDA_SEND_PROBE_RSP_TMPL);
CASE_RETURN_STRING(WDA_SIGNAL_BTAMP_EVENT);
#ifdef FEATURE_OEM_DATA_SUPPORT
CASE_RETURN_STRING(WDA_START_OEM_DATA_REQ );
diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h
index 9fca6c40d1e8..5c107078ea3d 100644
--- a/CORE/WDA/inc/wlan_qct_wda.h
+++ b/CORE/WDA/inc/wlan_qct_wda.h
@@ -602,6 +602,7 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb);
#define WDA_FINISH_SCAN_RSP SIR_HAL_FINISH_SCAN_RSP
#define WDA_SEND_BEACON_REQ SIR_HAL_SEND_BEACON_REQ
#define WDA_SEND_BEACON_RSP SIR_HAL_SEND_BEACON_RSP
+#define WDA_SEND_PROBE_RSP_TMPL SIR_HAL_SEND_PROBE_RSP_TMPL
#define WDA_INIT_CFG_REQ SIR_HAL_INIT_CFG_REQ
#define WDA_INIT_CFG_RSP SIR_HAL_INIT_CFG_RSP
@@ -749,7 +750,6 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb);
#define WDA_BTC_SET_CFG SIR_HAL_BTC_SET_CFG
#define WDA_SIGNAL_BT_EVENT SIR_HAL_SIGNAL_BT_EVENT
#define WDA_HANDLE_FW_MBOX_RSP SIR_HAL_HANDLE_FW_MBOX_RSP
-#define WDA_UPDATE_PROBE_RSP_TEMPLATE_IND SIR_HAL_UPDATE_PROBE_RSP_TEMPLATE_IND
#define WDA_SIGNAL_BTAMP_EVENT SIR_HAL_SIGNAL_BTAMP_EVENT
#ifdef FEATURE_OEM_DATA_SUPPORT