summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnurag Chouhan <achouhan@codeaurora.org>2016-09-08 15:32:52 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-09-10 19:06:41 -0700
commit04dbf6de4d4808691ecad548ea7e81a04f280245 (patch)
treeeae3bfff04bb9e739543d633205a153dd1cccee0
parentc40929266ce5f8d165b4b316ebe63abd80db1df4 (diff)
qcacld-3.0: Disable RA filter when BPF is enabled
qcacld-2.0 to qcacld-3.0 propagation. In current implementation, RA filter is enabled irrespective of the BPF filter status. This change checks if BPF configuration in ini as well as in target config is enabled, then RA will be disabled. Change-Id: I85df0828af665d2bcc13c865b0ba40ebf882fffe CRs-Fixed: 1058884 (cherry picked from commit 8dda6e83eb85ef9f0342ab23954e093c6dfebe2e)
-rw-r--r--core/cds/inc/cds_config.h2
-rw-r--r--core/hdd/src/wlan_hdd_main.c22
-rw-r--r--core/wma/inc/wma.h2
-rw-r--r--core/wma/inc/wma_tgt_cfg.h4
-rw-r--r--core/wma/src/wma_main.c48
5 files changed, 75 insertions, 3 deletions
diff --git a/core/cds/inc/cds_config.h b/core/cds/inc/cds_config.h
index 4bcb4854cab5..e479eadb8c5f 100644
--- a/core/cds/inc/cds_config.h
+++ b/core/cds/inc/cds_config.h
@@ -91,6 +91,7 @@ enum cfg_sub_20_channel_width {
* @tx_flow_start_queue_offset: Start queue offset in percentage
* @is_lpass_enabled: Indicate whether LPASS is enabled or not
* @is_nan_enabled: Indicate whether NAN is enabled or not
+ * @bool bpf_packet_filter_enable; Indicate bpf filter enabled or not
* @tx_chain_mask_cck: Tx chain mask enabled or not
* @self_gen_frm_pwr: Self gen from power
* @sub_20_channel_width: Sub 20 MHz ch width, ini intersected with fw cap
@@ -140,6 +141,7 @@ struct cds_config_info {
#ifdef WLAN_FEATURE_NAN
bool is_nan_enabled;
#endif
+ bool bpf_packet_filter_enable;
bool tx_chain_mask_cck;
uint16_t self_gen_frm_pwr;
enum cfg_sub_20_channel_width sub_20_channel_width;
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 3e2f4d5aae4e..d246ec631bdd 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -1358,6 +1358,27 @@ static int hdd_generate_macaddr_auto(hdd_context_t *hdd_ctx)
return 0;
}
+/**
+ * hdd_update_ra_rate_limit() - Update RA rate limit from target
+ * configuration to cfg_ini in HDD
+ * @hdd_ctx: Pointer to hdd_ctx
+ * @cfg: target configuration
+ *
+ * Return: None
+ */
+#ifdef FEATURE_WLAN_RA_FILTERING
+static void hdd_update_ra_rate_limit(hdd_context_t *hdd_ctx,
+ struct wma_tgt_cfg *cfg)
+{
+ hdd_ctx->config->IsRArateLimitEnabled = cfg->is_ra_rate_limit_enabled;
+}
+#else
+static void hdd_update_ra_rate_limit(hdd_context_t *hdd_ctx,
+ struct wma_tgt_cfg *cfg)
+{
+}
+#endif
+
void hdd_update_tgt_cfg(void *context, void *param)
{
hdd_context_t *hdd_ctx = (hdd_context_t *) context;
@@ -1456,6 +1477,7 @@ void hdd_update_tgt_cfg(void *context, void *param)
cfg->bpf_enabled, hdd_ctx->config->bpf_packet_filter_enable);
hdd_ctx->bpf_enabled = (cfg->bpf_enabled &&
hdd_ctx->config->bpf_packet_filter_enable);
+ hdd_update_ra_rate_limit(hdd_ctx, cfg);
/*
* If BPF is enabled, maxWowFilters set to WMA_STA_WOW_DEFAULT_PTRN_MAX
diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h
index f8d796401fea..92deee79076e 100644
--- a/core/wma/inc/wma.h
+++ b/core/wma/inc/wma.h
@@ -1275,6 +1275,7 @@ struct extended_caps {
* It contains global wma module parameters and
* handle of other modules.
* @saved_wmi_init_cmd: Saved WMI INIT command
+ * @bool bpf_packet_filter_enable: BPF filter enabled or not
* @service_ready_ext_evt: Wait event for service ready ext
* @wmi_cmd_rsp_wake_lock: wmi command response wake lock
* @wmi_cmd_rsp_runtime_lock: wmi command response bus lock
@@ -1470,6 +1471,7 @@ typedef struct {
qdf_runtime_lock_t wma_runtime_resume_lock;
uint32_t fine_time_measurement_cap;
bool bpf_enabled;
+ bool bpf_packet_filter_enable;
struct wma_ini_config ini_config;
struct wma_valid_channels saved_chan;
/* NAN datapath support enabled in firmware */
diff --git a/core/wma/inc/wma_tgt_cfg.h b/core/wma/inc/wma_tgt_cfg.h
index 000b492b142d..047f4c46e109 100644
--- a/core/wma/inc/wma_tgt_cfg.h
+++ b/core/wma/inc/wma_tgt_cfg.h
@@ -149,6 +149,7 @@ struct wma_dfs_radar_ind {
* @lpss_support: lpass support
* @egap_support: enhanced green ap support
* @nan_datapath_enabled: nan data path support
+ * @bool is_ra_rate_limit_enabled: RA filter support
*/
struct wma_tgt_cfg {
uint32_t target_fw_version;
@@ -169,6 +170,9 @@ struct wma_tgt_cfg {
#endif
uint32_t fine_time_measurement_cap;
bool bpf_enabled;
+#ifdef FEATURE_WLAN_RA_FILTERING
+ bool is_ra_rate_limit_enabled;
+#endif
#ifdef WLAN_FEATURE_NAN_DATAPATH
bool nan_datapath_enabled;
#endif
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index ee018bde2d36..f60f0a545754 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -1824,6 +1824,8 @@ QDF_STATUS wma_open(void *cds_context,
wma_handle->driver_type = cds_cfg->driver_type;
wma_handle->ssdp = cds_cfg->ssdp;
wma_handle->enable_mc_list = cds_cfg->enable_mc_list;
+ wma_handle->bpf_packet_filter_enable =
+ cds_cfg->bpf_packet_filter_enable;
#ifdef FEATURE_WLAN_RA_FILTERING
wma_handle->IsRArateLimitEnabled = cds_cfg->is_ra_ratelimit_enabled;
wma_handle->RArateLimitInterval = cds_cfg->ra_ratelimit_interval;
@@ -3908,6 +3910,26 @@ static void wma_update_target_ext_vht_cap(t_wma_handle *wma_handle,
}
/**
+ * wma_update_ra_rate_limit() - update wma config
+ * @wma_handle: wma handle
+ * @cfg: target config
+ *
+ * Return: none
+ */
+#ifdef FEATURE_WLAN_RA_FILTERING
+static void wma_update_ra_rate_limit(tp_wma_handle wma_handle,
+ struct wma_tgt_cfg *cfg)
+{
+ cfg->is_ra_rate_limit_enabled = wma_handle->IsRArateLimitEnabled;
+}
+#else
+static void wma_update_ra_rate_limit(tp_wma_handle wma_handle,
+ struct wma_tgt_cfg *cfg)
+{
+}
+#endif
+
+/**
* wma_update_hdd_cfg() - update HDD config
* @wma_handle: wma handle
*
@@ -3961,6 +3983,7 @@ static void wma_update_hdd_cfg(tp_wma_handle wma_handle)
#endif /* WLAN_FEATURE_LPSS */
tgt_cfg.ap_arpns_support = wma_handle->ap_arpns_support;
tgt_cfg.bpf_enabled = wma_handle->bpf_enabled;
+ wma_update_ra_rate_limit(wma_handle, &tgt_cfg);
tgt_cfg.fine_time_measurement_cap =
wma_handle->fine_time_measurement_cap;
wma_setup_egap_support(&tgt_cfg, wma_handle);
@@ -4150,6 +4173,25 @@ done:
}
/**
+ * wma_update_ra_limit() - update ra limit based on bpf filter
+ * enabled or not
+ * @handle: wma handle
+ *
+ * Return: none
+ */
+#ifdef FEATURE_WLAN_RA_FILTERING
+static void wma_update_ra_limit(tp_wma_handle wma_handle)
+{
+ if (wma_handle->bpf_enabled)
+ wma_handle->IsRArateLimitEnabled = false;
+}
+#else
+static void wma_update_ra__limit(tp_wma_handle handle)
+{
+}
+#endif
+
+/**
* wma_rx_service_ready_event() - event handler to process
* wmi rx sevice ready event.
* @handle: wma handle
@@ -4280,10 +4322,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 =
+ wma_handle->bpf_enabled = (wma_handle->bpf_packet_filter_enable &&
WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
- WMI_SERVICE_BPF_OFFLOAD);
-
+ WMI_SERVICE_BPF_OFFLOAD));
+ wma_update_ra_limit(wma_handle);
if (WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
WMI_SERVICE_CSA_OFFLOAD)) {
WMA_LOGD("%s: FW support CSA offload capability", __func__);