Browse Source

qcacld-3.0: Add management frame wake stats

Track and print WLAN wake stats for management frames received.

Change-Id: I803a4cebbeb4434e25e00dc3826b186dbb17f413
CRs-Fixed: 2234398
Dustin Brown 7 năm trước cách đây
mục cha
commit
b1032c2cc2
1 tập tin đã thay đổi với 62 bổ sung31 xóa
  1. 62 31
      core/wma/src/wma_features.c

+ 62 - 31
core/wma/src/wma_features.c

@@ -1651,6 +1651,34 @@ static const u8 *wma_wow_wake_reason_str(A_INT32 wake_reason)
 }
 
 #ifdef QCA_SUPPORT_CP_STATS
+static bool wma_wow_reason_has_stats(enum wake_reason_e reason)
+{
+	switch (reason) {
+	case WOW_REASON_ASSOC_REQ_RECV:
+	case WOW_REASON_DISASSOC_RECVD:
+	case WOW_REASON_ASSOC_RES_RECV:
+	case WOW_REASON_REASSOC_REQ_RECV:
+	case WOW_REASON_REASSOC_RES_RECV:
+	case WOW_REASON_AUTH_REQ_RECV:
+	case WOW_REASON_DEAUTH_RECVD:
+	case WOW_REASON_ACTION_FRAME_RECV:
+	case WOW_REASON_BPF_ALLOW:
+	case WOW_REASON_PATTERN_MATCH_FOUND:
+	case WOW_REASON_RA_MATCH:
+	case WOW_REASON_NLOD:
+	case WOW_REASON_NLO_SCAN_COMPLETE:
+	case WOW_REASON_LOW_RSSI:
+	case WOW_REASON_EXTSCAN:
+	case WOW_REASON_RSSI_BREACH_EVENT:
+	case WOW_REASON_OEM_RESPONSE_EVENT:
+	case WOW_REASON_CHIP_POWER_FAILURE_DETECT:
+	case WOW_REASON_11D_SCAN:
+		return true;
+	default:
+		return false;
+	}
+}
+
 static void wma_inc_wow_stats(t_wma_handle *wma,
 			      WOW_EVENT_INFO_fixed_param *wake_info)
 {
@@ -1661,22 +1689,39 @@ static void wma_inc_wow_stats(t_wma_handle *wma,
 
 static void wma_wow_stats_display(struct wake_lock_stats *stats)
 {
-	WMA_LOGA("uc %d bc %d v4_mc %d v6_mc %d ra %d ns %d na %d pno_match %d pno_complete %d gscan %d low_rssi %d rssi_breach %d icmp %d icmpv6 %d oem %d",
-		stats->ucast_wake_up_count,
-		stats->bcast_wake_up_count,
-		stats->ipv4_mcast_wake_up_count,
-		stats->ipv6_mcast_wake_up_count,
-		stats->ipv6_mcast_ra_stats,
-		stats->ipv6_mcast_ns_stats,
-		stats->ipv6_mcast_na_stats,
-		stats->pno_match_wake_up_count,
-		stats->pno_complete_wake_up_count,
-		stats->gscan_wake_up_count,
-		stats->low_rssi_wake_up_count,
-		stats->rssi_breach_wake_up_count,
-		stats->icmpv4_count,
-		stats->icmpv6_count,
-		stats->oem_response_wake_up_count);
+	WMA_LOGA("WLAN wake reason counters:");
+	WMA_LOGA("uc:%d bc:%d v4_mc:%d v6_mc:%d ra:%d ns:%d na:%d "
+		 "icmp:%d icmpv6:%d",
+		 stats->ucast_wake_up_count,
+		 stats->bcast_wake_up_count,
+		 stats->ipv4_mcast_wake_up_count,
+		 stats->ipv6_mcast_wake_up_count,
+		 stats->ipv6_mcast_ra_stats,
+		 stats->ipv6_mcast_ns_stats,
+		 stats->ipv6_mcast_na_stats,
+		 stats->icmpv4_count,
+		 stats->icmpv6_count);
+
+	WMA_LOGA("assoc:%d disassoc:%d assoc_resp:%d reassoc:%d "
+		 "reassoc_resp:%d auth:%d deauth:%d action:%d",
+		 stats->mgmt_assoc,
+		 stats->mgmt_disassoc,
+		 stats->mgmt_assoc_resp,
+		 stats->mgmt_reassoc,
+		 stats->mgmt_reassoc_resp,
+		 stats->mgmt_auth,
+		 stats->mgmt_deauth,
+		 stats->mgmt_action);
+
+	WMA_LOGA("pno_match:%d pno_complete:%d gscan:%d "
+		 "low_rssi:%d rssi_breach:%d oem:%d scan_11d:%d",
+		 stats->pno_match_wake_up_count,
+		 stats->pno_complete_wake_up_count,
+		 stats->gscan_wake_up_count,
+		 stats->low_rssi_wake_up_count,
+		 stats->rssi_breach_wake_up_count,
+		 stats->oem_response_wake_up_count,
+		 stats->scan_11d);
 }
 
 static void wma_print_wow_stats(t_wma_handle *wma,
@@ -1685,22 +1730,8 @@ static void wma_print_wow_stats(t_wma_handle *wma,
 	struct wlan_objmgr_vdev *vdev;
 	struct wake_lock_stats stats = {0};
 
-	switch (wake_info->wake_reason) {
-	case WOW_REASON_BPF_ALLOW:
-	case WOW_REASON_PATTERN_MATCH_FOUND:
-	case WOW_REASON_RA_MATCH:
-	case WOW_REASON_NLOD:
-	case WOW_REASON_NLO_SCAN_COMPLETE:
-	case WOW_REASON_LOW_RSSI:
-	case WOW_REASON_EXTSCAN:
-	case WOW_REASON_RSSI_BREACH_EVENT:
-	case WOW_REASON_OEM_RESPONSE_EVENT:
-	case WOW_REASON_CHIP_POWER_FAILURE_DETECT:
-	case WOW_REASON_11D_SCAN:
-		break;
-	default:
+	if (!wma_wow_reason_has_stats(wake_info->wake_reason))
 		return;
-	}
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma->psoc,
 						    wake_info->vdev_id,