qcacmn: Add Null checks in CDP Layer
Part-2: Add Null checks for all the API's in CDP Layer. Change-Id: I8a4628f79880aff1212dee132016e8e48fe721fc CRs-Fixed: 2136173
This commit is contained in:

committed by
snandini

parent
aa62ae7615
commit
c4a6b8480b
@@ -43,11 +43,20 @@ static inline int cdp_host_stats_get(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev,
|
||||
struct ol_txrx_stats_req *req)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->txrx_host_stats_get)
|
||||
return soc->ops->host_stats_ops->txrx_host_stats_get(vdev, req);
|
||||
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_host_stats_get)
|
||||
return 0;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_host_stats_get(vdev, req);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdp_host_stats_clr: cdp call to clear host stats
|
||||
* @vdev: vdev handle
|
||||
@@ -57,27 +66,55 @@ static inline int cdp_host_stats_get(ol_txrx_soc_handle soc,
|
||||
static inline void
|
||||
cdp_host_stats_clr(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->txrx_host_stats_clr)
|
||||
return soc->ops->host_stats_ops->txrx_host_stats_clr(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->txrx_host_stats_clr)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->txrx_host_stats_clr(vdev);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_host_ce_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->txrx_host_ce_stats)
|
||||
return soc->ops->host_stats_ops->txrx_host_ce_stats(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->txrx_host_ce_stats)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->txrx_host_ce_stats(vdev);
|
||||
}
|
||||
|
||||
static inline int cdp_stats_publish
|
||||
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
|
||||
struct ol_txrx_stats *buf)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->txrx_stats_publish)
|
||||
return soc->ops->host_stats_ops->txrx_stats_publish(pdev, buf);
|
||||
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_stats_publish)
|
||||
return 0;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_stats_publish(pdev, buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable enhanced stats functionality.
|
||||
*
|
||||
@@ -87,12 +124,21 @@ static inline int cdp_stats_publish
|
||||
static inline void
|
||||
cdp_enable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->txrx_enable_enhanced_stats)
|
||||
return soc->ops->host_stats_ops->txrx_enable_enhanced_stats
|
||||
(pdev);
|
||||
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->txrx_enable_enhanced_stats)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->txrx_enable_enhanced_stats
|
||||
(pdev);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable enhanced stats functionality.
|
||||
*
|
||||
@@ -102,12 +148,21 @@ cdp_enable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
|
||||
static inline void
|
||||
cdp_disable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->txrx_disable_enhanced_stats)
|
||||
return soc->ops->host_stats_ops->txrx_disable_enhanced_stats
|
||||
(pdev);
|
||||
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->txrx_disable_enhanced_stats)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->txrx_disable_enhanced_stats
|
||||
(pdev);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the desired stats from the message.
|
||||
*
|
||||
@@ -120,115 +175,232 @@ 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)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->txrx_get_stats_base)
|
||||
return (uint32_t *)soc->ops->host_stats_ops->txrx_get_stats_base
|
||||
(pdev, stats_base, msg_len, type);
|
||||
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->ops->host_stats_ops->tx_print_tso_stats)
|
||||
return soc->ops->host_stats_ops->tx_print_tso_stats(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->tx_print_tso_stats)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->tx_print_tso_stats(vdev);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_tx_rst_tso_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->tx_rst_tso_stats)
|
||||
return soc->ops->host_stats_ops->tx_rst_tso_stats(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->tx_rst_tso_stats)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->tx_rst_tso_stats(vdev);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_tx_print_sg_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->tx_print_sg_stats)
|
||||
return soc->ops->host_stats_ops->tx_print_sg_stats(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->tx_print_sg_stats)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->tx_print_sg_stats(vdev);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_tx_rst_sg_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->tx_rst_sg_stats)
|
||||
return soc->ops->host_stats_ops->tx_rst_sg_stats(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->tx_rst_sg_stats)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->tx_rst_sg_stats(vdev);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_print_rx_cksum_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->print_rx_cksum_stats)
|
||||
return soc->ops->host_stats_ops->print_rx_cksum_stats(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->print_rx_cksum_stats)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->print_rx_cksum_stats(vdev);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_rst_rx_cksum_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->rst_rx_cksum_stats)
|
||||
return soc->ops->host_stats_ops->rst_rx_cksum_stats(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->rst_rx_cksum_stats)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->rst_rx_cksum_stats(vdev);
|
||||
}
|
||||
|
||||
static inline A_STATUS
|
||||
cdp_host_me_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->txrx_host_me_stats)
|
||||
return soc->ops->host_stats_ops->txrx_host_me_stats(vdev);
|
||||
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_host_me_stats)
|
||||
return 0;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_host_me_stats(vdev);
|
||||
}
|
||||
|
||||
static inline void cdp_per_peer_stats
|
||||
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, char *addr)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->txrx_per_peer_stats)
|
||||
return soc->ops->host_stats_ops->txrx_per_peer_stats
|
||||
(pdev, addr);
|
||||
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->txrx_per_peer_stats)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->txrx_per_peer_stats
|
||||
(pdev, addr);
|
||||
}
|
||||
|
||||
static inline int cdp_host_msdu_ttl_stats(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev,
|
||||
struct ol_txrx_stats_req *req)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->txrx_host_msdu_ttl_stats)
|
||||
return soc->ops->host_stats_ops->txrx_host_msdu_ttl_stats
|
||||
(vdev, req);
|
||||
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_host_msdu_ttl_stats)
|
||||
return 0;
|
||||
|
||||
return soc->ops->host_stats_ops->txrx_host_msdu_ttl_stats
|
||||
(vdev, req);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_print_lro_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->print_lro_stats)
|
||||
return soc->ops->host_stats_ops->print_lro_stats(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->print_lro_stats)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->print_lro_stats(vdev);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_reset_lro_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->reset_lro_stats)
|
||||
return soc->ops->host_stats_ops->reset_lro_stats(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)
|
||||
{
|
||||
if (soc->ops->host_stats_ops->get_fw_peer_stats)
|
||||
return soc->ops->host_stats_ops->get_fw_peer_stats
|
||||
(pdev, mac, caps);
|
||||
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->get_fw_peer_stats)
|
||||
return;
|
||||
|
||||
soc->ops->host_stats_ops->get_fw_peer_stats
|
||||
(pdev, mac, caps);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Parse the stats header and get the payload from the message.
|
||||
*
|
||||
|
@@ -40,59 +40,114 @@ static inline u_int16_t
|
||||
cdp_tx_desc_alloc_and_mark_for_mcast_clone(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev, u_int16_t buf_count)
|
||||
{
|
||||
if (soc->ops->me_ops->tx_desc_alloc_and_mark_for_mcast_clone)
|
||||
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->me_ops ||
|
||||
!soc->ops->me_ops->tx_desc_alloc_and_mark_for_mcast_clone)
|
||||
return 0;
|
||||
|
||||
return soc->ops->me_ops->
|
||||
tx_desc_alloc_and_mark_for_mcast_clone
|
||||
(pdev, buf_count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline u_int16_t
|
||||
cdp_tx_desc_free_and_unmark_for_mcast_clone(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev, u_int16_t buf_count)
|
||||
{
|
||||
if (soc->ops->me_ops->tx_desc_free_and_unmark_for_mcast_clone)
|
||||
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->me_ops ||
|
||||
!soc->ops->me_ops->tx_desc_free_and_unmark_for_mcast_clone)
|
||||
return 0;
|
||||
|
||||
return soc->ops->me_ops->
|
||||
tx_desc_free_and_unmark_for_mcast_clone
|
||||
(pdev, buf_count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline u_int16_t
|
||||
cdp_tx_get_mcast_buf_allocated_marked(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev)
|
||||
{
|
||||
if (soc->ops->me_ops->tx_get_mcast_buf_allocated_marked)
|
||||
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->me_ops ||
|
||||
!soc->ops->me_ops->tx_get_mcast_buf_allocated_marked)
|
||||
return 0;
|
||||
|
||||
return soc->ops->me_ops->tx_get_mcast_buf_allocated_marked
|
||||
(pdev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_tx_me_alloc_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
|
||||
{
|
||||
if (soc->ops->me_ops->tx_me_alloc_descriptor)
|
||||
return soc->ops->me_ops->tx_me_alloc_descriptor(pdev);
|
||||
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->me_ops ||
|
||||
!soc->ops->me_ops->tx_me_alloc_descriptor)
|
||||
return;
|
||||
|
||||
soc->ops->me_ops->tx_me_alloc_descriptor(pdev);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_tx_me_free_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
|
||||
{
|
||||
if (soc->ops->me_ops->tx_me_free_descriptor)
|
||||
return soc->ops->me_ops->tx_me_free_descriptor(pdev);
|
||||
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->me_ops ||
|
||||
!soc->ops->me_ops->tx_me_free_descriptor)
|
||||
return;
|
||||
|
||||
soc->ops->me_ops->tx_me_free_descriptor(pdev);
|
||||
}
|
||||
|
||||
static inline uint16_t
|
||||
cdp_tx_me_convert_ucast(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
|
||||
qdf_nbuf_t wbuf, u_int8_t newmac[][6], uint8_t newmaccnt)
|
||||
{
|
||||
if (soc->ops->me_ops->tx_me_convert_ucast)
|
||||
return soc->ops->me_ops->tx_me_convert_ucast
|
||||
(vdev, wbuf, newmac, newmaccnt);
|
||||
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->me_ops ||
|
||||
!soc->ops->me_ops->tx_me_convert_ucast)
|
||||
return 0;
|
||||
|
||||
return soc->ops->me_ops->tx_me_convert_ucast
|
||||
(vdev, wbuf, newmac, newmaccnt);
|
||||
}
|
||||
|
||||
/* Should be a function pointer in ol_txrx_osif_ops{} */
|
||||
/**
|
||||
* @brief notify mcast frame indication from FW.
|
||||
@@ -108,8 +163,17 @@ cdp_tx_me_convert_ucast(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
|
||||
static inline int cdp_mcast_notify(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev, u_int8_t vdev_id, qdf_nbuf_t msdu)
|
||||
{
|
||||
if (soc->ops->me_ops->mcast_notify)
|
||||
return soc->ops->me_ops->mcast_notify(pdev, vdev_id, msdu);
|
||||
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->me_ops ||
|
||||
!soc->ops->me_ops->mcast_notify)
|
||||
return 0;
|
||||
|
||||
return soc->ops->me_ops->mcast_notify(pdev, vdev_id, msdu);
|
||||
}
|
||||
#endif
|
||||
|
@@ -61,7 +61,7 @@ cdp_tx_non_std(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
|
||||
enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list)
|
||||
{
|
||||
if (!soc || !soc->ops || !soc->ops->misc_ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s invalid instance", __func__);
|
||||
return NULL;
|
||||
}
|
||||
@@ -180,11 +180,17 @@ cdp_post_data_stall_event(ol_txrx_soc_handle soc,
|
||||
uint32_t pdev_id, uint32_t vdev_id_bitmap,
|
||||
enum data_stall_log_recovery_type recovery_type)
|
||||
{
|
||||
if (!soc || !soc->ops || !soc->ops->misc_ops)
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
|
||||
"%s invalid instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!soc->ops->misc_ops ||
|
||||
!soc->ops->misc_ops->txrx_post_data_stall_event)
|
||||
return;
|
||||
|
||||
if (soc->ops->misc_ops->txrx_post_data_stall_event)
|
||||
soc->ops->misc_ops->txrx_post_data_stall_event(
|
||||
indicator, data_stall_type, pdev_id,
|
||||
vdev_id_bitmap, recovery_type);
|
||||
|
@@ -36,57 +36,125 @@
|
||||
static inline void cdp_monitor_set_filter_ucast_data
|
||||
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val)
|
||||
{
|
||||
if (soc->ops->mon_ops->txrx_monitor_set_filter_ucast_data)
|
||||
return soc->ops->mon_ops->txrx_monitor_set_filter_ucast_data
|
||||
(pdev, val);
|
||||
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->mon_ops ||
|
||||
!soc->ops->mon_ops->txrx_monitor_set_filter_ucast_data)
|
||||
return;
|
||||
|
||||
soc->ops->mon_ops->txrx_monitor_set_filter_ucast_data
|
||||
(pdev, val);
|
||||
}
|
||||
|
||||
static inline void cdp_monitor_set_filter_mcast_data
|
||||
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val)
|
||||
{
|
||||
if (soc->ops->mon_ops->txrx_monitor_set_filter_mcast_data)
|
||||
return soc->ops->mon_ops->txrx_monitor_set_filter_mcast_data
|
||||
(pdev, val);
|
||||
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->mon_ops ||
|
||||
!soc->ops->mon_ops->txrx_monitor_set_filter_mcast_data)
|
||||
return;
|
||||
|
||||
soc->ops->mon_ops->txrx_monitor_set_filter_mcast_data
|
||||
(pdev, val);
|
||||
}
|
||||
|
||||
static inline void cdp_monitor_set_filter_non_data
|
||||
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val)
|
||||
{
|
||||
if (soc->ops->mon_ops->txrx_monitor_set_filter_non_data)
|
||||
return soc->ops->mon_ops->txrx_monitor_set_filter_non_data
|
||||
(pdev, val);
|
||||
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->mon_ops ||
|
||||
!soc->ops->mon_ops->txrx_monitor_set_filter_non_data)
|
||||
return;
|
||||
|
||||
soc->ops->mon_ops->txrx_monitor_set_filter_non_data
|
||||
(pdev, val);
|
||||
}
|
||||
|
||||
static inline u_int8_t cdp_monitor_get_filter_ucast_data(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev_txrx_handle)
|
||||
{
|
||||
if (soc->ops->mon_ops->txrx_monitor_get_filter_ucast_data)
|
||||
return soc->ops->mon_ops->txrx_monitor_get_filter_ucast_data
|
||||
(vdev_txrx_handle);
|
||||
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->mon_ops ||
|
||||
!soc->ops->mon_ops->txrx_monitor_get_filter_ucast_data)
|
||||
return 0;
|
||||
|
||||
return soc->ops->mon_ops->txrx_monitor_get_filter_ucast_data
|
||||
(vdev_txrx_handle);
|
||||
}
|
||||
|
||||
static inline u_int8_t cdp_monitor_get_filter_mcast_data(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev_txrx_handle)
|
||||
{
|
||||
if (soc->ops->mon_ops->txrx_monitor_get_filter_mcast_data)
|
||||
return soc->ops->mon_ops->txrx_monitor_get_filter_mcast_data
|
||||
(vdev_txrx_handle);
|
||||
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->mon_ops ||
|
||||
!soc->ops->mon_ops->txrx_monitor_get_filter_mcast_data)
|
||||
return 0;
|
||||
|
||||
return soc->ops->mon_ops->txrx_monitor_get_filter_mcast_data
|
||||
(vdev_txrx_handle);
|
||||
}
|
||||
|
||||
static inline u_int8_t cdp_monitor_get_filter_non_data(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev_txrx_handle)
|
||||
{
|
||||
if (soc->ops->mon_ops->txrx_monitor_get_filter_non_data)
|
||||
return soc->ops->mon_ops->txrx_monitor_get_filter_non_data
|
||||
(vdev_txrx_handle);
|
||||
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->mon_ops ||
|
||||
!soc->ops->mon_ops->txrx_monitor_get_filter_non_data)
|
||||
return 0;
|
||||
|
||||
return soc->ops->mon_ops->txrx_monitor_get_filter_non_data
|
||||
(vdev_txrx_handle);
|
||||
}
|
||||
|
||||
static inline int cdp_reset_monitor_mode
|
||||
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
|
||||
{
|
||||
if (soc->ops->mon_ops->txrx_reset_monitor_mode)
|
||||
return soc->ops->mon_ops->txrx_reset_monitor_mode(pdev);
|
||||
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->mon_ops ||
|
||||
!soc->ops->mon_ops->txrx_reset_monitor_mode)
|
||||
return 0;
|
||||
|
||||
return soc->ops->mon_ops->txrx_reset_monitor_mode(pdev);
|
||||
}
|
||||
#endif
|
||||
|
@@ -48,10 +48,9 @@ cdp_set_ocb_chan_info(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
|
||||
}
|
||||
|
||||
if (soc->ops->ocb_ops->set_ocb_chan_info)
|
||||
return soc->ops->ocb_ops->set_ocb_chan_info(vdev,
|
||||
soc->ops->ocb_ops->set_ocb_chan_info(vdev,
|
||||
ocb_set_chan);
|
||||
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* cdp_get_ocb_chan_info() - return handle to vdev ocb_channel_info
|
||||
|
@@ -40,9 +40,18 @@ static inline uint32_t cdp_pflow_update_pdev_params
|
||||
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
|
||||
enum _ol_ath_param_t param, uint32_t val, void *ctx)
|
||||
{
|
||||
if (soc->ops->pflow_ops->pflow_update_pdev_params)
|
||||
return soc->ops->pflow_ops->pflow_update_pdev_params
|
||||
(pdev, param, val, ctx);
|
||||
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->pflow_ops ||
|
||||
!soc->ops->pflow_ops->pflow_update_pdev_params)
|
||||
return 0;
|
||||
|
||||
return soc->ops->pflow_ops->pflow_update_pdev_params
|
||||
(pdev, param, val, ctx);
|
||||
}
|
||||
#endif
|
||||
|
@@ -38,11 +38,20 @@
|
||||
static inline int cdp_get_nwifi_mode(ol_txrx_soc_handle soc,
|
||||
struct cdp_vdev *vdev)
|
||||
{
|
||||
if (soc->ops->raw_ops->txrx_get_nwifi_mode)
|
||||
return soc->ops->raw_ops->txrx_get_nwifi_mode(vdev);
|
||||
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->raw_ops ||
|
||||
!soc->ops->raw_ops->txrx_get_nwifi_mode)
|
||||
return 0;
|
||||
|
||||
return soc->ops->raw_ops->txrx_get_nwifi_mode(vdev);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief finds the ast entry for the packet
|
||||
* @details: Finds the ast entry i.e 4th address for the packet based on the
|
||||
@@ -60,13 +69,18 @@ cdp_rawsim_get_astentry (ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
|
||||
qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast)
|
||||
{
|
||||
|
||||
if (!soc || !soc->ops || !soc->ops->raw_ops)
|
||||
return;
|
||||
|
||||
if (soc->ops->raw_ops->rsim_get_astentry)
|
||||
soc->ops->raw_ops->rsim_get_astentry(vdev, pnbuf, raw_ast);
|
||||
|
||||
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->raw_ops ||
|
||||
!soc->ops->raw_ops->rsim_get_astentry)
|
||||
return;
|
||||
|
||||
soc->ops->raw_ops->rsim_get_astentry(vdev, pnbuf, raw_ast);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -36,18 +36,37 @@
|
||||
static inline void
|
||||
cdp_clear_stats(ol_txrx_soc_handle soc, uint16_t bitmap)
|
||||
{
|
||||
if (soc->ops->mob_stats_ops->clear_stats)
|
||||
return soc->ops->mob_stats_ops->clear_stats(bitmap);
|
||||
|
||||
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->mob_stats_ops ||
|
||||
!soc->ops->mob_stats_ops->clear_stats)
|
||||
return;
|
||||
|
||||
soc->ops->mob_stats_ops->clear_stats(bitmap);
|
||||
}
|
||||
|
||||
static inline int
|
||||
cdp_stats(ol_txrx_soc_handle soc, uint8_t vdev_id, char *buffer,
|
||||
unsigned int buf_len)
|
||||
{
|
||||
if (soc->ops->mob_stats_ops->stats)
|
||||
return soc->ops->mob_stats_ops->stats(vdev_id, buffer, buf_len);
|
||||
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->mob_stats_ops ||
|
||||
!soc->ops->mob_stats_ops->stats)
|
||||
return 0;
|
||||
|
||||
return soc->ops->mob_stats_ops->stats(vdev_id, buffer, buf_len);
|
||||
}
|
||||
|
||||
#endif /* _CDP_TXRX_STATS_H_ */
|
||||
|
Reference in New Issue
Block a user