Browse Source

qcacld-3.0: memset bpf load to zero, update the bpf enabled correctly

Propagation from qcacld-2.0 to qcacld-3.0

- Current length of bpf is not set during the reset filter. set offload
  is allocated through malloc, so invalid values for current_length
  are recieved during reset. Memset set_bpfload to zero after
  allocation.
- update the bpf service to hdd correctly depending on the
  wmi service bitmap recieved from the firmware.

Change-Id: Iaf4774865cf0698a2deebac5cea62c873146e838
CRs-Fixed: 985562
Rajeev Kumar 9 years ago
parent
commit
e5a1682c3e
3 changed files with 7 additions and 1 deletions
  1. 1 1
      core/sme/src/common/sme_api.c
  2. 1 0
      core/wma/inc/wma.h
  3. 5 0
      core/wma/src/wma_main.c

+ 1 - 1
core/sme/src/common/sme_api.c

@@ -15750,8 +15750,8 @@ QDF_STATUS sme_set_bpf_instructions(tHalHandle hal,
 	set_offload->filter_id = req->filter_id;
 	set_offload->current_offset = req->current_offset;
 	set_offload->total_length = req->total_length;
+	set_offload->current_length = req->current_length;
 	if (set_offload->total_length) {
-		set_offload->current_length = req->current_length;
 		set_offload->program = qdf_mem_malloc(sizeof(uint8_t) *
 						req->current_length);
 		qdf_mem_copy(set_offload->program, req->program,

+ 1 - 0
core/wma/inc/wma.h

@@ -1430,6 +1430,7 @@ typedef struct {
 	qdf_runtime_lock_t wmi_cmd_rsp_runtime_lock;
 	qdf_runtime_lock_t wma_runtime_resume_lock;
 	uint32_t fine_time_measurement_cap;
+	bool bpf_enabled;
 	struct wma_ini_config ini_config;
 	struct wma_valid_channels saved_chan;
 	/* NAN datapath support enabled in firmware */

+ 5 - 0
core/wma/src/wma_main.c

@@ -3967,6 +3967,7 @@ static void wma_update_hdd_cfg(tp_wma_handle wma_handle)
 	tgt_cfg.lpss_support = wma_handle->lpss_support;
 #endif /* WLAN_FEATURE_LPSS */
 	tgt_cfg.ap_arpns_support = wma_handle->ap_arpns_support;
+	tgt_cfg.bpf_enabled = wma_handle->bpf_enabled;
 	tgt_cfg.fine_time_measurement_cap =
 		wma_handle->fine_time_measurement_cap;
 	wma_setup_egap_support(&tgt_cfg, wma_handle);
@@ -4286,6 +4287,10 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info,
 		WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
 				WMI_SERVICE_AP_ARPNS_OFFLOAD);
 
+	wma_handle->bpf_enabled =
+		WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
+				WMI_SERVICE_BPF_OFFLOAD);
+
 	if (WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
 				   WMI_SERVICE_CSA_OFFLOAD)) {
 		WMA_LOGD("%s: FW support CSA offload capability", __func__);