qcacld-3.0: Add INI item to control BPF feature configuration

Add INI item to control BPF feature configuration.

Change-Id: Ia110916f5d657db6970f988dab5c3be55074c3bf
CRs-Fixed: 1055033
This commit is contained in:
Rajeev Kumar
2016-08-16 14:21:05 -07:00
committed by qcabuildsw
parent ea4eb0b037
commit dd3bc6012f
4 changed files with 25 additions and 2 deletions

View File

@@ -2828,6 +2828,15 @@ typedef enum {
#define CFG_ACTIVE_MODE_OFFLOAD_DEFAULT (0) #define CFG_ACTIVE_MODE_OFFLOAD_DEFAULT (0)
#endif #endif
/*
* 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)
/* /*
* 0: disable the cck tx chain mask (default) * 0: disable the cck tx chain mask (default)
* 1: enable the cck tx chain mask * 1: enable the cck tx chain mask
@@ -4044,6 +4053,7 @@ struct hdd_config {
bool tso_enable; bool tso_enable;
bool lro_enable; bool lro_enable;
bool active_mode_offload; bool active_mode_offload;
bool bpf_packet_filter_enable;
uint32_t fine_time_meas_cap; uint32_t fine_time_meas_cap;
uint8_t max_scan_count; uint8_t max_scan_count;
#ifdef WLAN_FEATURE_FASTPATH #ifdef WLAN_FEATURE_FASTPATH

View File

@@ -3525,6 +3525,13 @@ REG_TABLE_ENTRY g_registry_table[] = {
CFG_LRO_ENABLED_MIN, CFG_LRO_ENABLED_MIN,
CFG_LRO_ENABLED_MAX), CFG_LRO_ENABLED_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),
REG_VARIABLE(CFG_ACTIVE_MODE_OFFLOAD, WLAN_PARAM_Integer, REG_VARIABLE(CFG_ACTIVE_MODE_OFFLOAD, WLAN_PARAM_Integer,
struct hdd_config, active_mode_offload, struct hdd_config, active_mode_offload,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -5668,6 +5675,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
hdd_info("Name = [%s] Value = [%s]", hdd_info("Name = [%s] Value = [%s]",
CFG_RM_CAPABILITY_NAME, CFG_RM_CAPABILITY_NAME,
pHddCtx->config->rm_capability); pHddCtx->config->rm_capability);
hdd_info("Name = [%s] Value = [%d]",
CFG_BPF_PACKET_FILTER_OFFLOAD,
pHddCtx->config->bpf_packet_filter_enable);
} }

View File

@@ -6191,7 +6191,7 @@ __wlan_hdd_cfg80211_bpf_offload(struct wiphy *wiphy,
} }
if (!hdd_ctx->bpf_enabled) { if (!hdd_ctx->bpf_enabled) {
hdd_err("BPF offload is not supported by firmware"); hdd_err("BPF offload is not supported/enabled");
return -ENOTSUPP; return -ENOTSUPP;
} }

View File

@@ -1492,7 +1492,10 @@ void hdd_update_tgt_cfg(void *context, void *param)
hdd_info("Init current antenna mode: %d", hdd_info("Init current antenna mode: %d",
hdd_ctx->current_antenna_mode); hdd_ctx->current_antenna_mode);
hdd_ctx->bpf_enabled = cfg->bpf_enabled; hdd_info("Target BPF %d Host BPF %d",
cfg->bpf_enabled, hdd_ctx->config->bpf_packet_filter_enable);
hdd_ctx->bpf_enabled = (cfg->bpf_enabled &&
hdd_ctx->config->bpf_packet_filter_enable);
/* Configure NAN datapath features */ /* Configure NAN datapath features */
hdd_nan_datapath_target_config(hdd_ctx, cfg); hdd_nan_datapath_target_config(hdd_ctx, cfg);
} }