diff options
| author | Anurag Chouhan <achouhan@codeaurora.org> | 2016-09-13 18:53:33 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-09-24 20:28:25 -0700 |
| commit | 9efbe5efd84f71a074f6bec985dbd4bcd1110b0c (patch) | |
| tree | 337388a89e88aa111f2448743eb625bf12f25d6a | |
| parent | 9e6d7678056d298e8d647349ec8fc70683cd1bfc (diff) | |
qcacld-2.0: Add INI item to control BPF feature configuration
qcacld-3.0 to qcacld-2.0 propogation
Add INI item to control BPF feature configuration.
Change-Id: Ia110916f5d657db6970f988dab5c3be55074c3bf
CRs-Fixed: 1055033
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg.h | 11 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 11 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 2 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_main.c | 6 |
4 files changed, 28 insertions, 2 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index a9671d2cfddc..c88e5d2d49cc 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -3995,6 +3995,15 @@ enum dot11p_mode { #define CFG_SIFS_BURST_DURATION_MAX (12) #define CFG_SIFS_BURST_DURATION_DEFAULT (8) +/* + * 0: Disable BPF packet filter + * 1: Enable BPF packet filter + */ +#define CFG_BPF_PACKET_FILTER_OFFLOAD "gBpfFilterEnable" +#define CFG_BPF_PACKET_FILTER_OFFLOAD_MIN (0) +#define CFG_BPF_PACKET_FILTER_OFFLOAD_MAX (1) +#define CFG_BPF_PACKET_FILTER_OFFLOAD_DEFAULT (1) + /*--------------------------------------------------------------------------- Type declarations -------------------------------------------------------------------------*/ @@ -4778,6 +4787,8 @@ struct hdd_config { bool active_mode_offload; /* parameter for indicating sifs burst duration to fw */ uint8_t sifs_burst_duration; + + bool bpf_packet_filter_enable; }; typedef struct hdd_config hdd_config_t; diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index 7cf165cf4bb5..fb21ce63f290 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -4681,6 +4681,13 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_SIFS_BURST_DURATION_DEFAULT, CFG_SIFS_BURST_DURATION_MIN, CFG_SIFS_BURST_DURATION_MAX), + + REG_VARIABLE(CFG_BPF_PACKET_FILTER_OFFLOAD, WLAN_PARAM_Integer, + struct hdd_config, bpf_packet_filter_enable, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_BPF_PACKET_FILTER_OFFLOAD_DEFAULT, + CFG_BPF_PACKET_FILTER_OFFLOAD_MIN, + CFG_BPF_PACKET_FILTER_OFFLOAD_MAX), }; @@ -5528,6 +5535,10 @@ void print_hdd_cfg(hdd_context_t *pHddCtx) CFG_ACTIVE_MODE_OFFLOAD, pHddCtx->cfg_ini->active_mode_offload); + hddLog(LOG2, "Name = [%s] Value = [%u]", + CFG_BPF_PACKET_FILTER_OFFLOAD, + pHddCtx->cfg_ini->bpf_packet_filter_enable); + hdd_ndp_print_ini_config(pHddCtx); } diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 4cf9ee10b3cf..b7653c0c4fbb 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -10442,7 +10442,7 @@ __wlan_hdd_cfg80211_bpf_offload(struct wiphy *wiphy, } if (!hdd_ctx->bpf_enabled) { - hddLog(LOGE, FL("BPF offload is not supported by firmware")); + hddLog(LOGE, FL("BPF offload is not supported/enabled")); return -ENOTSUPP; } diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 88cf90113154..08f0d4978c45 100644 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -8840,7 +8840,11 @@ void hdd_update_tgt_cfg(void *context, void *param) hdd_ctx->fine_time_meas_cap_target = cfg->fine_time_measurement_cap; hddLog(LOG1, FL("fine_time_measurement_cap: 0x%x"), hdd_ctx->cfg_ini->fine_time_meas_cap); - hdd_ctx->bpf_enabled = cfg->bpf_enabled; + + hddLog(LOG1, FL("Target BPF %d Host BPF %d"), + cfg->bpf_enabled, hdd_ctx->cfg_ini->bpf_packet_filter_enable); + hdd_ctx->bpf_enabled = (cfg->bpf_enabled && + hdd_ctx->cfg_ini->bpf_packet_filter_enable); /* * If BPF is enabled, maxWowFilters set to WMA_STA_WOW_DEFAULT_PTRN_MAX |
