瀏覽代碼

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 年之前
父節點
當前提交
71af6a086d

+ 29 - 26
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
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
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
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) {