Преглед изворни кода

qcacld-3.0: Map peer type before reporting link layer stats

Peer type in the link layer stats is being reported as wmi_peer_type
values. Map these values to wifi peer types before reporting link
layer stats to kernel.

Change-Id: I1b86cd030ff8e40296cd99b3a6ceb1168b96ba78
CRs-Fixed: 1091553
Dustin Brown пре 8 година
родитељ
комит
877a5a9a64
2 измењених фајлова са 20 додато и 2 уклоњено
  1. 18 1
      core/hdd/src/wlan_hdd_stats.c
  2. 2 1
      core/mac/inc/sir_api.h

+ 18 - 1
core/hdd/src/wlan_hdd_stats.c

@@ -242,6 +242,23 @@ static bool put_wifi_rate_stat(tpSirWifiRateStat stats,
 	return true;
 }
 
+static tSirWifiPeerType wmi_to_sir_peer_type(enum wmi_peer_type type)
+{
+	switch (type) {
+	case WMI_PEER_TYPE_DEFAULT:
+		return WIFI_PEER_STA;
+	case WMI_PEER_TYPE_BSS:
+		return WIFI_PEER_AP;
+	case WMI_PEER_TYPE_TDLS:
+		return WIFI_PEER_TDLS;
+	case WMI_PEER_TYPE_NAN_DATA:
+		return WMI_PEER_TYPE_NAN_DATA;
+	default:
+		hdd_err("Cannot map wmi_peer_type %d to HAL peer type", type);
+		return WIFI_PEER_INVALID;
+	}
+}
+
 /**
  * put_wifi_peer_info() - put wifi peer info
  * @stats: Pointer to stats context
@@ -257,7 +274,7 @@ static bool put_wifi_peer_info(tpSirWifiPeerInfo stats,
 
 	if (nla_put_u32
 		    (vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_TYPE,
-		    stats->type) ||
+		    wmi_to_sir_peer_type(stats->type)) ||
 	    nla_put(vendor_event,
 		       QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_MAC_ADDRESS,
 		       QDF_MAC_ADDR_SIZE, &stats->peerMacAddress.bytes[0]) ||

+ 2 - 1
core/mac/inc/sir_api.h

@@ -53,6 +53,7 @@ typedef struct sAniSirGlobal *tpAniSirGlobal;
 #include "ani_system_defs.h"
 #include "sir_params.h"
 #include "cds_regdomain.h"
+#include "wmi_unified.h"
 #include "wmi_unified_param.h"
 #include <dot11f.h>
 
@@ -5090,7 +5091,7 @@ typedef enum {
 /* per peer statistics */
 typedef struct {
 	/* peer type (AP, TDLS, GO etc.) */
-	tSirWifiPeerType type;
+	enum wmi_peer_type type;
 	/* mac address */
 	struct qdf_mac_addr peerMacAddress;
 	/* peer WIFI_CAPABILITY_XXX */