qcacmn: Add CDP api to fetch data rates

Add new CDP api to fetch data rates accordingly
from datapath

Change-Id: I1cf08d396e0f611c61a02c868c9c31759ef52a79
CRs-Fixed: 2394226
This commit is contained in:
Surya Prakash Raajen 2019-02-19 13:19:36 +05:30 • committed by nshrivas
commit 3a01bdd783
3 changed files with 52 additions and 0 deletions

View file

@ -49,6 +49,36 @@ static inline int cdp_host_stats_get(ol_txrx_soc_handle soc,
return soc->ops->host_stats_ops->txrx_host_stats_get(vdev, req);
}
/**
* cdp_host_stats_get_ratekbps: cdp call to get rate in kbps
* @soc: SOC handle
* @preamb: Preamble
* @mcs: Modulation and Coding scheme index
* @htflag: Flag to identify HT or VHT
* @gintval: Gaurd Interval value
*
* return: 0 for Failure, Returns rate on Success
*/
static inline int cdp_host_stats_get_ratekbps(ol_txrx_soc_handle soc,
int preamb, int mcs,
int htflag, int gintval)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return 0;
}
if (!soc->ops->host_stats_ops ||
!soc->ops->host_stats_ops->txrx_get_ratekbps)
return 0;
return soc->ops->host_stats_ops->txrx_get_ratekbps(preamb,
mcs, htflag,
gintval);
}
/**
* cdp_host_stats_clr: cdp call to clear host stats
* @vdev: vdev handle

View file

@ -789,6 +789,9 @@ struct cdp_host_stats_ops {
void *buf);
struct cdp_pdev_stats*
(*txrx_get_pdev_stats)(struct cdp_pdev *pdev);
int
(*txrx_get_ratekbps)(int preamb, int mcs,
int htflag, int gintval);
};
struct cdp_wds_ops {

View file

@ -33,6 +33,9 @@
#include "dp_tx.h"
#include "dp_tx_desc.h"
#include "dp_rx.h"
#ifdef DP_RATETABLE_SUPPORT
#include "dp_ratetable.h"
#endif
#include <cdp_txrx_handle.h>
#include <wlan_cfg.h>
#include "cdp_txrx_cmn_struct.h"
@ -8098,6 +8101,21 @@ static void dp_set_vdev_dscp_tid_map_wifi3(struct cdp_vdev *vdev_handle,
return;
}
#ifdef DP_RATETABLE_SUPPORT
static int dp_txrx_get_ratekbps(int preamb, int mcs,
int htflag, int gintval)
{
return dp_getrateindex((uint32_t)gintval, (uint16_t)mcs, 1,
(uint8_t)preamb, 1);
}
#else
static int dp_txrx_get_ratekbps(int preamb, int mcs,
int htflag, int gintval)
{
return 0;
}
#endif
/* dp_txrx_get_pdev_stats - Returns cdp_pdev_stats
* @peer_handle: DP pdev handle
*
@ -9242,6 +9260,7 @@ static struct cdp_host_stats_ops dp_ops_host_stats = {
.txrx_get_peer_stats = dp_txrx_get_peer_stats,
.txrx_reset_peer_stats = dp_txrx_reset_peer_stats,
.txrx_get_pdev_stats = dp_txrx_get_pdev_stats,
.txrx_get_ratekbps = dp_txrx_get_ratekbps,
/* TODO */
};