From eb60ce0e80a0b64044980f8b5dbe1efd6812ee0c Mon Sep 17 00:00:00 2001 From: Gurumoorthi Gnanasambandhan Date: Tue, 7 Feb 2017 15:25:18 +0530 Subject: [PATCH] qcacmn: Enabling WPS for Hawkeye Scan params are not properly set when wps ie is added in probe req scan command fails. Fixing scan wmi command when additional wps ie is added. Change-Id: Ide40a248f32c6220dd7510a65dde7c3894e45da6 --- wmi_unified_tlv.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/wmi_unified_tlv.c b/wmi_unified_tlv.c index 4e4a29e0c1..310f3f081b 100644 --- a/wmi_unified_tlv.c +++ b/wmi_unified_tlv.c @@ -1877,6 +1877,25 @@ static inline void copy_scan_notify_ev_flags( cmd->scan_ctrl_flags |= WMI_SCAN_OFFCHAN_DATA_TX; } #endif + + +/* scan_copy_ie_buffer() - Copy scan ie_data */ +#ifndef CONFIG_MCL +static inline void scan_copy_ie_buffer(uint8_t *buf_ptr, + struct scan_start_params *params) +{ + qdf_mem_copy(buf_ptr, params->ie_data, params->ie_len); +} +#else +static inline void scan_copy_ie_buffer(uint8_t *buf_ptr, + struct scan_start_params *params) +{ + qdf_mem_copy(buf_ptr, + (uint8_t *) params->ie_base + + (params->uie_fieldOffset), params->ie_len); +} +#endif + /** * send_scan_start_cmd_tlv() - WMI scan start function * @param wmi_handle : handle to WMI. @@ -1996,13 +2015,12 @@ static QDF_STATUS send_scan_start_cmd_tlv(wmi_unified_t wmi_handle, #endif buf_ptr += WMI_TLV_HDR_SIZE + (params->num_bssid * sizeof(wmi_mac_addr)); - WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE, params->ie_len_with_pad); + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE, + roundup(params->ie_len, sizeof(uint32_t))); if (params->ie_len) { - qdf_mem_copy(buf_ptr + WMI_TLV_HDR_SIZE, - (uint8_t *) params->ie_base + - (params->uie_fieldOffset), params->ie_len); + scan_copy_ie_buffer(buf_ptr + WMI_TLV_HDR_SIZE, params); } - buf_ptr += WMI_TLV_HDR_SIZE + params->ie_len_with_pad; + buf_ptr += WMI_TLV_HDR_SIZE + roundup(params->ie_len, sizeof(uint32_t)); ret = wmi_unified_cmd_send(wmi_handle, wmi_buf, len, WMI_START_SCAN_CMDID);