qcacmn: Decoupling changes for stats, wds, raw and pflow ops
Change cdp_host_stats_ops, cdp_wds_ops, cdp_raw_ops and cdp_pflow_ops APIs to replace pdev, vdev and peer dp handles with pdev_id, vdev_id and peer mac address along with dp soc handle. Change-Id: Ia956882535cc04e57a006905d46ccfe9d95bb731
Cette révision appartient à :

révisé par
nshrivas

Parent
084f936b71
révision
e54c584723
@@ -24,15 +24,17 @@
|
||||
#ifndef _CDP_TXRX_HOST_STATS_H_
|
||||
#define _CDP_TXRX_HOST_STATS_H_
|
||||
#include "cdp_txrx_handle.h"
|
||||
#include <wmi_unified_api.h>
|
||||
/**
|
||||
* cdp_host_stats_get: cdp call to get host stats
|
||||
* @soc: SOC handle
|
||||
* @vdev_id: vdev id of vdev
|
||||
* @req: Requirement type
|
||||
*
|
||||
* return: 0 for Success, Failure returns error message
|
||||
*/
|
||||
static inline int cdp_host_stats_get(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev,
|
||||
uint8_t vdev_id,
|
||||
struct ol_txrx_stats_req *req)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
@@ -46,7 +48,7 @@ static inline int cdp_host_stats_get(ol_txrx_soc_handle soc,
|
||||
!soc->ops->host_stats_ops->txrx_host_stats_get)
|
||||
return 0;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_host_stats_get(vdev, req);
|
||||
return soc->ops->host_stats_ops->txrx_host_stats_get(soc, vdev_id, req);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,46 +83,47 @@ static inline int cdp_host_stats_get_ratekbps(ol_txrx_soc_handle soc,
|
||||
|
||||
/**
|
||||
* cdp_host_stats_clr: cdp call to clear host stats
|
||||
* @vdev: vdev handle
|
||||
* @soc: soc handle
|
||||
* @vdev_id: vdev handle id
|
||||
*
|
||||
* return: void
|
||||
* return: QDF_STATUS
|
||||
*/
|
||||
static inline void
|
||||
cdp_host_stats_clr(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
static inline QDF_STATUS
|
||||
cdp_host_stats_clr(ol_txrx_soc_handle soc, uint8_t vdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->txrx_host_stats_clr)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->host_stats_ops->txrx_host_stats_clr(vdev);
|
||||
return soc->ops->host_stats_ops->txrx_host_stats_clr(soc, vdev_id);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_host_ce_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
static inline QDF_STATUS
|
||||
cdp_host_ce_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->txrx_host_ce_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->host_stats_ops->txrx_host_ce_stats(vdev);
|
||||
return soc->ops->host_stats_ops->txrx_host_ce_stats(soc, vdev_id);
|
||||
}
|
||||
|
||||
static inline int cdp_stats_publish
|
||||
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
|
||||
(ol_txrx_soc_handle soc, uint8_t pdev_id,
|
||||
struct cdp_stats_extd *buf)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
@@ -134,204 +137,176 @@ static inline int cdp_stats_publish
|
||||
!soc->ops->host_stats_ops->txrx_stats_publish)
|
||||
return 0;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_stats_publish(pdev, buf);
|
||||
return soc->ops->host_stats_ops->txrx_stats_publish(soc, pdev_id, buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable enhanced stats functionality.
|
||||
*
|
||||
* @param pdev - the physical device object
|
||||
* @return - void
|
||||
* @param soc - the soc object
|
||||
* @param pdev_id - id of the physical device object
|
||||
* @return - QDF_STATUS
|
||||
*/
|
||||
static inline void
|
||||
cdp_enable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
|
||||
static inline QDF_STATUS
|
||||
cdp_enable_enhanced_stats(ol_txrx_soc_handle soc, uint8_t pdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->txrx_enable_enhanced_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->host_stats_ops->txrx_enable_enhanced_stats
|
||||
(pdev);
|
||||
return soc->ops->host_stats_ops->txrx_enable_enhanced_stats
|
||||
(soc, pdev_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable enhanced stats functionality.
|
||||
*
|
||||
* @param pdev - the physical device object
|
||||
* @return - void
|
||||
* @param soc - the soc object
|
||||
* @param pdev_id - id of the physical device object
|
||||
* @return - QDF_STATUS
|
||||
*/
|
||||
static inline void
|
||||
cdp_disable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
|
||||
static inline QDF_STATUS
|
||||
cdp_disable_enhanced_stats(ol_txrx_soc_handle soc, uint8_t pdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->txrx_disable_enhanced_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->host_stats_ops->txrx_disable_enhanced_stats
|
||||
(pdev);
|
||||
return soc->ops->host_stats_ops->txrx_disable_enhanced_stats
|
||||
(soc, pdev_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the desired stats from the message.
|
||||
*
|
||||
* @param pdev - the physical device object
|
||||
* @param stats_base - stats buffer received from FW
|
||||
* @param type - stats type.
|
||||
* @return - pointer to requested stat identified by type
|
||||
*/
|
||||
static inline uint32_t *cdp_get_stats_base
|
||||
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
|
||||
uint32_t *stats_base, uint32_t msg_len, uint8_t type)
|
||||
static inline QDF_STATUS
|
||||
cdp_tx_print_tso_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
|
||||
{
|
||||
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_stats_base)
|
||||
return 0;
|
||||
|
||||
return (uint32_t *)soc->ops->host_stats_ops->txrx_get_stats_base
|
||||
(pdev, stats_base, msg_len, type);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_tx_print_tso_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->tx_print_tso_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->host_stats_ops->tx_print_tso_stats(vdev);
|
||||
return soc->ops->host_stats_ops->tx_print_tso_stats(soc, vdev_id);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_tx_rst_tso_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
static inline QDF_STATUS
|
||||
cdp_tx_rst_tso_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->tx_rst_tso_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->host_stats_ops->tx_rst_tso_stats(vdev);
|
||||
return soc->ops->host_stats_ops->tx_rst_tso_stats(soc, vdev_id);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_tx_print_sg_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev)
|
||||
static inline QDF_STATUS
|
||||
cdp_tx_print_sg_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->tx_print_sg_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->host_stats_ops->tx_print_sg_stats(vdev);
|
||||
return soc->ops->host_stats_ops->tx_print_sg_stats(soc, vdev_id);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_tx_rst_sg_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
static inline QDF_STATUS
|
||||
cdp_tx_rst_sg_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->tx_rst_sg_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->host_stats_ops->tx_rst_sg_stats(vdev);
|
||||
return soc->ops->host_stats_ops->tx_rst_sg_stats(soc, vdev_id);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_print_rx_cksum_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev)
|
||||
static inline QDF_STATUS
|
||||
cdp_print_rx_cksum_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->print_rx_cksum_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->host_stats_ops->print_rx_cksum_stats(vdev);
|
||||
return soc->ops->host_stats_ops->print_rx_cksum_stats(soc, vdev_id);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_rst_rx_cksum_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
static inline QDF_STATUS
|
||||
cdp_rst_rx_cksum_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->rst_rx_cksum_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->host_stats_ops->rst_rx_cksum_stats(vdev);
|
||||
return soc->ops->host_stats_ops->rst_rx_cksum_stats(soc, vdev_id);
|
||||
}
|
||||
|
||||
static inline A_STATUS
|
||||
cdp_host_me_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
static inline QDF_STATUS
|
||||
cdp_host_me_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return 0;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->txrx_host_me_stats)
|
||||
return 0;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_host_me_stats(vdev);
|
||||
return soc->ops->host_stats_ops->txrx_host_me_stats(soc, vdev_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -342,25 +317,25 @@ cdp_host_me_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
*
|
||||
* return: status
|
||||
*/
|
||||
static inline void cdp_per_peer_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev, char *addr)
|
||||
static inline QDF_STATUS cdp_per_peer_stats(ol_txrx_soc_handle soc,
|
||||
uint8_t *addr)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->txrx_per_peer_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->host_stats_ops->txrx_per_peer_stats(pdev, addr);
|
||||
return soc->ops->host_stats_ops->txrx_per_peer_stats(soc, addr);
|
||||
}
|
||||
|
||||
static inline int cdp_host_msdu_ttl_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev,
|
||||
uint8_t vdev_id,
|
||||
struct ol_txrx_stats_req *req)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
@@ -375,106 +350,113 @@ static inline int cdp_host_msdu_ttl_stats(ol_txrx_soc_handle soc,
|
||||
return 0;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_host_msdu_ttl_stats
|
||||
(vdev, req);
|
||||
(soc, vdev_id, req);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_print_lro_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
static inline QDF_STATUS cdp_update_peer_stats(ol_txrx_soc_handle soc,
|
||||
uint8_t vdev_id, uint8_t *mac,
|
||||
void *stats,
|
||||
uint32_t last_tx_rate_mcs,
|
||||
uint32_t stats_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->print_lro_stats)
|
||||
return;
|
||||
!soc->ops->host_stats_ops->txrx_update_peer_stats)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->host_stats_ops->print_lro_stats(vdev);
|
||||
return soc->ops->host_stats_ops->txrx_update_peer_stats
|
||||
(soc, vdev_id, mac, stats, last_tx_rate_mcs, stats_id);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_reset_lro_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->reset_lro_stats)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->reset_lro_stats(vdev);
|
||||
}
|
||||
|
||||
static inline void cdp_get_dp_fw_peer_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev, uint8_t *mac, uint32_t caps,
|
||||
static inline QDF_STATUS cdp_get_dp_fw_peer_stats(ol_txrx_soc_handle soc,
|
||||
uint8_t pdev_id,
|
||||
uint8_t *mac, uint32_t caps,
|
||||
uint32_t copy_stats)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->get_fw_peer_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->host_stats_ops->get_fw_peer_stats
|
||||
(pdev, mac, caps, copy_stats);
|
||||
return soc->ops->host_stats_ops->get_fw_peer_stats
|
||||
(soc, pdev_id, mac, caps, copy_stats);
|
||||
}
|
||||
|
||||
static inline void cdp_get_dp_htt_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev,
|
||||
static inline QDF_STATUS cdp_get_dp_htt_stats(ol_txrx_soc_handle soc,
|
||||
uint8_t pdev_id,
|
||||
void *data, uint32_t data_len)
|
||||
{
|
||||
if (soc && soc->ops && soc->ops->host_stats_ops &&
|
||||
soc->ops->host_stats_ops->get_htt_stats)
|
||||
return soc->ops->host_stats_ops->get_htt_stats
|
||||
(pdev, data, data_len);
|
||||
return;
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->get_htt_stats)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return soc->ops->host_stats_ops->get_htt_stats(soc, pdev_id, data,
|
||||
data_len);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update pdev host stats received from firmware
|
||||
* (wmi_host_pdev_stats and wmi_host_pdev_ext_stats) into dp
|
||||
*
|
||||
* @param pdev - the physical device object
|
||||
* @param soc - soc handle
|
||||
* @param pdev_id - id of the physical device object
|
||||
* @param data - pdev stats
|
||||
* @return - void
|
||||
* @return - QDF_STATUS
|
||||
*/
|
||||
static inline void
|
||||
static inline QDF_STATUS
|
||||
cdp_update_pdev_host_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev,
|
||||
uint8_t pdev_id,
|
||||
void *data,
|
||||
uint16_t stats_id)
|
||||
{
|
||||
if (soc && soc->ops && soc->ops->host_stats_ops &&
|
||||
soc->ops->host_stats_ops->txrx_update_pdev_stats)
|
||||
return soc->ops->host_stats_ops->txrx_update_pdev_stats
|
||||
(pdev, data, stats_id);
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->txrx_update_pdev_stats)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_update_pdev_stats(soc, pdev_id,
|
||||
data,
|
||||
stats_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update vdev host stats
|
||||
*
|
||||
* @param soc - soc handle
|
||||
* @param vdev - the physical device object
|
||||
* @param vdev_id - id of the virtual device object
|
||||
* @param data - pdev stats
|
||||
* @param stats_id - type of stats
|
||||
*
|
||||
* @return - void
|
||||
* @return - QDF_STATUS
|
||||
*/
|
||||
static inline void
|
||||
static inline QDF_STATUS
|
||||
cdp_update_vdev_host_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev,
|
||||
uint8_t vdev_id,
|
||||
void *data,
|
||||
uint16_t stats_id)
|
||||
{
|
||||
@@ -482,98 +464,114 @@ cdp_update_vdev_host_stats(ol_txrx_soc_handle soc,
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->txrx_update_vdev_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_update_vdev_stats(vdev, data,
|
||||
return soc->ops->host_stats_ops->txrx_update_vdev_stats(soc, vdev_id,
|
||||
data,
|
||||
stats_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Call to get peer stats
|
||||
*
|
||||
* @param peer - dp peer object
|
||||
* @param soc - soc handle
|
||||
* @param vdev_id - vdev_id of vdev object
|
||||
* @param peer_mac - mac address of the peer
|
||||
* @return - struct cdp_peer_stats
|
||||
*/
|
||||
static inline struct cdp_peer_stats *
|
||||
cdp_host_get_peer_stats(ol_txrx_soc_handle soc, struct cdp_peer *peer)
|
||||
static inline QDF_STATUS
|
||||
cdp_host_get_peer_stats(ol_txrx_soc_handle soc, uint8_t vdev_id,
|
||||
uint8_t *peer_mac,
|
||||
struct cdp_peer_stats *peer_stats)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return NULL;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->txrx_get_peer_stats)
|
||||
return NULL;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_get_peer_stats(peer);
|
||||
return soc->ops->host_stats_ops->txrx_get_peer_stats(soc, vdev_id,
|
||||
peer_mac,
|
||||
peer_stats);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Call to reset ald stats
|
||||
*
|
||||
* @param peer - dp peer object
|
||||
* @param soc - soc handle
|
||||
* @param vdev_id - vdev_id of vdev object
|
||||
* @param peer_mac - mac address of the peer
|
||||
* @return - void
|
||||
*/
|
||||
static inline void
|
||||
cdp_host_reset_peer_ald_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_peer *peer)
|
||||
static inline QDF_STATUS
|
||||
cdp_host_reset_peer_ald_stats(ol_txrx_soc_handle soc, uint8_t vdev_id,
|
||||
uint8_t *peer_mac)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->txrx_reset_peer_ald_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_reset_peer_ald_stats(peer);
|
||||
return soc->ops->host_stats_ops->txrx_reset_peer_ald_stats(soc,
|
||||
vdev_id,
|
||||
peer_mac);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Call to reset peer stats
|
||||
*
|
||||
* @param peer - dp peer object
|
||||
* @return - void
|
||||
* @param soc - soc handle
|
||||
* @param vdev_id - vdev_id of vdev object
|
||||
* @param peer_mac - mac address of the peer
|
||||
* @return - QDF_STATUS
|
||||
*/
|
||||
static inline void
|
||||
static inline QDF_STATUS
|
||||
cdp_host_reset_peer_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_peer *peer)
|
||||
uint8_t vdev_id, uint8_t *peer_mac)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->txrx_reset_peer_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_reset_peer_stats(peer);
|
||||
return soc->ops->host_stats_ops->txrx_reset_peer_stats(soc,
|
||||
vdev_id,
|
||||
peer_mac);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Call to get vdev stats
|
||||
*
|
||||
* @param vdev - dp vdev object
|
||||
* @param soc - dp soc object
|
||||
* @param vdev_id - id of dp vdev object
|
||||
* @param buf - buffer
|
||||
* @return - int
|
||||
*/
|
||||
static inline int
|
||||
cdp_host_get_vdev_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev,
|
||||
uint8_t vdev_id,
|
||||
struct cdp_vdev_stats *buf,
|
||||
bool is_aggregate)
|
||||
{
|
||||
@@ -588,7 +586,7 @@ cdp_host_get_vdev_stats(ol_txrx_soc_handle soc,
|
||||
!soc->ops->host_stats_ops->txrx_get_vdev_stats)
|
||||
return 0;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_get_vdev_stats(vdev,
|
||||
return soc->ops->host_stats_ops->txrx_get_vdev_stats(soc, vdev_id,
|
||||
buf,
|
||||
is_aggregate);
|
||||
}
|
||||
@@ -629,14 +627,15 @@ cdp_update_host_vdev_stats(ol_txrx_soc_handle soc,
|
||||
/**
|
||||
* @brief Call to get vdev extd stats
|
||||
*
|
||||
* @param vdev - dp vdev object
|
||||
* @param soc - soc handle
|
||||
* @param vdev_id - id of dp vdev object
|
||||
* @param buf - buffer
|
||||
* @return - int
|
||||
*/
|
||||
static inline int
|
||||
cdp_get_vdev_extd_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev,
|
||||
void *buf)
|
||||
uint8_t vdev_id,
|
||||
wmi_host_vdev_extd_stats *buf)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
@@ -649,18 +648,21 @@ cdp_get_vdev_extd_stats(ol_txrx_soc_handle soc,
|
||||
!soc->ops->host_stats_ops->txrx_get_vdev_extd_stats)
|
||||
return 0;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_get_vdev_extd_stats(vdev, buf);
|
||||
return soc->ops->host_stats_ops->txrx_get_vdev_extd_stats(soc, vdev_id,
|
||||
buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Call to get cdp_pdev_stats
|
||||
*
|
||||
* @param pdev - dp pdev object
|
||||
* @return - cdp_pdev_stats
|
||||
* @param soc - soc handle
|
||||
* @param pdev_id - id of dp pdev object
|
||||
* @param buf - buffer to hold cdp_pdev_stats
|
||||
* @return - success/failure
|
||||
*/
|
||||
static inline struct cdp_pdev_stats*
|
||||
static inline int
|
||||
cdp_host_get_pdev_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev)
|
||||
uint8_t pdev_id, struct cdp_pdev_stats *buf)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
@@ -673,19 +675,20 @@ cdp_host_get_pdev_stats(ol_txrx_soc_handle soc,
|
||||
!soc->ops->host_stats_ops->txrx_get_pdev_stats)
|
||||
return 0;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_get_pdev_stats(pdev);
|
||||
return soc->ops->host_stats_ops->txrx_get_pdev_stats(soc, pdev_id, buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Call to get radio stats
|
||||
*
|
||||
* @param pdev - dp pdev object
|
||||
* @param soc - soc handle
|
||||
* @param pdev_id - id of dp pdev object
|
||||
* @param scn_stats_user - stats buffer
|
||||
* @return - int
|
||||
*/
|
||||
static inline int
|
||||
cdp_host_get_radio_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev,
|
||||
uint8_t pdev_id,
|
||||
void *buf)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
@@ -699,7 +702,7 @@ cdp_host_get_radio_stats(ol_txrx_soc_handle soc,
|
||||
!soc->ops->host_stats_ops->txrx_get_radio_stats)
|
||||
return 0;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_get_radio_stats(pdev,
|
||||
return soc->ops->host_stats_ops->txrx_get_radio_stats(soc, pdev_id,
|
||||
buf);
|
||||
}
|
||||
|
||||
@@ -707,39 +710,24 @@ cdp_host_get_radio_stats(ol_txrx_soc_handle soc,
|
||||
* @brief confgure rate stats at soc
|
||||
*
|
||||
* @param soc - opaque soc handle
|
||||
* @param vap - capabilities
|
||||
* @return - void
|
||||
* @param val - capabilities
|
||||
* @return - QDF_STATUS
|
||||
*/
|
||||
static inline void
|
||||
static inline QDF_STATUS
|
||||
cdp_soc_configure_rate_stats(ol_txrx_soc_handle soc, uint8_t val)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->host_stats_ops ||
|
||||
!soc->ops->host_stats_ops->configure_rate_stats)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return soc->ops->host_stats_ops->configure_rate_stats(soc, val);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Parse the stats header and get the payload from the message.
|
||||
*
|
||||
* @param pdev - the physical device object
|
||||
* @param msg_word - stats buffer received from FW
|
||||
* @param msg_len - length of the message
|
||||
* @param type - place holder for parsed message type
|
||||
* @param status - place holder for parsed message status
|
||||
* @return - pointer to received stat payload
|
||||
*/
|
||||
|
||||
#if defined(QCA_SUPPORT_SON) || defined(ENHANCED_STATS)
|
||||
uint32_t *ol_txrx_get_en_stats_base(struct cdp_pdev *pdev, uint32_t *msg_word,
|
||||
uint32_t msg_len, enum htt_cmn_t2h_en_stats_type *type, enum htt_cmn_t2h_en_stats_status *status);
|
||||
#endif
|
||||
#endif /* _CDP_TXRX_HOST_STATS_H_ */
|
||||
|
@@ -29,6 +29,8 @@
|
||||
#include "cdp_txrx_handle.h"
|
||||
#include <cdp_txrx_mon_struct.h>
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
#include <wmi_unified_api.h>
|
||||
#include <wdi_event_api.h>
|
||||
|
||||
#ifdef IPA_OFFLOAD
|
||||
#ifdef CONFIG_IPA_WDI_UNIFIED_API
|
||||
@@ -791,137 +793,155 @@ struct cdp_pktcapture_ops {
|
||||
#endif /* #ifdef WLAN_FEATURE_PKT_CAPTURE */
|
||||
|
||||
struct cdp_host_stats_ops {
|
||||
int (*txrx_host_stats_get)(struct cdp_vdev *vdev,
|
||||
int (*txrx_host_stats_get)(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
struct ol_txrx_stats_req *req);
|
||||
|
||||
void (*txrx_host_stats_clr)(struct cdp_vdev *vdev);
|
||||
QDF_STATUS (*txrx_host_stats_clr)(struct cdp_soc_t *soc,
|
||||
uint8_t vdev_id);
|
||||
|
||||
void (*txrx_host_ce_stats)(struct cdp_vdev *vdev);
|
||||
QDF_STATUS
|
||||
(*txrx_host_ce_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
|
||||
|
||||
int (*txrx_stats_publish)(struct cdp_pdev *pdev,
|
||||
int (*txrx_stats_publish)(struct cdp_soc_t *soc, uint8_t pdev_id,
|
||||
struct cdp_stats_extd *buf);
|
||||
/**
|
||||
* @brief Enable enhanced stats functionality.
|
||||
*
|
||||
* @param pdev - the physical device object
|
||||
* @return - void
|
||||
* @param soc - the soc handle
|
||||
* @param pdev_id - pdev_id of pdev
|
||||
* @return - QDF_STATUS
|
||||
*/
|
||||
void (*txrx_enable_enhanced_stats)(struct cdp_pdev *pdev);
|
||||
QDF_STATUS (*txrx_enable_enhanced_stats)(struct cdp_soc_t *soc,
|
||||
uint8_t pdev_id);
|
||||
|
||||
/**
|
||||
* @brief Disable enhanced stats functionality.
|
||||
*
|
||||
* @param pdev - the physical device object
|
||||
* @return - void
|
||||
* @param soc - the soc handle
|
||||
* @param pdev_id - pdev_id of pdev
|
||||
* @return - QDF_STATUS
|
||||
*/
|
||||
void (*txrx_disable_enhanced_stats)(struct cdp_pdev *pdev);
|
||||
QDF_STATUS (*txrx_disable_enhanced_stats)(struct cdp_soc_t *soc,
|
||||
uint8_t pdev_id);
|
||||
|
||||
/**
|
||||
* @brief Get the desired stats from the message.
|
||||
*
|
||||
* @param pdev - the physical device object
|
||||
* @param stats_base - stats buffer received from FW
|
||||
* @param type - stats type.
|
||||
* @return - pointer to requested stat identified by type
|
||||
*/
|
||||
uint32_t * (*txrx_get_stats_base)(struct cdp_pdev *pdev,
|
||||
uint32_t *stats_base, uint32_t msg_len, uint8_t type);
|
||||
void
|
||||
(*tx_print_tso_stats)(struct cdp_vdev *vdev);
|
||||
QDF_STATUS
|
||||
(*tx_print_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
|
||||
|
||||
void
|
||||
(*tx_rst_tso_stats)(struct cdp_vdev *vdev);
|
||||
QDF_STATUS
|
||||
(*tx_rst_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
|
||||
|
||||
void
|
||||
(*tx_print_sg_stats)(struct cdp_vdev *vdev);
|
||||
QDF_STATUS
|
||||
(*tx_print_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
|
||||
|
||||
void
|
||||
(*tx_rst_sg_stats)(struct cdp_vdev *vdev);
|
||||
QDF_STATUS
|
||||
(*tx_rst_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
|
||||
|
||||
void
|
||||
(*print_rx_cksum_stats)(struct cdp_vdev *vdev);
|
||||
QDF_STATUS
|
||||
(*print_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
|
||||
|
||||
void
|
||||
(*rst_rx_cksum_stats)(struct cdp_vdev *vdev);
|
||||
QDF_STATUS
|
||||
(*rst_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
|
||||
|
||||
A_STATUS
|
||||
(*txrx_host_me_stats)(struct cdp_vdev *vdev);
|
||||
QDF_STATUS
|
||||
(*txrx_host_me_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
|
||||
|
||||
void
|
||||
(*txrx_per_peer_stats)(struct cdp_pdev *pdev, char *addr);
|
||||
QDF_STATUS
|
||||
(*txrx_per_peer_stats)(struct cdp_soc_t *soc, uint8_t *addr);
|
||||
|
||||
int (*txrx_host_msdu_ttl_stats)(struct cdp_vdev *vdev,
|
||||
int (*txrx_host_msdu_ttl_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
struct ol_txrx_stats_req *req);
|
||||
|
||||
void
|
||||
(*print_lro_stats)(struct cdp_vdev *vdev);
|
||||
int (*ol_txrx_update_peer_stats)(struct cdp_soc_t *soc,
|
||||
uint8_t pdev_id,
|
||||
uint8_t *addr, void *stats,
|
||||
uint32_t last_tx_rate_mcs,
|
||||
uint32_t stats_id);
|
||||
|
||||
void
|
||||
(*reset_lro_stats)(struct cdp_vdev *vdev);
|
||||
|
||||
void
|
||||
(*get_fw_peer_stats)(struct cdp_pdev *pdev, uint8_t *addr,
|
||||
QDF_STATUS
|
||||
(*get_fw_peer_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
|
||||
uint8_t *addr,
|
||||
uint32_t cap, uint32_t copy_stats);
|
||||
void
|
||||
(*get_htt_stats)(struct cdp_pdev *pdev, void *data,
|
||||
|
||||
QDF_STATUS
|
||||
(*get_htt_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
|
||||
void *data,
|
||||
uint32_t data_len);
|
||||
void
|
||||
(*txrx_update_pdev_stats)(struct cdp_pdev *pdev, void *data,
|
||||
QDF_STATUS
|
||||
(*txrx_update_pdev_stats)(struct cdp_soc_t *soc,
|
||||
uint8_t pdev_id, void *data,
|
||||
uint16_t stats_id);
|
||||
struct cdp_peer_stats*
|
||||
(*txrx_get_peer_stats)(struct cdp_peer *peer);
|
||||
void
|
||||
(*txrx_reset_peer_ald_stats)(struct cdp_peer *peer);
|
||||
void
|
||||
(*txrx_reset_peer_stats)(struct cdp_peer *peer);
|
||||
QDF_STATUS
|
||||
(*txrx_get_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
uint8_t *peer_mac,
|
||||
struct cdp_peer_stats *peer_stats);
|
||||
QDF_STATUS
|
||||
(*txrx_reset_peer_ald_stats)(struct cdp_soc_t *soc,
|
||||
uint8_t vdev_id,
|
||||
uint8_t *peer_mac);
|
||||
QDF_STATUS
|
||||
(*txrx_reset_peer_stats)(struct cdp_soc_t *soc,
|
||||
uint8_t vdev_id, uint8_t *peer_mac);
|
||||
int
|
||||
(*txrx_get_vdev_stats)(struct cdp_vdev *vdev, void *buf,
|
||||
bool is_aggregate);
|
||||
(*txrx_get_vdev_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
void *buf, bool is_aggregate);
|
||||
int
|
||||
(*txrx_process_wmi_host_vdev_stats)(ol_txrx_soc_handle soc,
|
||||
void *data, uint32_t len,
|
||||
uint32_t stats_id);
|
||||
int
|
||||
(*txrx_get_vdev_extd_stats)(struct cdp_vdev *vdev_handle,
|
||||
void *buffer);
|
||||
void
|
||||
(*txrx_update_vdev_stats)(struct cdp_vdev *vdev, void *buf,
|
||||
(*txrx_get_vdev_extd_stats)(struct cdp_soc_t *soc,
|
||||
uint8_t vdev_id,
|
||||
wmi_host_vdev_extd_stats *buffer);
|
||||
QDF_STATUS
|
||||
(*txrx_update_vdev_stats)(struct cdp_soc_t *soc,
|
||||
uint8_t vdev_id, void *buf,
|
||||
uint16_t stats_id);
|
||||
int
|
||||
(*txrx_get_radio_stats)(struct cdp_pdev *pdev,
|
||||
(*txrx_get_radio_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
|
||||
void *buf);
|
||||
struct cdp_pdev_stats*
|
||||
(*txrx_get_pdev_stats)(struct cdp_pdev *pdev);
|
||||
QDF_STATUS
|
||||
(*txrx_get_pdev_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
|
||||
struct cdp_pdev_stats *buf);
|
||||
int
|
||||
(*txrx_get_ratekbps)(int preamb, int mcs,
|
||||
int htflag, int gintval);
|
||||
void
|
||||
(*configure_rate_stats)(struct cdp_soc_t *soc,
|
||||
uint8_t val);
|
||||
|
||||
QDF_STATUS
|
||||
(*configure_rate_stats)(struct cdp_soc_t *soc, uint8_t val);
|
||||
|
||||
QDF_STATUS
|
||||
(*txrx_update_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
uint8_t *peer_mac, void *stats,
|
||||
uint32_t last_tx_rate_mcs,
|
||||
uint32_t stats_id);
|
||||
};
|
||||
|
||||
struct cdp_wds_ops {
|
||||
void
|
||||
(*txrx_set_wds_rx_policy)(struct cdp_vdev *vdev,
|
||||
QDF_STATUS
|
||||
(*txrx_set_wds_rx_policy)(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
u_int32_t val);
|
||||
void
|
||||
(*txrx_wds_peer_tx_policy_update)(struct cdp_peer *peer,
|
||||
QDF_STATUS
|
||||
(*txrx_wds_peer_tx_policy_update)(struct cdp_soc_t *soc,
|
||||
uint8_t vdev_id, uint8_t *peer_mac,
|
||||
int wds_tx_ucast, int wds_tx_mcast);
|
||||
int (*vdev_set_wds)(void *vdev, uint32_t val);
|
||||
int (*vdev_set_wds)(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
uint32_t val);
|
||||
};
|
||||
|
||||
struct cdp_raw_ops {
|
||||
int (*txrx_get_nwifi_mode)(struct cdp_vdev *vdev);
|
||||
int (*txrx_get_nwifi_mode)(struct cdp_soc_t *soc, uint8_t vdev_id);
|
||||
|
||||
void (*rsim_get_astentry)(struct cdp_vdev *vdev,
|
||||
qdf_nbuf_t *pnbuf,
|
||||
struct cdp_raw_ast *raw_ast);
|
||||
QDF_STATUS
|
||||
(*rsim_get_astentry)(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast);
|
||||
};
|
||||
|
||||
#ifdef PEER_FLOW_CONTROL
|
||||
struct cdp_pflow_ops {
|
||||
uint32_t(*pflow_update_pdev_params)(void *,
|
||||
enum _ol_ath_param_t, uint32_t, void *);
|
||||
uint32_t (*pflow_update_pdev_params)(struct cdp_soc_t *soc,
|
||||
uint8_t pdev_id,
|
||||
enum _ol_ath_param_t,
|
||||
uint32_t, void *);
|
||||
};
|
||||
#endif /* PEER_FLOW_CONTROL */
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "cdp_txrx_handle.h"
|
||||
|
||||
static inline uint32_t cdp_pflow_update_pdev_params
|
||||
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
|
||||
(ol_txrx_soc_handle soc, uint8_t pdev_id,
|
||||
enum _ol_ath_param_t param, uint32_t val, void *ctx)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
@@ -44,6 +44,6 @@ static inline uint32_t cdp_pflow_update_pdev_params
|
||||
return 0;
|
||||
|
||||
return soc->ops->pflow_ops->pflow_update_pdev_params
|
||||
(pdev, param, val, ctx);
|
||||
(soc, pdev_id, param, val, ctx);
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "cdp_txrx_ops.h"
|
||||
/* TODO: adf need to be replaced with qdf */
|
||||
static inline int cdp_get_nwifi_mode(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev)
|
||||
uint8_t vdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
@@ -41,7 +41,7 @@ static inline int cdp_get_nwifi_mode(ol_txrx_soc_handle soc,
|
||||
!soc->ops->raw_ops->txrx_get_nwifi_mode)
|
||||
return 0;
|
||||
|
||||
return soc->ops->raw_ops->txrx_get_nwifi_mode(vdev);
|
||||
return soc->ops->raw_ops->txrx_get_nwifi_mode(soc, vdev_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,15 +49,16 @@ static inline int cdp_get_nwifi_mode(ol_txrx_soc_handle soc,
|
||||
* @details: Finds the ast entry i.e 4th address for the packet based on the
|
||||
* details in the netbuf.
|
||||
*
|
||||
* @param vdev - the data virtual device object
|
||||
* @param soc - soc handle
|
||||
* @param vdev_id - id of the data virtual device object
|
||||
* @param pnbuf - pointer to nbuf
|
||||
* @param raw_ast - pointer to fill ast information
|
||||
*
|
||||
* @return - 0 on success, -1 on error, 1 if more nbufs need to be consumed.
|
||||
*/
|
||||
|
||||
static inline void
|
||||
cdp_rawsim_get_astentry (ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
|
||||
static inline QDF_STATUS
|
||||
cdp_rawsim_get_astentry(ol_txrx_soc_handle soc, uint8_t vdev_id,
|
||||
qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast)
|
||||
{
|
||||
|
||||
@@ -65,14 +66,15 @@ cdp_rawsim_get_astentry (ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!soc->ops->raw_ops ||
|
||||
!soc->ops->raw_ops->rsim_get_astentry)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
soc->ops->raw_ops->rsim_get_astentry(vdev, pnbuf, raw_ast);
|
||||
return soc->ops->raw_ops->rsim_get_astentry(soc, vdev_id,
|
||||
pnbuf, raw_ast);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -30,24 +30,24 @@
|
||||
* This flag sets the wds rx policy on the vdev. Rx frames not compliant
|
||||
* with the policy will be dropped.
|
||||
*
|
||||
* @param vdev - the data virtual device object
|
||||
* @param vdev_id - id of the data virtual device object
|
||||
* @param val - the wds rx policy bitmask
|
||||
* @return - void
|
||||
* @return - QDF_STATUS
|
||||
*/
|
||||
static inline void
|
||||
static inline QDF_STATUS
|
||||
cdp_set_wds_rx_policy(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev,
|
||||
uint8_t vdev_id,
|
||||
u_int32_t val)
|
||||
{
|
||||
if (!soc || !soc->ops || !soc->ops->wds_ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
|
||||
"%s invalid instance", __func__);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (soc->ops->wds_ops->txrx_set_wds_rx_policy)
|
||||
return soc->ops->wds_ops->txrx_set_wds_rx_policy(vdev, val);
|
||||
return;
|
||||
soc->ops->wds_ops->txrx_set_wds_rx_policy(soc, vdev_id, val);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,31 +56,34 @@ cdp_set_wds_rx_policy(ol_txrx_soc_handle soc,
|
||||
* This flag sets the wds rx policy on the vdev. Rx frames not compliant
|
||||
* with the policy will be dropped.
|
||||
*
|
||||
* @param vdev - the data virtual device object
|
||||
* @param psoc - psoc object
|
||||
* @param vdev_id - id of the data virtual device object
|
||||
* @param peer_mac - peer mac address
|
||||
* @param val - the wds rx policy bitmask
|
||||
* @return - void
|
||||
* @return - QDF_STATUS
|
||||
*/
|
||||
static inline void
|
||||
static inline QDF_STATUS
|
||||
cdp_set_wds_tx_policy_update(ol_txrx_soc_handle soc,
|
||||
struct cdp_peer *peer,
|
||||
uint8_t vdev_id, uint8_t *peer_mac,
|
||||
int wds_tx_ucast, int wds_tx_mcast)
|
||||
{
|
||||
if (!soc || !soc->ops || !soc->ops->wds_ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
|
||||
"%s invalid instance", __func__);
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (soc->ops->wds_ops->txrx_wds_peer_tx_policy_update)
|
||||
return soc->ops->wds_ops->txrx_wds_peer_tx_policy_update(
|
||||
peer, wds_tx_ucast, wds_tx_mcast);
|
||||
return;
|
||||
soc->ops->wds_ops->txrx_wds_peer_tx_policy_update(
|
||||
soc, vdev_id, peer_mac, wds_tx_ucast,
|
||||
wds_tx_mcast);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* cdp_vdev_set_wds() - Set/unset wds_enable flag in vdev
|
||||
* @soc - data path soc handle
|
||||
* @vdev - data path vap handle
|
||||
* @vdev_id - id of data path vap handle
|
||||
* @val - value to be set in wds_en flag
|
||||
*
|
||||
* This flag enables WDS source port learning feature on a vdev
|
||||
@@ -88,10 +91,10 @@ cdp_set_wds_tx_policy_update(ol_txrx_soc_handle soc,
|
||||
* return 1 on success
|
||||
*/
|
||||
static inline int
|
||||
cdp_vdev_set_wds(ol_txrx_soc_handle soc, void *vdev, uint32_t val)
|
||||
cdp_vdev_set_wds(ol_txrx_soc_handle soc, uint8_t vdev_id, uint32_t val)
|
||||
{
|
||||
if (soc->ops->wds_ops->vdev_set_wds)
|
||||
return soc->ops->wds_ops->vdev_set_wds(vdev, val);
|
||||
return soc->ops->wds_ops->vdev_set_wds(soc, vdev_id, val);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@@ -6144,17 +6144,23 @@ static uint8 *dp_get_vdev_mac_addr_wifi3(struct cdp_vdev *pvdev)
|
||||
|
||||
/*
|
||||
* dp_vdev_set_wds() - Enable per packet stats
|
||||
* @vdev_handle: DP VDEV handle
|
||||
* @soc: DP soc handle
|
||||
* @vdev_id: id of DP VDEV handle
|
||||
* @val: value
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
static int dp_vdev_set_wds(void *vdev_handle, uint32_t val)
|
||||
static int dp_vdev_set_wds(struct cdp_soc_t *soc, uint8_t vdev_id, uint32_t val)
|
||||
{
|
||||
struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
|
||||
struct dp_vdev *vdev =
|
||||
dp_get_vdev_from_soc_vdev_id_wifi3((struct dp_soc *)soc,
|
||||
vdev_id);
|
||||
|
||||
if (!vdev)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
vdev->wds_enabled = val;
|
||||
return 0;
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -6992,7 +6998,7 @@ void dp_aggregate_pdev_stats(struct dp_pdev *pdev)
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static void dp_vdev_getstats(void *vdev_handle,
|
||||
static void dp_vdev_getstats(struct cdp_vdev *vdev_handle,
|
||||
struct cdp_dev_stats *stats)
|
||||
{
|
||||
struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
|
||||
@@ -7047,7 +7053,7 @@ static void dp_vdev_getstats(void *vdev_handle,
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static void dp_pdev_getstats(void *pdev_handle,
|
||||
static void dp_pdev_getstats(struct cdp_pdev *pdev_handle,
|
||||
struct cdp_dev_stats *stats)
|
||||
{
|
||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
||||
@@ -7163,15 +7169,15 @@ void dp_print_napi_stats(struct dp_soc *soc)
|
||||
* dp_txrx_host_stats_clr(): Reinitialize the txrx stats
|
||||
* @vdev: DP_VDEV handle
|
||||
*
|
||||
* Return:void
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static inline void
|
||||
static inline QDF_STATUS
|
||||
dp_txrx_host_stats_clr(struct dp_vdev *vdev)
|
||||
{
|
||||
struct dp_peer *peer = NULL;
|
||||
|
||||
if (!vdev || !vdev->pdev)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
DP_STATS_CLR(vdev->pdev);
|
||||
DP_STATS_CLR(vdev->pdev->soc);
|
||||
@@ -7181,7 +7187,7 @@ dp_txrx_host_stats_clr(struct dp_vdev *vdev)
|
||||
|
||||
TAILQ_FOREACH(peer, &vdev->peer_list, peer_list_elem) {
|
||||
if (!peer)
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
DP_STATS_CLR(peer);
|
||||
|
||||
#if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE
|
||||
@@ -7196,43 +7202,37 @@ dp_txrx_host_stats_clr(struct dp_vdev *vdev)
|
||||
&vdev->stats, vdev->vdev_id,
|
||||
UPDATE_VDEV_STATS, vdev->pdev->pdev_id);
|
||||
#endif
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* dp_get_host_peer_stats()- function to print peer stats
|
||||
* @pdev_handle: DP_PDEV handle
|
||||
* @soc: dp_soc handle
|
||||
* @mac_addr: mac address of the peer
|
||||
*
|
||||
* Return: void
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static void
|
||||
dp_get_host_peer_stats(struct cdp_pdev *pdev_handle, char *mac_addr)
|
||||
static QDF_STATUS
|
||||
dp_get_host_peer_stats(struct cdp_soc_t *soc, uint8_t *mac_addr)
|
||||
{
|
||||
struct dp_peer *peer;
|
||||
|
||||
if (!mac_addr) {
|
||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||
"Invalid MAC address\n");
|
||||
return;
|
||||
}
|
||||
|
||||
peer = (struct dp_peer *)dp_find_peer_by_addr(pdev_handle, mac_addr);
|
||||
|
||||
if (!peer) {
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct dp_peer *peer = dp_peer_find_hash_find((struct dp_soc *)soc,
|
||||
mac_addr, 0,
|
||||
DP_VDEV_ALL);
|
||||
if (!peer || peer->delete_in_progress) {
|
||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: Invalid peer\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Making sure the peer is for the specific pdev */
|
||||
if ((struct dp_pdev *)pdev_handle != peer->vdev->pdev) {
|
||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: Peer is not for this pdev\n", __func__);
|
||||
return;
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
dp_print_peer_stats(peer);
|
||||
dp_peer_rxtid_stats(peer, dp_rx_tid_stats_cb, NULL);
|
||||
fail:
|
||||
if (peer)
|
||||
dp_peer_unref_delete(peer);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -7283,10 +7283,9 @@ static void dp_txrx_stats_help(void)
|
||||
* Return: 0 on success, print error message in case of failure
|
||||
*/
|
||||
static int
|
||||
dp_print_host_stats(struct cdp_vdev *vdev_handle,
|
||||
dp_print_host_stats(struct dp_vdev *vdev,
|
||||
struct cdp_txrx_stats_req *req)
|
||||
{
|
||||
struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
|
||||
struct dp_pdev *pdev = (struct dp_pdev *)vdev->pdev;
|
||||
enum cdp_host_txrx_stats type =
|
||||
dp_stats_mapping_table[req->stats][STATS_HOST];
|
||||
@@ -7322,7 +7321,8 @@ dp_print_host_stats(struct cdp_vdev *vdev_handle,
|
||||
dp_print_pdev_rx_mon_stats(pdev);
|
||||
break;
|
||||
case TXRX_REO_QUEUE_STATS:
|
||||
dp_get_host_peer_stats((struct cdp_pdev *)pdev, req->peer_addr);
|
||||
dp_get_host_peer_stats((struct cdp_soc_t *)pdev->soc,
|
||||
req->peer_addr);
|
||||
break;
|
||||
case TXRX_SOC_CFG_PARAMS:
|
||||
dp_print_soc_cfg_params(pdev->soc);
|
||||
@@ -7499,11 +7499,9 @@ dp_set_bpr_enable(struct cdp_pdev *pdev_handle, int val)
|
||||
* Return: void
|
||||
*/
|
||||
static void
|
||||
dp_pdev_tid_stats_ingress_inc(struct cdp_pdev *pdev, uint32_t val)
|
||||
dp_pdev_tid_stats_ingress_inc(struct dp_pdev *pdev, uint32_t val)
|
||||
{
|
||||
struct dp_pdev *dp_pdev = (struct dp_pdev *)pdev;
|
||||
|
||||
dp_pdev->stats.tid_stats.ingress_stack += val;
|
||||
pdev->stats.tid_stats.ingress_stack += val;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7514,11 +7512,9 @@ dp_pdev_tid_stats_ingress_inc(struct cdp_pdev *pdev, uint32_t val)
|
||||
* Return: void
|
||||
*/
|
||||
static void
|
||||
dp_pdev_tid_stats_osif_drop(struct cdp_pdev *pdev, uint32_t val)
|
||||
dp_pdev_tid_stats_osif_drop(struct dp_pdev *pdev, uint32_t val)
|
||||
{
|
||||
struct dp_pdev *dp_pdev = (struct dp_pdev *)pdev;
|
||||
|
||||
dp_pdev->stats.tid_stats.osif_drop += val;
|
||||
pdev->stats.tid_stats.osif_drop += val;
|
||||
}
|
||||
|
||||
|
||||
@@ -7596,14 +7592,20 @@ dp_config_debug_sniffer(struct cdp_pdev *pdev_handle, int val)
|
||||
|
||||
/*
|
||||
* dp_enable_enhanced_stats()- API to enable enhanced statistcs
|
||||
* @pdev_handle: DP_PDEV handle
|
||||
* @soc_handle: DP_SOC handle
|
||||
* @pdev_id: id of DP_PDEV handle
|
||||
*
|
||||
* Return: void
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static void
|
||||
dp_enable_enhanced_stats(struct cdp_pdev *pdev_handle)
|
||||
static QDF_STATUS
|
||||
dp_enable_enhanced_stats(struct cdp_soc_t *soc, uint8_t pdev_id)
|
||||
{
|
||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
||||
struct dp_pdev *pdev =
|
||||
dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
|
||||
pdev_id);
|
||||
|
||||
if (!pdev)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
if (pdev->enhanced_stats_en == 0)
|
||||
dp_cal_client_timer_start(pdev->cal_client_ctx);
|
||||
@@ -7621,18 +7623,26 @@ dp_enable_enhanced_stats(struct cdp_pdev *pdev_handle)
|
||||
DP_PPDU_STATS_CFG_BPR_ENH,
|
||||
pdev->pdev_id);
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* dp_disable_enhanced_stats()- API to disable enhanced statistcs
|
||||
* @pdev_handle: DP_PDEV handle
|
||||
*
|
||||
* Return: void
|
||||
* @param soc - the soc handle
|
||||
* @param pdev_id - pdev_id of pdev
|
||||
* @return - QDF_STATUS
|
||||
*/
|
||||
static void
|
||||
dp_disable_enhanced_stats(struct cdp_pdev *pdev_handle)
|
||||
static QDF_STATUS
|
||||
dp_disable_enhanced_stats(struct cdp_soc_t *soc, uint8_t pdev_id)
|
||||
{
|
||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
||||
struct dp_pdev *pdev =
|
||||
dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
|
||||
pdev_id);
|
||||
|
||||
if (!pdev)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
if (pdev->enhanced_stats_en == 1)
|
||||
dp_cal_client_timer_stop(pdev->cal_client_ctx);
|
||||
@@ -7650,11 +7660,14 @@ dp_disable_enhanced_stats(struct cdp_pdev *pdev_handle)
|
||||
if (!pdev->mcopy_mode && !pdev->neighbour_peers_added &&
|
||||
!pdev->monitor_vdev)
|
||||
dp_ppdu_ring_reset(pdev);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* dp_get_fw_peer_stats()- function to print peer stats
|
||||
* @pdev_handle: DP_PDEV handle
|
||||
* @soc: soc handle
|
||||
* @pdev_id : id of the pdev handle
|
||||
* @mac_addr: mac address of the peer
|
||||
* @cap: Type of htt stats requested
|
||||
* @is_wait: if set, wait on completion from firmware response
|
||||
@@ -7664,18 +7677,24 @@ dp_disable_enhanced_stats(struct cdp_pdev *pdev_handle)
|
||||
* 2: HTT_PEER_STATS_REQ_MODE_QUERY_TQM
|
||||
* 3: HTT_PEER_STATS_REQ_MODE_FLUSH_TQM
|
||||
*
|
||||
* Return: void
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static void
|
||||
dp_get_fw_peer_stats(struct cdp_pdev *pdev_handle, uint8_t *mac_addr,
|
||||
static QDF_STATUS
|
||||
dp_get_fw_peer_stats(struct cdp_soc_t *soc, uint8_t pdev_id,
|
||||
uint8_t *mac_addr,
|
||||
uint32_t cap, uint32_t is_wait)
|
||||
{
|
||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
||||
int i;
|
||||
uint32_t config_param0 = 0;
|
||||
uint32_t config_param1 = 0;
|
||||
uint32_t config_param2 = 0;
|
||||
uint32_t config_param3 = 0;
|
||||
struct dp_pdev *pdev =
|
||||
dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
|
||||
pdev_id);
|
||||
|
||||
if (!pdev)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_SET(config_param0, 1);
|
||||
config_param0 |= (1 << (cap + 1));
|
||||
@@ -7707,6 +7726,8 @@ dp_get_fw_peer_stats(struct cdp_pdev *pdev_handle, uint8_t *mac_addr,
|
||||
0, 0, 0);
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
/* This struct definition will be removed from here
|
||||
@@ -7722,23 +7743,32 @@ struct httstats_cmd_req {
|
||||
|
||||
/*
|
||||
* dp_get_htt_stats: function to process the httstas request
|
||||
* @pdev_handle: DP pdev handle
|
||||
* @soc: DP soc handle
|
||||
* @pdev_id: id of pdev handle
|
||||
* @data: pointer to request data
|
||||
* @data_len: length for request data
|
||||
*
|
||||
* return: void
|
||||
* return: QDF_STATUS
|
||||
*/
|
||||
static void
|
||||
dp_get_htt_stats(struct cdp_pdev *pdev_handle, void *data, uint32_t data_len)
|
||||
static QDF_STATUS
|
||||
dp_get_htt_stats(struct cdp_soc_t *soc, uint8_t pdev_id, void *data,
|
||||
uint32_t data_len)
|
||||
{
|
||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
||||
struct httstats_cmd_req *req = (struct httstats_cmd_req *)data;
|
||||
struct dp_pdev *pdev =
|
||||
dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
|
||||
pdev_id);
|
||||
|
||||
if (!pdev)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
QDF_ASSERT(data_len == sizeof(struct httstats_cmd_req));
|
||||
dp_h2t_ext_stats_msg_send(pdev, req->stats_id,
|
||||
req->config_param0, req->config_param1,
|
||||
req->config_param2, req->config_param3,
|
||||
req->cookie, 0, 0);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7769,10 +7799,10 @@ static QDF_STATUS dp_set_pdev_param(struct cdp_pdev *pdev_handle,
|
||||
pdev->latency_capture_enable = false;
|
||||
break;
|
||||
case CDP_INGRESS_STATS:
|
||||
dp_pdev_tid_stats_ingress_inc(pdev_handle, val);
|
||||
dp_pdev_tid_stats_ingress_inc(pdev, val);
|
||||
break;
|
||||
case CDP_OSIF_DROP:
|
||||
dp_pdev_tid_stats_osif_drop(pdev_handle, val);
|
||||
dp_pdev_tid_stats_osif_drop(pdev, val);
|
||||
break;
|
||||
case CDP_CONFIG_ENH_RX_CAPTURE:
|
||||
return dp_config_enh_rx_capture(pdev_handle, val);
|
||||
@@ -8015,18 +8045,26 @@ static int dp_txrx_get_ratekbps(int preamb, int mcs,
|
||||
#endif
|
||||
|
||||
/* dp_txrx_get_pdev_stats - Returns cdp_pdev_stats
|
||||
* @peer_handle: DP pdev handle
|
||||
* @soc: DP soc handle
|
||||
* @pdev_id: id of DP pdev handle
|
||||
* @pdev_stats: buffer to copy to
|
||||
*
|
||||
* return : cdp_pdev_stats pointer
|
||||
* return : status success/failure
|
||||
*/
|
||||
static struct cdp_pdev_stats*
|
||||
dp_txrx_get_pdev_stats(struct cdp_pdev *pdev_handle)
|
||||
static QDF_STATUS
|
||||
dp_txrx_get_pdev_stats(struct cdp_soc_t *soc, uint8_t pdev_id,
|
||||
struct cdp_pdev_stats *pdev_stats)
|
||||
{
|
||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
||||
struct dp_pdev *pdev =
|
||||
dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
|
||||
pdev_id);
|
||||
if (!pdev)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
dp_aggregate_pdev_stats(pdev);
|
||||
|
||||
return &pdev->stats;
|
||||
qdf_mem_copy(pdev_stats, &pdev->stats, sizeof(struct cdp_pdev_stats));
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* dp_txrx_update_vdev_me_stats(): Update vdev ME stats sent from CDP
|
||||
@@ -8035,19 +8073,11 @@ dp_txrx_get_pdev_stats(struct cdp_pdev *pdev_handle)
|
||||
*
|
||||
* Returns: void
|
||||
*/
|
||||
static void dp_txrx_update_vdev_me_stats(struct cdp_vdev *vdev_handle,
|
||||
static void dp_txrx_update_vdev_me_stats(struct dp_vdev *vdev,
|
||||
void *buf)
|
||||
{
|
||||
struct dp_vdev *vdev = NULL;
|
||||
struct cdp_tx_ingress_stats *host_stats = NULL;
|
||||
|
||||
if (!vdev_handle) {
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||
"Invalid vdev handle");
|
||||
return;
|
||||
}
|
||||
vdev = (struct dp_vdev *)vdev_handle;
|
||||
|
||||
if (!buf) {
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||
"Invalid host stats buf");
|
||||
@@ -8073,55 +8103,96 @@ static void dp_txrx_update_vdev_me_stats(struct cdp_vdev *vdev_handle,
|
||||
}
|
||||
|
||||
/* dp_txrx_update_vdev_host_stats(): Update stats sent through CDP
|
||||
* @vdev_handle: DP vdev handle
|
||||
* @soc: DP soc handle
|
||||
* @vdev_id: id of DP vdev handle
|
||||
* @buf: buffer containing specific stats structure
|
||||
* @stats_id: stats type
|
||||
*
|
||||
* Returns: void
|
||||
* Returns: QDF_STATUS
|
||||
*/
|
||||
static void dp_txrx_update_vdev_host_stats(struct cdp_vdev *vdev_handle,
|
||||
static QDF_STATUS dp_txrx_update_vdev_host_stats(struct cdp_soc_t *soc,
|
||||
uint8_t vdev_id,
|
||||
void *buf,
|
||||
uint16_t stats_id)
|
||||
{
|
||||
struct dp_vdev *vdev =
|
||||
dp_get_vdev_from_soc_vdev_id_wifi3((struct dp_soc *)soc,
|
||||
vdev_id);
|
||||
if (!vdev) {
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||
"Invalid vdev handle");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
switch (stats_id) {
|
||||
case DP_VDEV_STATS_PKT_CNT_ONLY:
|
||||
break;
|
||||
case DP_VDEV_STATS_TX_ME:
|
||||
dp_txrx_update_vdev_me_stats(vdev_handle, buf);
|
||||
dp_txrx_update_vdev_me_stats(vdev, buf);
|
||||
break;
|
||||
default:
|
||||
qdf_info("Invalid stats_id %d", stats_id);
|
||||
break;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* dp_txrx_get_peer_stats - will return cdp_peer_stats
|
||||
* @peer_handle: DP_PEER handle
|
||||
*
|
||||
* return : cdp_peer_stats pointer
|
||||
* @soc: soc handle
|
||||
* @vdev_id: id of vdev handle
|
||||
* @peer_mac: mac of DP_PEER handle
|
||||
* @peer_stats: buffer to copy to
|
||||
* return : status success/failure
|
||||
*/
|
||||
static struct cdp_peer_stats*
|
||||
dp_txrx_get_peer_stats(struct cdp_peer *peer_handle)
|
||||
static QDF_STATUS
|
||||
dp_txrx_get_peer_stats(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
uint8_t *peer_mac, struct cdp_peer_stats *peer_stats)
|
||||
{
|
||||
struct dp_peer *peer = (struct dp_peer *)peer_handle;
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct dp_peer *peer = dp_peer_find_hash_find((struct dp_soc *)soc,
|
||||
peer_mac, 0, vdev_id);
|
||||
|
||||
qdf_assert(peer);
|
||||
if (!peer || peer->delete_in_progress) {
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
goto fail;
|
||||
} else
|
||||
qdf_mem_copy(peer_stats, &peer->stats,
|
||||
sizeof(struct cdp_peer_stats));
|
||||
|
||||
return &peer->stats;
|
||||
fail:
|
||||
if (peer)
|
||||
dp_peer_unref_delete(peer);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/* dp_txrx_reset_peer_stats - reset cdp_peer_stats for particular peer
|
||||
* @peer_handle: DP_PEER handle
|
||||
* @soc: soc handle
|
||||
* @vdev_id: id of vdev handle
|
||||
* @peer_mac: mac of DP_PEER handle
|
||||
*
|
||||
* return : void
|
||||
* return : QDF_STATUS
|
||||
*/
|
||||
static void dp_txrx_reset_peer_stats(struct cdp_peer *peer_handle)
|
||||
static QDF_STATUS
|
||||
dp_txrx_reset_peer_stats(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
uint8_t *peer_mac)
|
||||
{
|
||||
struct dp_peer *peer = (struct dp_peer *)peer_handle;
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct dp_peer *peer = dp_peer_find_hash_find((struct dp_soc *)soc,
|
||||
peer_mac, 0, vdev_id);
|
||||
|
||||
qdf_assert(peer);
|
||||
if (!peer || peer->delete_in_progress) {
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
qdf_mem_zero(&peer->stats, sizeof(peer->stats));
|
||||
|
||||
fail:
|
||||
if (peer)
|
||||
dp_peer_unref_delete(peer);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/* dp_txrx_get_vdev_stats - Update buffer with cdp_vdev_stats
|
||||
@@ -8130,13 +8201,14 @@ static void dp_txrx_reset_peer_stats(struct cdp_peer *peer_handle)
|
||||
*
|
||||
* return : int
|
||||
*/
|
||||
static int dp_txrx_get_vdev_stats(struct cdp_vdev *vdev_handle, void *buf,
|
||||
bool is_aggregate)
|
||||
static int dp_txrx_get_vdev_stats(struct cdp_soc_t *soc, uint8_t vdev_id,
|
||||
void *buf, bool is_aggregate)
|
||||
{
|
||||
struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
|
||||
struct dp_vdev *vdev =
|
||||
dp_get_vdev_from_soc_vdev_id_wifi3((struct dp_soc *)soc,
|
||||
vdev_id);
|
||||
struct cdp_vdev_stats *vdev_stats;
|
||||
struct dp_pdev *pdev;
|
||||
struct dp_soc *soc;
|
||||
|
||||
if (!vdev)
|
||||
return 1;
|
||||
@@ -8145,13 +8217,12 @@ static int dp_txrx_get_vdev_stats(struct cdp_vdev *vdev_handle, void *buf,
|
||||
if (!pdev)
|
||||
return 1;
|
||||
|
||||
soc = pdev->soc;
|
||||
vdev_stats = (struct cdp_vdev_stats *)buf;
|
||||
|
||||
if (is_aggregate) {
|
||||
qdf_spin_lock_bh(&soc->peer_ref_mutex);
|
||||
qdf_spin_lock_bh(&((struct dp_soc *)soc)->peer_ref_mutex);
|
||||
dp_aggregate_vdev_stats(vdev, buf);
|
||||
qdf_spin_unlock_bh(&soc->peer_ref_mutex);
|
||||
qdf_spin_unlock_bh(&((struct dp_soc *)soc)->peer_ref_mutex);
|
||||
} else {
|
||||
qdf_mem_copy(vdev_stats, &vdev->stats, sizeof(vdev->stats));
|
||||
}
|
||||
@@ -8178,17 +8249,23 @@ static int dp_get_total_per(struct cdp_pdev *pdev_handle)
|
||||
|
||||
/*
|
||||
* dp_txrx_stats_publish(): publish pdev stats into a buffer
|
||||
* @pdev_handle: DP_PDEV handle
|
||||
* @pdev_handle: DP soc handle
|
||||
* @pdev_id: id of DP_PDEV handle
|
||||
* @buf: to hold pdev_stats
|
||||
*
|
||||
* Return: int
|
||||
*/
|
||||
static int
|
||||
dp_txrx_stats_publish(struct cdp_pdev *pdev_handle, struct cdp_stats_extd *buf)
|
||||
dp_txrx_stats_publish(struct cdp_soc_t *soc, uint8_t pdev_id,
|
||||
struct cdp_stats_extd *buf)
|
||||
{
|
||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
||||
struct cdp_pdev_stats *buffer = (struct cdp_pdev_stats *) buf;
|
||||
struct cdp_txrx_stats_req req = {0,};
|
||||
struct dp_pdev *pdev =
|
||||
dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
|
||||
pdev_id);
|
||||
|
||||
if (!pdev)
|
||||
return TXRX_STATS_LEVEL_OFF;
|
||||
|
||||
dp_aggregate_pdev_stats(pdev);
|
||||
req.stats = (enum cdp_stats)HTT_DBG_EXT_STATS_PDEV_TX;
|
||||
@@ -8206,7 +8283,7 @@ dp_txrx_stats_publish(struct cdp_pdev *pdev_handle, struct cdp_stats_extd *buf)
|
||||
req.cookie_val, 0);
|
||||
|
||||
msleep(DP_MAX_SLEEP_TIME);
|
||||
qdf_mem_copy(buffer, &pdev->stats, sizeof(pdev->stats));
|
||||
qdf_mem_copy(buf, &pdev->stats, sizeof(struct cdp_stats_extd));
|
||||
|
||||
return TXRX_STATS_LEVEL;
|
||||
}
|
||||
@@ -8276,10 +8353,9 @@ static void dp_set_hmmc_tid_val_wifi3(struct cdp_pdev *pdev_handle,
|
||||
*
|
||||
* return: int
|
||||
*/
|
||||
static int dp_fw_stats_process(struct cdp_vdev *vdev_handle,
|
||||
static int dp_fw_stats_process(struct dp_vdev *vdev,
|
||||
struct cdp_txrx_stats_req *req)
|
||||
{
|
||||
struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
|
||||
struct dp_pdev *pdev = NULL;
|
||||
uint32_t stats = req->stats;
|
||||
uint8_t mac_id = req->mac_id;
|
||||
@@ -8376,12 +8452,12 @@ QDF_STATUS dp_txrx_stats_request(struct cdp_soc_t *soc_handle,
|
||||
if (fw_stats != TXRX_FW_STATS_INVALID) {
|
||||
/* update request with FW stats type */
|
||||
req->stats = fw_stats;
|
||||
return dp_fw_stats_process(vdev, req);
|
||||
return dp_fw_stats_process((struct dp_vdev *)vdev, req);
|
||||
}
|
||||
|
||||
if ((host_stats != TXRX_HOST_STATS_INVALID) &&
|
||||
(host_stats <= TXRX_HOST_STATS_MAX))
|
||||
return dp_print_host_stats(vdev, req);
|
||||
return dp_print_host_stats((struct dp_vdev *)vdev, req);
|
||||
else
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
|
||||
"Wrong Input for TxRx Stats");
|
||||
@@ -8883,7 +8959,6 @@ dp_set_rx_flow_tag(struct cdp_pdev *pdev_handle,
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* dp_dump_rx_flow_tag_stats - dump the number of packets tagged for
|
||||
* given flow 5-tuple
|
||||
@@ -8921,12 +8996,14 @@ static QDF_STATUS dp_peer_map_attach_wifi3(struct cdp_soc_t *soc_hdl,
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static void dp_set_rate_stats_cap(struct cdp_soc_t *soc_hdl,
|
||||
static QDF_STATUS dp_set_rate_stats_cap(struct cdp_soc_t *soc_hdl,
|
||||
uint8_t val)
|
||||
{
|
||||
struct dp_soc *soc = (struct dp_soc *)soc_hdl;
|
||||
|
||||
soc->wlanstats_enabled = val;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static void dp_soc_set_rate_stats_ctx(struct cdp_soc_t *soc_handle,
|
||||
@@ -9043,7 +9120,8 @@ static uint32_t dp_get_cfg(void *soc, enum cdp_dp_cfg cfg)
|
||||
#ifdef PEER_FLOW_CONTROL
|
||||
/**
|
||||
* dp_tx_flow_ctrl_configure_pdev() - Configure flow control params
|
||||
* @pdev_hdl: datapath pdev handle
|
||||
* @soc_handle: datapath soc handle
|
||||
* @pdev_id: id of datapath pdev handle
|
||||
* @param: ol ath params
|
||||
* @value: value of the flag
|
||||
* @buff: Buffer to be passed
|
||||
@@ -9053,12 +9131,15 @@ static uint32_t dp_get_cfg(void *soc, enum cdp_dp_cfg cfg)
|
||||
*
|
||||
* Return: 0 for success. nonzero for failure.
|
||||
*/
|
||||
static uint32_t dp_tx_flow_ctrl_configure_pdev(void *pdev_handle,
|
||||
static uint32_t dp_tx_flow_ctrl_configure_pdev(struct cdp_soc_t *soc_handle,
|
||||
uint8_t pdev_id,
|
||||
enum _ol_ath_param_t param,
|
||||
uint32_t value, void *buff)
|
||||
{
|
||||
struct dp_soc *soc = NULL;
|
||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
||||
struct dp_soc *soc = (struct dp_soc *)soc_handle;
|
||||
struct dp_pdev *pdev =
|
||||
dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
|
||||
pdev_id);
|
||||
|
||||
if (qdf_unlikely(!pdev))
|
||||
return 1;
|
||||
|
Référencer dans un nouveau ticket
Bloquer un utilisateur