summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Brown <dustinb@codeaurora.org>2016-11-17 13:56:52 -0800
committerDustin Brown <dustinb@codeaurora.org>2016-11-21 10:15:16 -0800
commit137d82136467fe06ca54490cf9fad0f2966af6dd (patch)
treebd771b8141244e5082c43ef474f0dbebd0172e60
parent2c669336c0701ff06bff22b2fb0206c024704b8b (diff)
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
-rw-r--r--core/hdd/src/wlan_hdd_stats.c19
-rw-r--r--core/mac/inc/sir_api.h3
2 files changed, 20 insertions, 2 deletions
diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c
index 11e98cd3cacc..3e08913947ad 100644
--- a/core/hdd/src/wlan_hdd_stats.c
+++ b/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]) ||
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index a1eae75fc3bd..1cfcf4c1ac18 100644
--- a/core/mac/inc/sir_api.h
+++ b/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 */