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
2016-11-17 13:56:52 -08:00
committed by qcabuildsw
コミット 877a5a9a64
2個のファイルの変更20行の追加2行の削除

ファイルの表示

@@ -242,6 +242,23 @@ static bool put_wifi_rate_stat(tpSirWifiRateStat stats,
return true; 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 * put_wifi_peer_info() - put wifi peer info
* @stats: Pointer to stats context * @stats: Pointer to stats context
@@ -257,7 +274,7 @@ static bool put_wifi_peer_info(tpSirWifiPeerInfo stats,
if (nla_put_u32 if (nla_put_u32
(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_TYPE, (vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_TYPE,
stats->type) || wmi_to_sir_peer_type(stats->type)) ||
nla_put(vendor_event, nla_put(vendor_event,
QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_MAC_ADDRESS, QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_MAC_ADDRESS,
QDF_MAC_ADDR_SIZE, &stats->peerMacAddress.bytes[0]) || QDF_MAC_ADDR_SIZE, &stats->peerMacAddress.bytes[0]) ||

ファイルの表示

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