浏览代码

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
Rajeev Kumar 8 年之前
父节点
当前提交
dd3bc6012f
共有 4 个文件被更改,包括 25 次插入2 次删除
  1. 10 0
      core/hdd/inc/wlan_hdd_cfg.h
  2. 10 0
      core/hdd/src/wlan_hdd_cfg.c
  3. 1 1
      core/hdd/src/wlan_hdd_cfg80211.c
  4. 4 1
      core/hdd/src/wlan_hdd_main.c

+ 10 - 0
core/hdd/inc/wlan_hdd_cfg.h

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

+ 10 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -3525,6 +3525,13 @@ REG_TABLE_ENTRY g_registry_table[] = {
 		     CFG_LRO_ENABLED_MIN,
 		     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,
 		     struct hdd_config, active_mode_offload,
 		     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]",
 		CFG_RM_CAPABILITY_NAME,
 		pHddCtx->config->rm_capability);
+	hdd_info("Name = [%s] Value = [%d]",
+		CFG_BPF_PACKET_FILTER_OFFLOAD,
+		pHddCtx->config->bpf_packet_filter_enable);
 }
 
 

+ 1 - 1
core/hdd/src/wlan_hdd_cfg80211.c

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

+ 4 - 1
core/hdd/src/wlan_hdd_main.c

@@ -1492,7 +1492,10 @@ void hdd_update_tgt_cfg(void *context, void *param)
 	hdd_info("Init current antenna mode: %d",
 		 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 */
 	hdd_nan_datapath_target_config(hdd_ctx, cfg);
 }