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:
Venkata Sharath Chandra Manchala
2017-10-25 12:18:08 -07:00
committed by snandini
parent aa62ae7615
commit c4a6b8480b
8 changed files with 475 additions and 124 deletions

View File

@@ -43,9 +43,18 @@ static inline int cdp_host_stats_get(ol_txrx_soc_handle soc,
struct cdp_vdev *vdev, struct cdp_vdev *vdev,
struct ol_txrx_stats_req *req) struct ol_txrx_stats_req *req)
{ {
if (soc->ops->host_stats_ops->txrx_host_stats_get) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->txrx_host_stats_get(vdev, req); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return 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);
} }
/** /**
@@ -57,27 +66,55 @@ static inline int cdp_host_stats_get(ol_txrx_soc_handle soc,
static inline void static inline void
cdp_host_stats_clr(ol_txrx_soc_handle soc, struct cdp_vdev *vdev) cdp_host_stats_clr(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
{ {
if (soc->ops->host_stats_ops->txrx_host_stats_clr) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->txrx_host_stats_clr(vdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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 static inline void
cdp_host_ce_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev) cdp_host_ce_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
{ {
if (soc->ops->host_stats_ops->txrx_host_ce_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->txrx_host_ce_stats(vdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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 static inline int cdp_stats_publish
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, (ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
struct ol_txrx_stats *buf) struct ol_txrx_stats *buf)
{ {
if (soc->ops->host_stats_ops->txrx_stats_publish) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->txrx_stats_publish(pdev, buf); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return 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. * @brief Enable enhanced stats functionality.
* *
@@ -87,10 +124,19 @@ static inline int cdp_stats_publish
static inline void static inline void
cdp_enable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev) cdp_enable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
{ {
if (soc->ops->host_stats_ops->txrx_enable_enhanced_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->txrx_enable_enhanced_stats QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
(pdev); "%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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);
} }
/** /**
@@ -102,10 +148,19 @@ cdp_enable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
static inline void static inline void
cdp_disable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev) cdp_disable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
{ {
if (soc->ops->host_stats_ops->txrx_disable_enhanced_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->txrx_disable_enhanced_stats QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
(pdev); "%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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);
} }
/** /**
@@ -120,113 +175,230 @@ static inline uint32_t *cdp_get_stats_base
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, (ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
uint32_t *stats_base, uint32_t msg_len, uint8_t type) uint32_t *stats_base, uint32_t msg_len, uint8_t type)
{ {
if (soc->ops->host_stats_ops->txrx_get_stats_base) 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 return (uint32_t *)soc->ops->host_stats_ops->txrx_get_stats_base
(pdev, stats_base, msg_len, type); (pdev, stats_base, msg_len, type);
return 0;
} }
static inline void static inline void
cdp_tx_print_tso_stats(ol_txrx_soc_handle soc, cdp_tx_print_tso_stats(ol_txrx_soc_handle soc,
struct cdp_vdev *vdev) struct cdp_vdev *vdev)
{ {
if (soc->ops->host_stats_ops->tx_print_tso_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->tx_print_tso_stats(vdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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 static inline void
cdp_tx_rst_tso_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev) cdp_tx_rst_tso_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
{ {
if (soc->ops->host_stats_ops->tx_rst_tso_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->tx_rst_tso_stats(vdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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 static inline void
cdp_tx_print_sg_stats(ol_txrx_soc_handle soc, cdp_tx_print_sg_stats(ol_txrx_soc_handle soc,
struct cdp_vdev *vdev) struct cdp_vdev *vdev)
{ {
if (soc->ops->host_stats_ops->tx_print_sg_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->tx_print_sg_stats(vdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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 static inline void
cdp_tx_rst_sg_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev) cdp_tx_rst_sg_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
{ {
if (soc->ops->host_stats_ops->tx_rst_sg_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->tx_rst_sg_stats(vdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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 static inline void
cdp_print_rx_cksum_stats(ol_txrx_soc_handle soc, cdp_print_rx_cksum_stats(ol_txrx_soc_handle soc,
struct cdp_vdev *vdev) struct cdp_vdev *vdev)
{ {
if (soc->ops->host_stats_ops->print_rx_cksum_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->print_rx_cksum_stats(vdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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 static inline void
cdp_rst_rx_cksum_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev) cdp_rst_rx_cksum_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
{ {
if (soc->ops->host_stats_ops->rst_rx_cksum_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->rst_rx_cksum_stats(vdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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 static inline A_STATUS
cdp_host_me_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev) cdp_host_me_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
{ {
if (soc->ops->host_stats_ops->txrx_host_me_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->txrx_host_me_stats(vdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return 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 static inline void cdp_per_peer_stats
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, char *addr) (ol_txrx_soc_handle soc, struct cdp_pdev *pdev, char *addr)
{ {
if (soc->ops->host_stats_ops->txrx_per_peer_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->txrx_per_peer_stats QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
(pdev, addr); "%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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, static inline int cdp_host_msdu_ttl_stats(ol_txrx_soc_handle soc,
struct cdp_vdev *vdev, struct cdp_vdev *vdev,
struct ol_txrx_stats_req *req) struct ol_txrx_stats_req *req)
{ {
if (soc->ops->host_stats_ops->txrx_host_msdu_ttl_stats) 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 return soc->ops->host_stats_ops->txrx_host_msdu_ttl_stats
(vdev, req); (vdev, req);
return 0;
} }
static inline void static inline void
cdp_print_lro_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev) cdp_print_lro_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
{ {
if (soc->ops->host_stats_ops->print_lro_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->print_lro_stats(vdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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 static inline void
cdp_reset_lro_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev) cdp_reset_lro_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
{ {
if (soc->ops->host_stats_ops->reset_lro_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->reset_lro_stats(vdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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, static inline void cdp_get_dp_fw_peer_stats(ol_txrx_soc_handle soc,
struct cdp_pdev *pdev, uint8_t *mac, uint32_t caps) struct cdp_pdev *pdev, uint8_t *mac, uint32_t caps)
{ {
if (soc->ops->host_stats_ops->get_fw_peer_stats) if (!soc || !soc->ops) {
return soc->ops->host_stats_ops->get_fw_peer_stats QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
(pdev, mac, caps); "%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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);
} }
/** /**

View File

@@ -40,59 +40,114 @@ static inline u_int16_t
cdp_tx_desc_alloc_and_mark_for_mcast_clone(ol_txrx_soc_handle soc, cdp_tx_desc_alloc_and_mark_for_mcast_clone(ol_txrx_soc_handle soc,
struct cdp_pdev *pdev, u_int16_t buf_count) 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-> return soc->ops->me_ops->
tx_desc_alloc_and_mark_for_mcast_clone tx_desc_alloc_and_mark_for_mcast_clone
(pdev, buf_count); (pdev, buf_count);
return 0;
} }
static inline u_int16_t static inline u_int16_t
cdp_tx_desc_free_and_unmark_for_mcast_clone(ol_txrx_soc_handle soc, cdp_tx_desc_free_and_unmark_for_mcast_clone(ol_txrx_soc_handle soc,
struct cdp_pdev *pdev, u_int16_t buf_count) 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-> return soc->ops->me_ops->
tx_desc_free_and_unmark_for_mcast_clone tx_desc_free_and_unmark_for_mcast_clone
(pdev, buf_count); (pdev, buf_count);
return 0;
} }
static inline u_int16_t static inline u_int16_t
cdp_tx_get_mcast_buf_allocated_marked(ol_txrx_soc_handle soc, cdp_tx_get_mcast_buf_allocated_marked(ol_txrx_soc_handle soc,
struct cdp_pdev *pdev) 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 return soc->ops->me_ops->tx_get_mcast_buf_allocated_marked
(pdev); (pdev);
return 0;
} }
static inline void static inline void
cdp_tx_me_alloc_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev) cdp_tx_me_alloc_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
{ {
if (soc->ops->me_ops->tx_me_alloc_descriptor) if (!soc || !soc->ops) {
return soc->ops->me_ops->tx_me_alloc_descriptor(pdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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 static inline void
cdp_tx_me_free_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev) cdp_tx_me_free_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
{ {
if (soc->ops->me_ops->tx_me_free_descriptor) if (!soc || !soc->ops) {
return soc->ops->me_ops->tx_me_free_descriptor(pdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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 static inline uint16_t
cdp_tx_me_convert_ucast(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, 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) qdf_nbuf_t wbuf, u_int8_t newmac[][6], uint8_t newmaccnt)
{ {
if (soc->ops->me_ops->tx_me_convert_ucast) 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 return soc->ops->me_ops->tx_me_convert_ucast
(vdev, wbuf, newmac, newmaccnt); (vdev, wbuf, newmac, newmaccnt);
return 0;
} }
/* Should be a function pointer in ol_txrx_osif_ops{} */ /* Should be a function pointer in ol_txrx_osif_ops{} */
/** /**
* @brief notify mcast frame indication from FW. * @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, static inline int cdp_mcast_notify(ol_txrx_soc_handle soc,
struct cdp_pdev *pdev, u_int8_t vdev_id, qdf_nbuf_t msdu) struct cdp_pdev *pdev, u_int8_t vdev_id, qdf_nbuf_t msdu)
{ {
if (soc->ops->me_ops->mcast_notify) if (!soc || !soc->ops) {
return soc->ops->me_ops->mcast_notify(pdev, vdev_id, msdu); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return 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 #endif

View File

@@ -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) enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list)
{ {
if (!soc || !soc->ops || !soc->ops->misc_ops) { 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__); "%s invalid instance", __func__);
return NULL; 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, uint32_t pdev_id, uint32_t vdev_id_bitmap,
enum data_stall_log_recovery_type recovery_type) 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, QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
"%s invalid instance", __func__); "%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( soc->ops->misc_ops->txrx_post_data_stall_event(
indicator, data_stall_type, pdev_id, indicator, data_stall_type, pdev_id,
vdev_id_bitmap, recovery_type); vdev_id_bitmap, recovery_type);

View File

@@ -36,57 +36,125 @@
static inline void cdp_monitor_set_filter_ucast_data static inline void cdp_monitor_set_filter_ucast_data
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val) (ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val)
{ {
if (soc->ops->mon_ops->txrx_monitor_set_filter_ucast_data) if (!soc || !soc->ops) {
return soc->ops->mon_ops->txrx_monitor_set_filter_ucast_data QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
(pdev, val); "%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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 static inline void cdp_monitor_set_filter_mcast_data
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val) (ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val)
{ {
if (soc->ops->mon_ops->txrx_monitor_set_filter_mcast_data) if (!soc || !soc->ops) {
return soc->ops->mon_ops->txrx_monitor_set_filter_mcast_data QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
(pdev, val); "%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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 static inline void cdp_monitor_set_filter_non_data
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val) (ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val)
{ {
if (soc->ops->mon_ops->txrx_monitor_set_filter_non_data) if (!soc || !soc->ops) {
return soc->ops->mon_ops->txrx_monitor_set_filter_non_data QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
(pdev, val); "%s: Invalid Instance", __func__);
QDF_BUG(0);
return; 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, static inline u_int8_t cdp_monitor_get_filter_ucast_data(ol_txrx_soc_handle soc,
struct cdp_vdev *vdev_txrx_handle) struct cdp_vdev *vdev_txrx_handle)
{ {
if (soc->ops->mon_ops->txrx_monitor_get_filter_ucast_data) 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 return soc->ops->mon_ops->txrx_monitor_get_filter_ucast_data
(vdev_txrx_handle); (vdev_txrx_handle);
return 0;
} }
static inline u_int8_t cdp_monitor_get_filter_mcast_data(ol_txrx_soc_handle soc, static inline u_int8_t cdp_monitor_get_filter_mcast_data(ol_txrx_soc_handle soc,
struct cdp_vdev *vdev_txrx_handle) struct cdp_vdev *vdev_txrx_handle)
{ {
if (soc->ops->mon_ops->txrx_monitor_get_filter_mcast_data) 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 return soc->ops->mon_ops->txrx_monitor_get_filter_mcast_data
(vdev_txrx_handle); (vdev_txrx_handle);
return 0;
} }
static inline u_int8_t cdp_monitor_get_filter_non_data(ol_txrx_soc_handle soc, static inline u_int8_t cdp_monitor_get_filter_non_data(ol_txrx_soc_handle soc,
struct cdp_vdev *vdev_txrx_handle) struct cdp_vdev *vdev_txrx_handle)
{ {
if (soc->ops->mon_ops->txrx_monitor_get_filter_non_data) 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 return soc->ops->mon_ops->txrx_monitor_get_filter_non_data
(vdev_txrx_handle); (vdev_txrx_handle);
return 0;
} }
static inline int cdp_reset_monitor_mode static inline int cdp_reset_monitor_mode
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev) (ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
{ {
if (soc->ops->mon_ops->txrx_reset_monitor_mode) if (!soc || !soc->ops) {
return soc->ops->mon_ops->txrx_reset_monitor_mode(pdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return 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 #endif

View File

@@ -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) 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); ocb_set_chan);
return;
} }
/** /**
* cdp_get_ocb_chan_info() - return handle to vdev ocb_channel_info * cdp_get_ocb_chan_info() - return handle to vdev ocb_channel_info

View File

@@ -40,9 +40,18 @@ static inline uint32_t cdp_pflow_update_pdev_params
(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, (ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
enum _ol_ath_param_t param, uint32_t val, void *ctx) enum _ol_ath_param_t param, uint32_t val, void *ctx)
{ {
if (soc->ops->pflow_ops->pflow_update_pdev_params) 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 return soc->ops->pflow_ops->pflow_update_pdev_params
(pdev, param, val, ctx); (pdev, param, val, ctx);
return 0;
} }
#endif #endif

View File

@@ -38,9 +38,18 @@
static inline int cdp_get_nwifi_mode(ol_txrx_soc_handle soc, static inline int cdp_get_nwifi_mode(ol_txrx_soc_handle soc,
struct cdp_vdev *vdev) struct cdp_vdev *vdev)
{ {
if (soc->ops->raw_ops->txrx_get_nwifi_mode) if (!soc || !soc->ops) {
return soc->ops->raw_ops->txrx_get_nwifi_mode(vdev); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return 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);
} }
/** /**
@@ -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) qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast)
{ {
if (!soc || !soc->ops || !soc->ops->raw_ops) 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; return;
if (soc->ops->raw_ops->rsim_get_astentry)
soc->ops->raw_ops->rsim_get_astentry(vdev, pnbuf, raw_ast); soc->ops->raw_ops->rsim_get_astentry(vdev, pnbuf, raw_ast);
return;
} }
#endif #endif

View File

@@ -36,18 +36,37 @@
static inline void static inline void
cdp_clear_stats(ol_txrx_soc_handle soc, uint16_t bitmap) 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; 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 static inline int
cdp_stats(ol_txrx_soc_handle soc, uint8_t vdev_id, char *buffer, cdp_stats(ol_txrx_soc_handle soc, uint8_t vdev_id, char *buffer,
unsigned int buf_len) unsigned int buf_len)
{ {
if (soc->ops->mob_stats_ops->stats) if (!soc || !soc->ops) {
return soc->ops->mob_stats_ops->stats(vdev_id, buffer, buf_len); QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance", __func__);
QDF_BUG(0);
return 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_ */ #endif /* _CDP_TXRX_STATS_H_ */