qcacmn: Define CDP Ops for packet capture mode

Define CDP Ops for packet capture mode

Change-Id: If08191f47060210f4340940d01be8eb2cf8cc426
CRs-Fixed: 2528432
This commit is contained in:
Alok Kumar
2019-08-15 20:56:40 +05:30
committed by nshrivas
parent 8e869fff23
commit 3d15ae8780
3 changed files with 179 additions and 0 deletions

View File

@@ -190,4 +190,144 @@ cdp_deliver_tx_mgmt(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
soc->ops->mon_ops->txrx_deliver_tx_mgmt(pdev, nbuf); soc->ops->mon_ops->txrx_deliver_tx_mgmt(pdev, nbuf);
} }
#ifdef WLAN_FEATURE_PKT_CAPTURE
static inline void
cdp_pktcapture_record_channel(
ol_txrx_soc_handle soc,
uint8_t pdev_id,
int chan_num)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
"%s invalid instance", __func__);
QDF_BUG(0);
return;
}
if (!soc->ops->pktcapture_ops ||
!soc->ops->pktcapture_ops->txrx_pktcapture_record_channel)
return;
soc->ops->pktcapture_ops->txrx_pktcapture_record_channel(soc,
pdev_id,
chan_num);
}
static inline void
cdp_set_packet_capture_mode(ol_txrx_soc_handle soc,
uint8_t pdev_id,
uint8_t val)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
"%s invalid instance", __func__);
QDF_BUG(0);
return;
}
if (!soc->ops->pktcapture_ops ||
!soc->ops->pktcapture_ops->txrx_pktcapture_set_mode)
return;
soc->ops->pktcapture_ops->txrx_pktcapture_set_mode(soc, pdev_id, val);
}
static inline uint8_t
cdp_get_packet_capture_mode(ol_txrx_soc_handle soc, uint8_t pdev_id)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
"%s invalid instance", __func__);
QDF_BUG(0);
return 0;
}
if (!soc->ops->pktcapture_ops ||
!soc->ops->pktcapture_ops->txrx_pktcapture_get_mode)
return 0;
return soc->ops->pktcapture_ops->txrx_pktcapture_get_mode(soc,
pdev_id);
}
static inline QDF_STATUS
cdp_register_pktcapture_cb(
ol_txrx_soc_handle soc, uint8_t pdev_id, void *ctx,
QDF_STATUS(txrx_pktcapture_cb)(void *, qdf_nbuf_t))
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
"%s invalid instance", __func__);
return QDF_STATUS_E_INVAL;
}
if (!soc->ops->pktcapture_ops ||
!soc->ops->pktcapture_ops->txrx_pktcapture_cb_register)
return QDF_STATUS_E_INVAL;
return soc->ops->pktcapture_ops->txrx_pktcapture_cb_register(
soc,
pdev_id,
ctx,
txrx_pktcapture_cb);
}
static inline QDF_STATUS
cdp_deregister_pktcapture_cb(ol_txrx_soc_handle soc, uint8_t pdev_id)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
"%s invalid instance", __func__);
return QDF_STATUS_E_INVAL;
}
if (!soc->ops->pktcapture_ops ||
!soc->ops->pktcapture_ops->txrx_pktcapture_cb_deregister)
return QDF_STATUS_E_INVAL;
return soc->ops->pktcapture_ops->txrx_pktcapture_cb_deregister(soc,
pdev_id);
}
static inline QDF_STATUS
cdp_pktcapture_mgmtpkt_process(
ol_txrx_soc_handle soc,
uint8_t pdev_id,
struct mon_rx_status *txrx_status,
qdf_nbuf_t nbuf,
uint8_t status)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
"%s invalid instance", __func__);
return QDF_STATUS_E_INVAL;
}
if (!soc->ops->pktcapture_ops ||
!soc->ops->pktcapture_ops->txrx_pktcapture_mgmtpkt_process)
return QDF_STATUS_E_INVAL;
return soc->ops->pktcapture_ops->txrx_pktcapture_mgmtpkt_process(
soc,
pdev_id,
txrx_status,
nbuf,
status);
}
#else
static inline uint8_t
cdp_get_packet_capture_mode(ol_txrx_soc_handle soc, uint8_t pdev_id)
{
return 0;
}
static inline void
cdp_pktcapture_record_channel(ol_txrx_soc_handle soc,
uint8_t pdev_id,
int chan_num)
{
}
#endif /* WLAN_FEATURE_PKT_CAPTURE */
#endif #endif

View File

@@ -756,6 +756,40 @@ struct cdp_mon_ops {
(struct cdp_pdev *pdev, qdf_nbuf_t nbuf); (struct cdp_pdev *pdev, qdf_nbuf_t nbuf);
}; };
#ifdef WLAN_FEATURE_PKT_CAPTURE
struct cdp_pktcapture_ops {
void (*txrx_pktcapture_set_mode)
(struct cdp_soc_t *soc,
uint8_t pdev_id,
uint8_t mode);
uint8_t (*txrx_pktcapture_get_mode)
(struct cdp_soc_t *soc,
uint8_t pdev_id);
QDF_STATUS (*txrx_pktcapture_cb_register)
(struct cdp_soc_t *soc,
uint8_t pdev_id,
void *context,
QDF_STATUS(cb)(void *, qdf_nbuf_t));
QDF_STATUS (*txrx_pktcapture_cb_deregister)
(struct cdp_soc_t *soc,
uint8_t pdev_id);
QDF_STATUS (*txrx_pktcapture_mgmtpkt_process)
(struct cdp_soc_t *soc,
uint8_t pdev_id,
struct mon_rx_status *txrx_status,
qdf_nbuf_t nbuf, uint8_t status);
void (*txrx_pktcapture_record_channel)
(struct cdp_soc_t *soc,
uint8_t pdev_id,
int chan_no);
};
#endif /* #ifdef WLAN_FEATURE_PKT_CAPTURE */
struct cdp_host_stats_ops { struct cdp_host_stats_ops {
int (*txrx_host_stats_get)(struct cdp_vdev *vdev, int (*txrx_host_stats_get)(struct cdp_vdev *vdev,
struct ol_txrx_stats_req *req); struct ol_txrx_stats_req *req);
@@ -1543,5 +1577,9 @@ struct cdp_ops {
#ifdef RECEIVE_OFFLOAD #ifdef RECEIVE_OFFLOAD
struct cdp_rx_offld_ops *rx_offld_ops; struct cdp_rx_offld_ops *rx_offld_ops;
#endif #endif
#ifdef WLAN_FEATURE_PKT_CAPTURE
struct cdp_pktcapture_ops *pktcapture_ops;
#endif
}; };
#endif #endif

View File

@@ -698,6 +698,7 @@ enum QDF_GLOBAL_MODE {
#define QDF_SAP_MASK (1 << QDF_SAP_MODE) #define QDF_SAP_MASK (1 << QDF_SAP_MODE)
#define QDF_P2P_CLIENT_MASK (1 << QDF_P2P_CLIENT_MODE) #define QDF_P2P_CLIENT_MASK (1 << QDF_P2P_CLIENT_MODE)
#define QDF_P2P_GO_MASK (1 << QDF_P2P_GO_MODE) #define QDF_P2P_GO_MASK (1 << QDF_P2P_GO_MODE)
#define QDF_MONITOR_MASK (1 << QDF_MONITOR_MODE)
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH