Browse Source

qcacld-3.0: Add gHwFilterMode ini item

Add a 'gHwFilterMode' ini item to control the DTIM mode hardware
filter. This ini item supersedes 'g_enable_non_arp_bc_hw_filter.'

	# disable feature (default)
	gHwFilterMode=0
	# drop all broadcast frames, except ARP
	gHwFilterMode=1
	# drop all multicast frames, except ICMPv6
	gHwFilterMode=2
	# drop all broadcast and multicast frames, except ARP and ICMPv6
	gHwFilterMode=3

Change-Id: I6bc8ac7585ffd0a62ab1c57558a798df9b63f2ce
CRs-Fixed: 2040420
Dustin Brown 8 years ago
parent
commit
1224e21a8f

+ 3 - 4
Kbuild

@@ -877,7 +877,7 @@ PMO_OBJS :=     $(PMO_DIR)/core/src/wlan_pmo_main.o \
 		$(PMO_DIR)/core/src/wlan_pmo_wow.o \
 		$(PMO_DIR)/core/src/wlan_pmo_lphb.o \
 		$(PMO_DIR)/core/src/wlan_pmo_suspend_resume.o \
-		$(PMO_DIR)/core/src/wlan_pmo_hw_bcast_fltr.o \
+		$(PMO_DIR)/core/src/wlan_pmo_hw_filter.o \
 		$(PMO_DIR)/core/src/wlan_pmo_pkt_filter.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_obj_mgmt_api.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_ucfg_api.o \
@@ -889,7 +889,7 @@ PMO_OBJS :=     $(PMO_DIR)/core/src/wlan_pmo_main.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_tgt_mc_addr_filtering.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_tgt_lphb.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_tgt_suspend_resume.o \
-		$(PMO_DIR)/dispatcher/src/wlan_pmo_tgt_non_arp_bcast_fltr.o \
+		$(PMO_DIR)/dispatcher/src/wlan_pmo_tgt_hw_filter.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_tgt_pkt_filter.o
 
 ############## UMAC P2P ###########
@@ -965,12 +965,11 @@ TARGET_IF_OBJ := $(TARGET_IF_DIR)/core/src/target_if_main.o \
 		$(TARGET_IF_DIR)/pmo/src/target_if_pmo_ns.o \
 		$(TARGET_IF_DIR)/pmo/src/target_if_pmo_gtk.o \
 		$(TARGET_IF_DIR)/pmo/src/target_if_pmo_wow.o \
-		$(TARGET_IF_DIR)/pmo/src/target_if_pmo_non_arp_bcast_fltr.o \
+		$(TARGET_IF_DIR)/pmo/src/target_if_pmo_hw_filter.o \
 		$(TARGET_IF_DIR)/pmo/src/target_if_pmo_mc_addr_filtering.o \
 		$(TARGET_IF_DIR)/pmo/src/target_if_pmo_static_config.o \
 		$(TARGET_IF_DIR)/pmo/src/target_if_pmo_lphb.o \
 		$(TARGET_IF_DIR)/pmo/src/target_if_pmo_suspend_resume.o \
-		$(TARGET_IF_DIR)/pmo/src/target_if_pmo_non_arp_bcast_fltr.o \
 		$(TARGET_IF_DIR)/pmo/src/target_if_pmo_pkt_filter.o \
 		$(TARGET_IF_DIR)/p2p/src/target_if_p2p.o \
 		$(TARGET_IF_DIR)/regulatory/src/target_if_reg.o \

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

@@ -45,6 +45,7 @@
 #include <sap_api.h>
 #include "osapi_linux.h"
 #include <wmi_unified.h>
+#include "wlan_pmo_hw_filter_public_struct.h"
 
 #define FW_MODULE_LOG_LEVEL_STRING_LENGTH  (255)
 #define TX_SCHED_WRR_PARAM_STRING_LENGTH   (50)
@@ -4167,22 +4168,36 @@ enum station_keepalive_method {
 
 /*
  * <ini>
- * g_enable_non_arp_bc_hw_filter - Enable HW broadcast filtering
+ * gHwFilterMode - configure hardware filter for DTIM mode
  * @Min: 0
- * @Max: 1
+ * @Max: 3
  * @Default: 0
  *
- * This ini support to dynamically enable/disable Broadast filter
- * when target goes to wow suspend/resume mode
+ * The hardware filter is only effective in DTIM mode. Use this configuration
+ * to blanket drop broadcast/multicast packets at the hardware level, without
+ * waking up the firmware
  *
- * Usage: External
+ * Takes a bitmap of frame types to drop
+ * @E.g.
+ *	# disable feature (default)
+ *	gHwFilterMode=0
+ *	# drop all broadcast frames, except ARP
+ *	gHwFilterMode=1
+ *	# drop all multicast frames, except ICMPv6
+ *	gHwFilterMode=2
+ *	# drop all broadcast and multicast frames, except ARP and ICMPv6
+ *	gHwFilterMode=3
+ *
+ * Related: N/A
+ *
+ * Usage: Internal/External
  *
  * </ini>
  */
-#define CFG_HW_BC_FILTER_NAME     "g_enable_non_arp_bc_hw_filter"
-#define CFG_HW_FILTER_DEFAULT         (0)
-#define CFG_HW_FILTER_MIN             (0)
-#define CFG_HW_FILTER_MAX             (1)
+#define CFG_HW_FILTER_MODE_NAME		"gHwFilterMode"
+#define CFG_HW_FILTER_MODE_MIN		(0)
+#define CFG_HW_FILTER_MODE_MAX		(3)
+#define CFG_HW_FILTER_MODE_DEFAULT	(0)
 
 /*
  * <ini>
@@ -10242,7 +10257,7 @@ struct hdd_config {
 	bool bSingleTidRc;
 	uint8_t mcastBcastFilterSetting;
 	bool fhostArpOffload;
-	bool hw_broadcast_filter;
+	enum pmo_hw_filter_mode hw_filter_mode;
 	bool ssdp;
 
 #ifdef FEATURE_RUNTIME_PM

+ 0 - 16
core/hdd/inc/wlan_hdd_power.h

@@ -147,22 +147,6 @@ enum suspend_resume_state {
 QDF_STATUS hdd_wlan_shutdown(void);
 QDF_STATUS hdd_wlan_re_init(void);
 
-/**
- * hdd_enable_non_arp_hw_broadcast_filter() - API to enable broadcast filter
- * @adapter: Adapter context for which ARP offload is to be configured
- *
- * Return: None
- */
-void hdd_enable_non_arp_hw_broadcast_filter(hdd_adapter_t *adapter);
-
-/**
- * hdd_disable_non_arp_hw_broadcast_filter() - API to disable broadcast filter
- * @adapter: Adapter context for which ARP offload is to be configured
- *
- * Return: None
- */
-void hdd_disable_non_arp_hw_broadcast_filter(hdd_adapter_t *adapter);
-
 /**
  * hdd_enable_arp_offload() - API to enable ARP offload
  * @adapter: Adapter context for which ARP offload is to be configured

+ 7 - 7
core/hdd/src/wlan_hdd_cfg.c

@@ -1458,12 +1458,12 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_ENABLE_HOST_ARPOFFLOAD_MIN,
 		     CFG_ENABLE_HOST_ARPOFFLOAD_MAX),
 
-	REG_VARIABLE(CFG_HW_BC_FILTER_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, hw_broadcast_filter,
+	REG_VARIABLE(CFG_HW_FILTER_MODE_NAME, WLAN_PARAM_Integer,
+		     struct hdd_config, hw_filter_mode,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_HW_FILTER_DEFAULT,
-		     CFG_HW_FILTER_MIN,
-		     CFG_HW_FILTER_MAX),
+		     CFG_HW_FILTER_MODE_DEFAULT,
+		     CFG_HW_FILTER_MODE_MIN,
+		     CFG_HW_FILTER_MODE_MAX),
 
 #ifdef FEATURE_WLAN_RA_FILTERING
 	REG_VARIABLE(CFG_RA_FILTER_ENABLE_NAME, WLAN_PARAM_Integer,
@@ -5349,8 +5349,8 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
 		  pHddCtx->config->mcastBcastFilterSetting);
 	hdd_info("Name = [fhostArpOffload] Value = [%u] ",
 		  pHddCtx->config->fhostArpOffload);
-	hdd_info("Name = [hw_broadcast_filter] Value = [%u]",
-		  pHddCtx->config->hw_broadcast_filter);
+	hdd_info("Name = [%s] Value = [%u]",
+		  CFG_HW_FILTER_MODE_NAME, pHddCtx->config->hw_filter_mode);
 	hdd_info("Name = [ssdp] Value = [%u] ", pHddCtx->config->ssdp);
 	hdd_cfg_print_runtime_pm(pHddCtx);
 #ifdef FEATURE_WLAN_RA_FILTERING

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

@@ -11162,7 +11162,7 @@ static int hdd_update_pmo_config(hdd_context_t *hdd_ctx)
 	psoc_cfg.bpf_enable =
 		hdd_ctx->config->bpf_packet_filter_enable;
 	psoc_cfg.arp_offload_enable = hdd_ctx->config->fhostArpOffload;
-	psoc_cfg.hw_bcast_filter = hdd_ctx->config->hw_broadcast_filter;
+	psoc_cfg.hw_filter_mode = hdd_ctx->config->hw_filter_mode;
 	psoc_cfg.ns_offload_enable_static = hdd_ctx->config->fhostNSOffload;
 	if (hdd_ctx->config->fhostNSOffload)
 		psoc_cfg.ns_offload_enable_dynamic = true;

+ 28 - 31
core/hdd/src/wlan_hdd_power.c

@@ -499,6 +499,32 @@ void hdd_ipv6_notifier_work_queue(struct work_struct *work)
 	cds_ssr_unprotect(__func__);
 }
 
+static void hdd_enable_hw_filter(hdd_adapter_t *adapter)
+{
+	QDF_STATUS status;
+
+	ENTER();
+
+	status = pmo_ucfg_enable_hw_filter_in_fwr(adapter->hdd_vdev);
+	if (status != QDF_STATUS_SUCCESS)
+		hdd_info("Failed to enable hardware filter");
+
+	EXIT();
+}
+
+static void hdd_disable_hw_filter(hdd_adapter_t *adapter)
+{
+	QDF_STATUS status;
+
+	ENTER();
+
+	status = pmo_ucfg_disable_hw_filter_in_fwr(adapter->hdd_vdev);
+	if (status != QDF_STATUS_SUCCESS)
+		hdd_info("Failed to disable hardware filter");
+
+	EXIT();
+}
+
 void hdd_enable_host_offloads(hdd_adapter_t *adapter,
 	enum pmo_offload_trigger trigger)
 {
@@ -520,7 +546,7 @@ void hdd_enable_host_offloads(hdd_adapter_t *adapter,
 	hdd_enable_arp_offload(adapter, trigger);
 	hdd_enable_ns_offload(adapter, trigger);
 	hdd_enable_mc_addr_filtering(adapter, trigger);
-	hdd_enable_non_arp_hw_broadcast_filter(adapter);
+	hdd_enable_hw_filter(adapter);
 out:
 	EXIT();
 
@@ -547,7 +573,7 @@ void hdd_disable_host_offloads(hdd_adapter_t *adapter,
 	hdd_disable_arp_offload(adapter, trigger);
 	hdd_disable_ns_offload(adapter, trigger);
 	hdd_disable_mc_addr_filtering(adapter, trigger);
-	hdd_disable_non_arp_hw_broadcast_filter(adapter);
+	hdd_disable_hw_filter(adapter);
 out:
 	EXIT();
 
@@ -914,35 +940,6 @@ out:
 	EXIT();
 }
 
-void hdd_enable_non_arp_hw_broadcast_filter(hdd_adapter_t *adapter)
-{
-	QDF_STATUS status;
-
-	ENTER();
-
-	status = pmo_ucfg_enable_non_arp_bcast_filter_in_fwr(
-							adapter->hdd_vdev);
-
-	if (status != QDF_STATUS_SUCCESS)
-		hdd_info("Failed to enable broadcast filter");
-
-	EXIT();
-}
-
-void hdd_disable_non_arp_hw_broadcast_filter(hdd_adapter_t *adapter)
-{
-	QDF_STATUS status;
-
-	ENTER();
-
-	status = pmo_ucfg_disable_non_arp_bcast_filter_in_fwr(
-							adapter->hdd_vdev);
-	if (status != QDF_STATUS_SUCCESS)
-		hdd_info("Failed to disable broadcast filter");
-
-	EXIT();
-}
-
 void hdd_enable_mc_addr_filtering(hdd_adapter_t *adapter,
 		enum pmo_offload_trigger trigger)
 {