Sfoglia il codice sorgente

qcacld-3.0: Reset wow pattern on vdev destroy

Currently if a vdev is destroyed, wow patterns are not
getting cleared for that vdev, so when a new vdev is
created, host tries to configure new wow patterns for
this new vdev but due to FW limitations on number of
wow patterns that can be maintained at FW, FW is not
able to act on this filter and will not maintain this
new wow filter.

To resolve this issue, clear the wow patterns for the
vdev before it gets destroyed.

Change-Id: Iae7ad8b683c95d8eaf11355bc0e36b91cece2202
CRs-Fixed: 2344337
Ashish Kumar Dhanotiya 6 anni fa
parent
commit
68ee2e4c50

+ 13 - 3
components/pmo/core/inc/wlan_pmo_wow.h

@@ -301,10 +301,20 @@ static inline uint8_t pmo_get_wow_user_ptrn(
 }
 
 void pmo_dump_wow_ptrn(struct pmo_wow_add_pattern *ptrn);
+/**
+ * pmo_core_del_wow_pattern() - Function which will delete the WoWL pattern
+ * @vdev: pointer to the vdev
+ *
+ * This function deletes all the user WoWl patterns and default WoWl patterns
+ *
+ * Return: error if any errors encountered, QDF_STATUS_SUCCESS otherwise
+ */
+
+QDF_STATUS pmo_core_del_wow_pattern(struct wlan_objmgr_vdev *vdev);
 
 /**
- * pmo_core_add_wow_pattern() - Function which will add the WoWL pattern to be
- *			 used when PBM filtering is enabled
+ * pmo_core_add_wow_user_pattern() - Function which will add the WoWL pattern
+ *			 to be used when PBM filtering is enabled
  * @vdev: pointer to the vdev
  * @ptrn: pointer to the pattern string to be added
  *
@@ -314,7 +324,7 @@ QDF_STATUS pmo_core_add_wow_user_pattern(struct wlan_objmgr_vdev *vdev,
 			struct pmo_wow_add_pattern *ptrn);
 
 /**
- * pmo_core_del_wow_pattern() - Function which will delete the WoWL pattern
+ * pmo_core_del_wow_user_pattern() - Function which will delete the WoWL pattern
  * @vdev: pointer to the vdev
  * @ptrn: pointer to the pattern string to be delete
  *

+ 29 - 0
components/pmo/core/src/wlan_pmo_wow.c

@@ -44,6 +44,35 @@ void pmo_set_wow_event_bitmap(WOW_WAKE_EVENT_TYPE event,
 	bitmask[idx] |= 1 << bit_idx;
 }
 
+QDF_STATUS pmo_core_del_wow_pattern(struct wlan_objmgr_vdev *vdev)
+{
+	QDF_STATUS status;
+	uint8_t id;
+	uint8_t pattern_count;
+	struct pmo_vdev_priv_obj *vdev_ctx;
+
+	pmo_enter();
+	status = pmo_vdev_get_ref(vdev);
+	if (QDF_IS_STATUS_ERROR(status))
+		goto out;
+
+	vdev_ctx = pmo_vdev_get_priv(vdev);
+	pattern_count = pmo_get_wow_default_ptrn(vdev_ctx);
+	/* clear all default patterns cofigured by pmo */
+	for (id = 0; id < pattern_count; id++)
+		status = pmo_tgt_del_wow_pattern(vdev, id, false);
+
+	/* clear all user patterns cofigured by pmo */
+	pattern_count = pmo_get_wow_user_ptrn(vdev_ctx);
+	for (id = 0; id < pattern_count; id++)
+		status = pmo_tgt_del_wow_pattern(vdev, id, true);
+
+	pmo_vdev_put_ref(vdev);
+out:
+	pmo_exit();
+	return status;
+}
+
 QDF_STATUS pmo_core_add_wow_user_pattern(struct wlan_objmgr_vdev *vdev,
 		struct pmo_wow_add_pattern *ptrn)
 {

+ 15 - 0
components/pmo/dispatcher/inc/wlan_pmo_ucfg_api.h

@@ -818,6 +818,15 @@ QDF_STATUS
 ucfg_pmo_add_wow_user_pattern(struct wlan_objmgr_vdev *vdev,
 			      struct pmo_wow_add_pattern *ptrn);
 
+/**
+ * ucfg_pmo_del_wow_pattern() - Delete WoWl patterns
+ * @vdev: objmgr vdev
+ *
+ * Return:QDF_STATUS_SUCCESS on success else error code
+ */
+QDF_STATUS
+ucfg_pmo_del_wow_pattern(struct wlan_objmgr_vdev *vdev);
+
 QDF_STATUS
 ucfg_pmo_del_wow_user_pattern(struct wlan_objmgr_vdev *vdev,
 			      uint8_t pattern_id);
@@ -1395,6 +1404,12 @@ ucfg_pmo_del_wow_user_pattern(
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS
+ucfg_pmo_del_wow_pattern(struct wlan_objmgr_vdev *vdev)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
 static inline QDF_STATUS
 ucfg_pmo_psoc_bus_resume_req(
 		struct wlan_objmgr_psoc *psoc,

+ 6 - 0
components/pmo/dispatcher/src/wlan_pmo_ucfg_api.c

@@ -414,6 +414,12 @@ ucfg_pmo_add_wow_user_pattern(struct wlan_objmgr_vdev *vdev,
 	return pmo_core_add_wow_user_pattern(vdev, ptrn);
 }
 
+QDF_STATUS
+ucfg_pmo_del_wow_pattern(struct wlan_objmgr_vdev *vdev)
+{
+	return  pmo_core_del_wow_pattern(vdev);
+}
+
 QDF_STATUS
 ucfg_pmo_del_wow_user_pattern(struct wlan_objmgr_vdev *vdev,
 			      uint8_t pattern_id)

+ 2 - 0
core/hdd/src/wlan_hdd_main.c

@@ -3988,6 +3988,8 @@ int hdd_vdev_destroy(struct hdd_adapter *adapter)
 	vdev = hdd_objmgr_get_vdev(adapter);
 	if (!vdev)
 		return -EINVAL;
+
+	ucfg_pmo_del_wow_pattern(vdev);
 	status = ucfg_reg_11d_vdev_delete_update(vdev);
 	ucfg_scan_set_vdev_del_in_progress(vdev);
 	hdd_objmgr_put_vdev(adapter);