浏览代码

qcacld-3.0: Configure magic pattern in line with ini setting

The ini gEnableWoW was designed to enable or disable both magic
pattern match and pattern byte match, but now host ignore the
magic pattern setting from the ini, always enable the magic
pattern instead.

configure magic pattern in line with ini gEnableWoW setting.

Change-Id: I309aff03de9bdbd36fe391784ba54cbfa0cad67b
CRs-Fixed: 3047199
Li Feng 3 年之前
父节点
当前提交
1331092b43

+ 2 - 0
components/pmo/core/inc/wlan_pmo_priv.h

@@ -98,6 +98,7 @@ struct wlan_pmo_ctx {
  * @gtk_err_enable: gtk error is enabled or not
  * @vdev_bpf_req: place holder for apf/bpf for vdev
  * @vdev_pkt_filter: place holder for vdev packet filter
+ * @magic_ptrn_enable: true when magic pattern is enabled else false
  * @ptrn_match_enable: true when pattern match is enabled else false
  * @num_wow_default_patterns: number of wow default patterns for vdev
  * @num_wow_user_patterns: number of user wow patterns for vdev
@@ -121,6 +122,7 @@ struct pmo_vdev_priv_obj {
 	struct pmo_gtk_req vdev_gtk_req;
 	struct pmo_gtk_rsp_req vdev_gtk_rsp_req;
 	qdf_atomic_t gtk_err_enable;
+	bool magic_ptrn_enable;
 	bool ptrn_match_enable;
 	uint8_t num_wow_default_patterns;
 	uint8_t num_wow_user_patterns;

+ 11 - 0
components/pmo/core/src/wlan_pmo_static_config.c

@@ -38,11 +38,14 @@ void pmo_register_wow_wakeup_events(struct wlan_objmgr_vdev *vdev)
 	enum QDF_OPMODE  vdev_opmode;
 	struct pmo_psoc_priv_obj *psoc_ctx;
 	pmo_is_device_in_low_pwr_mode is_low_pwr_mode;
+	struct pmo_vdev_priv_obj *vdev_ctx;
 
 	vdev_opmode = pmo_get_vdev_opmode(vdev);
 	vdev_id = pmo_vdev_get_id(vdev);
 	pmo_debug("vdev_opmode %d vdev_id %d", vdev_opmode, vdev_id);
 
+	vdev_ctx = pmo_vdev_get_priv(vdev);
+
 	switch (vdev_opmode) {
 	case QDF_STA_MODE:
 	case QDF_P2P_CLIENT_MODE:
@@ -65,10 +68,18 @@ void pmo_register_wow_wakeup_events(struct wlan_objmgr_vdev *vdev)
 	case QDF_OCB_MODE:
 	case QDF_MONITOR_MODE:
 		pmo_set_sta_wow_bitmask(event_bitmap, PMO_WOW_MAX_EVENT_BM_LEN);
+		if (vdev_ctx->magic_ptrn_enable)
+			pmo_set_wow_event_bitmap(WOW_MAGIC_PKT_RECVD_EVENT,
+						 PMO_WOW_MAX_EVENT_BM_LEN,
+						 event_bitmap);
 		break;
 
 	case QDF_IBSS_MODE:
 		pmo_set_sta_wow_bitmask(event_bitmap, PMO_WOW_MAX_EVENT_BM_LEN);
+		if (vdev_ctx->magic_ptrn_enable)
+			pmo_set_wow_event_bitmap(WOW_MAGIC_PKT_RECVD_EVENT,
+						 PMO_WOW_MAX_EVENT_BM_LEN,
+						 event_bitmap);
 		pmo_set_wow_event_bitmap(WOW_BEACON_EVENT,
 					 PMO_WOW_MAX_EVENT_BM_LEN,
 					 event_bitmap);

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

@@ -359,9 +359,6 @@ void pmo_set_sta_wow_bitmask(uint32_t *bitmask, uint32_t wow_bitmap_size)
 	pmo_set_wow_event_bitmap(WOW_PATTERN_MATCH_EVENT,
 				 wow_bitmap_size,
 				 bitmask);
-	pmo_set_wow_event_bitmap(WOW_MAGIC_PKT_RECVD_EVENT,
-				 wow_bitmap_size,
-				 bitmask);
 	pmo_set_wow_event_bitmap(WOW_DEAUTH_RECVD_EVENT,
 				 wow_bitmap_size,
 				 bitmask);

+ 2 - 0
components/pmo/dispatcher/src/wlan_pmo_obj_mgmt_api.c

@@ -257,6 +257,8 @@ QDF_STATUS pmo_vdev_object_created_notification(
 	}
 
 	qdf_spinlock_create(&vdev_ctx->pmo_vdev_lock);
+	vdev_ctx->magic_ptrn_enable =
+		psoc_ctx->psoc_cfg.magic_ptrn_enable;
 	vdev_ctx->ptrn_match_enable =
 		psoc_ctx->psoc_cfg.ptrn_match_enable_all_vdev;
 	vdev_ctx->pmo_psoc_ctx = psoc_ctx;