Browse Source

qcacld-3.0: Send enable/disable flag separately in hw filter command

Before wow enable or pdev suspend  host sets hardware filter bitmap
and enables the filter via a command. But after resuming it sends
bitmap as zero with filter disable. This is interpreted by Firmware
as disable the modes set in the bitmap, so none of the modes are
disabled. With this host will not receive bc/mc packets after
disabling the hw filter, which it is expecting.

Send the same bitmap after resume that was used before suspend.

Change-Id: Ic7425274c9197e907404c3ca9ba0d5269ee51690
CRs-Fixed: 2194964
Nachiket Kukade 7 years ago
parent
commit
f080407812

+ 29 - 26
components/pmo/core/src/wlan_pmo_hw_filter.c

@@ -26,33 +26,12 @@
 #include "wlan_pmo_main.h"
 #include "wlan_pmo_obj_mgmt_public_struct.h"
 
-static QDF_STATUS pmo_core_conf_hw_filter(struct wlan_objmgr_vdev *vdev,
-					  enum pmo_hw_filter_mode mode)
-{
-	QDF_STATUS status;
-	struct pmo_hw_filter_params req = { .mode = mode, };
-
-	pmo_enter();
-
-	if (!pmo_core_is_vdev_connected(vdev)) {
-		status = QDF_STATUS_E_NOSUPPORT;
-		goto exit_with_status;
-	}
-
-	req.vdev_id = pmo_vdev_get_id(vdev);
-	status = pmo_tgt_conf_hw_filter(pmo_vdev_get_psoc(vdev), &req);
-
-exit_with_status:
-	pmo_exit();
-
-	return status;
-}
-
 QDF_STATUS pmo_core_enable_hw_filter_in_fwr(struct wlan_objmgr_vdev *vdev)
 {
 	QDF_STATUS status;
 	struct pmo_psoc_priv_obj *psoc_priv;
-	enum pmo_hw_filter_mode mode;
+	enum pmo_hw_filter_mode mode_bitmap;
+	struct pmo_hw_filter_params req = {0};
 
 	pmo_enter();
 
@@ -60,12 +39,20 @@ QDF_STATUS pmo_core_enable_hw_filter_in_fwr(struct wlan_objmgr_vdev *vdev)
 	if (QDF_IS_STATUS_ERROR(status))
 		goto exit_with_status;
 
+	if (!pmo_core_is_vdev_connected(vdev)) {
+		status = QDF_STATUS_E_NOSUPPORT;
+		goto exit_with_status;
+	}
+
 	psoc_priv = pmo_vdev_get_psoc_priv(vdev);
 	qdf_spin_lock_bh(&psoc_priv->lock);
-	mode = psoc_priv->psoc_cfg.hw_filter_mode;
+	mode_bitmap = psoc_priv->psoc_cfg.hw_filter_mode_bitmap;
 	qdf_spin_unlock_bh(&psoc_priv->lock);
 
-	status = pmo_core_conf_hw_filter(vdev, mode);
+	req.vdev_id = pmo_vdev_get_id(vdev);
+	req.mode_bitmap = psoc_priv->psoc_cfg.hw_filter_mode_bitmap;
+	req.enable = true;
+	status = pmo_tgt_conf_hw_filter(pmo_vdev_get_psoc(vdev), &req);
 
 	pmo_vdev_put_ref(vdev);
 
@@ -78,6 +65,9 @@ exit_with_status:
 QDF_STATUS pmo_core_disable_hw_filter_in_fwr(struct wlan_objmgr_vdev *vdev)
 {
 	QDF_STATUS status;
+	struct pmo_psoc_priv_obj *psoc_priv;
+	enum pmo_hw_filter_mode mode_bitmap;
+	struct pmo_hw_filter_params req = {0};
 
 	pmo_enter();
 
@@ -85,7 +75,20 @@ QDF_STATUS pmo_core_disable_hw_filter_in_fwr(struct wlan_objmgr_vdev *vdev)
 	if (QDF_IS_STATUS_ERROR(status))
 		goto exit_with_status;
 
-	status = pmo_core_conf_hw_filter(vdev, PMO_HW_FILTER_DISABLED);
+	if (!pmo_core_is_vdev_connected(vdev)) {
+		status = QDF_STATUS_E_NOSUPPORT;
+		goto exit_with_status;
+	}
+
+	psoc_priv = pmo_vdev_get_psoc_priv(vdev);
+	qdf_spin_lock_bh(&psoc_priv->lock);
+	mode_bitmap = psoc_priv->psoc_cfg.hw_filter_mode_bitmap;
+	qdf_spin_unlock_bh(&psoc_priv->lock);
+
+	req.vdev_id = pmo_vdev_get_id(vdev);
+	req.mode_bitmap = mode_bitmap;
+	req.enable = false;
+	status = pmo_tgt_conf_hw_filter(pmo_vdev_get_psoc(vdev), &req);
 
 	pmo_vdev_put_ref(vdev);
 

+ 2 - 2
components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h

@@ -262,7 +262,7 @@ enum pmo_auto_pwr_detect_failure_mode {
  * @ptrn_match_enable_all_vdev: true when pattern match is enable for all vdev
  * @apf_enable: true if psoc supports apf else false
  * @arp_offload_enable: true if arp offload is supported for psoc else false
- * @hw_filter_mode: which mode the hardware filter should use during DTIM
+ * @hw_filter_mode_bitmap: which mode the hardware filter should use during DTIM
  * @ns_offload_enable_static: true if psoc supports ns offload in ini else false
  * @ns_offload_enable_dynamic: to enable / disable the ns offload using
  *    ioctl or vendor command.
@@ -290,7 +290,7 @@ struct pmo_psoc_cfg {
 	bool ptrn_match_enable_all_vdev;
 	bool apf_enable;
 	bool arp_offload_enable;
-	enum pmo_hw_filter_mode hw_filter_mode;
+	enum pmo_hw_filter_mode hw_filter_mode_bitmap;
 	bool ns_offload_enable_static;
 	bool ns_offload_enable_dynamic;
 	bool packet_filter_enabled;

+ 8 - 6
components/pmo/dispatcher/inc/wlan_pmo_hw_filter_public_struct.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -36,19 +36,21 @@
  * waking up the firmware.
  */
 enum pmo_hw_filter_mode {
-	PMO_HW_FILTER_DISABLED = 0,
-	PMO_HW_FILTER_NON_ARP_BC = 1,
-	PMO_HW_FILTER_NON_ICMPV6_MC = 2,
+	PMO_HW_FILTER_DISABLED		= 0,
+	PMO_HW_FILTER_NON_ARP_BC	= (1 << 0),
+	PMO_HW_FILTER_NON_ICMPV6_MC	= (1 << 1),
 };
 
 /**
  * struct pmo_hw_filter_params - hardware filter configuration parameters
  * @vdev_id: Id of the virtual device to configure
- * @mode: the hardware filter mode to configure
+ * @enable: Enable/Disable the given hw filter modes
+ * @mode_bitmap: the hardware filter mode bitmap to configure
  */
 struct pmo_hw_filter_params {
 	uint8_t vdev_id;
-	enum pmo_hw_filter_mode mode;
+	bool enable;
+	enum pmo_hw_filter_mode mode_bitmap;
 };
 
 #endif /* _WLAN_PMO_HW_FILTER_PUBLIC_STRUCT_H */

+ 3 - 2
components/pmo/dispatcher/src/wlan_pmo_tgt_hw_filter.c

@@ -33,8 +33,9 @@ QDF_STATUS pmo_tgt_conf_hw_filter(struct wlan_objmgr_psoc *psoc,
 
 	pmo_enter();
 
-	pmo_debug("Configure hw filter; vdev_id:%u, mode:%d",
-		  req->vdev_id, req->mode);
+	pmo_debug("Send %s hw filter mode 0x%X for vdev_id %u",
+		  req->enable ? "Enable" : "Disable", req->mode_bitmap,
+		  req->vdev_id);
 
 	ops = GET_PMO_TX_OPS_FROM_PSOC(psoc);
 	if (!ops.send_conf_hw_filter_req) {

+ 5 - 5
core/hdd/inc/wlan_hdd_cfg.h

@@ -4696,10 +4696,10 @@ enum station_keepalive_method {
  *
  * </ini>
  */
-#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	(1)
+#define CFG_HW_FILTER_MODE_BITMAP_NAME	"gHwFilterMode"
+#define CFG_HW_FILTER_MODE_BITMAP_MIN		(0)
+#define CFG_HW_FILTER_MODE_BITMAP_MAX		(3)
+#define CFG_HW_FILTER_MODE_BITMAP_DEFAULT	(1)
 
 /*
  * <ini>
@@ -14393,7 +14393,7 @@ struct hdd_config {
 	 */
 	bool bSingleTidRc;
 	bool fhostArpOffload;
-	enum pmo_hw_filter_mode hw_filter_mode;
+	enum pmo_hw_filter_mode hw_filter_mode_bitmap;
 	bool ssdp;
 
 #ifdef FEATURE_RUNTIME_PM

+ 7 - 6
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_FILTER_MODE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, hw_filter_mode,
+	REG_VARIABLE(CFG_HW_FILTER_MODE_BITMAP_NAME, WLAN_PARAM_Integer,
+		     struct hdd_config, hw_filter_mode_bitmap,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_HW_FILTER_MODE_DEFAULT,
-		     CFG_HW_FILTER_MODE_MIN,
-		     CFG_HW_FILTER_MODE_MAX),
+		     CFG_HW_FILTER_MODE_BITMAP_DEFAULT,
+		     CFG_HW_FILTER_MODE_BITMAP_MIN,
+		     CFG_HW_FILTER_MODE_BITMAP_MAX),
 
 #ifdef FEATURE_WLAN_RA_FILTERING
 	REG_VARIABLE(CFG_RA_FILTER_ENABLE_NAME, WLAN_PARAM_Integer,
@@ -6558,7 +6558,8 @@ void hdd_cfg_print(struct hdd_context *hdd_ctx)
 	hdd_debug("Name = [fhostArpOffload] Value = [%u] ",
 		  hdd_ctx->config->fhostArpOffload);
 	hdd_debug("Name = [%s] Value = [%u]",
-		  CFG_HW_FILTER_MODE_NAME, hdd_ctx->config->hw_filter_mode);
+		  CFG_HW_FILTER_MODE_BITMAP_NAME,
+		  hdd_ctx->config->hw_filter_mode_bitmap);
 	hdd_debug("Name = [%s] Value = [%u]",
 		CFG_MAWC_NLO_ENABLED_NAME,
 		hdd_ctx->config->mawc_nlo_enabled);

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

@@ -13054,7 +13054,7 @@ static int hdd_update_pmo_config(struct hdd_context *hdd_ctx)
 		(hdd_ctx->config->wowEnable & 0x02) ? true : false;
 	psoc_cfg.apf_enable = hdd_ctx->config->apf_packet_filter_enable;
 	psoc_cfg.arp_offload_enable = hdd_ctx->config->fhostArpOffload;
-	psoc_cfg.hw_filter_mode = hdd_ctx->config->hw_filter_mode;
+	psoc_cfg.hw_filter_mode_bitmap = hdd_ctx->config->hw_filter_mode_bitmap;
 	psoc_cfg.ns_offload_enable_dynamic = hdd_ctx->config->fhostNSOffload;
 	psoc_cfg.ns_offload_enable_static = hdd_ctx->config->fhostNSOffload;
 	psoc_cfg.packet_filter_enabled = !hdd_ctx->config->disablePacketFilter;