qcacld-3.0: Register TxRx callbacks for pkt capture mode
Register TxRx callbacks to pktcapture_ops for packet capture mode Change-Id: I7de52bfd94b992cd5fd7c64e5352fe76ed1a7f3b CRs-Fixed: 2533876
This commit is contained in:
parent
a45ff4d3a5
commit
909e3f9b43
@ -5917,6 +5917,117 @@ void ol_deregister_packetdump_callback(struct cdp_soc_t *soc_hdl,
|
||||
pdev->ol_rx_packetdump_cb = NULL;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_PKT_CAPTURE
|
||||
/**
|
||||
* ol_txrx_register_pktcapture_cb() - Register pkt capture mode callback
|
||||
* @soc: soc handle
|
||||
* @pdev_id: pdev id
|
||||
* @context: virtual device's osif_dev
|
||||
* @cb: callback to register
|
||||
*
|
||||
* Return: QDF_STATUS Enumeration
|
||||
*/
|
||||
static QDF_STATUS ol_txrx_register_pktcapture_cb(
|
||||
struct cdp_soc_t *soc,
|
||||
uint8_t pdev_id,
|
||||
void *context,
|
||||
QDF_STATUS(cb)(void *, qdf_nbuf_t))
|
||||
{
|
||||
struct ol_txrx_pdev_t *pdev = ol_txrx_get_pdev_from_pdev_id(
|
||||
cdp_soc_t_to_ol_txrx_soc_t(soc),
|
||||
pdev_id);
|
||||
|
||||
if (!pdev) {
|
||||
ol_txrx_err("pdev NULL!");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
pdev->mon_osif_dev = context;
|
||||
pdev->mon_cb = cb;
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* ol_txrx_deregister_pktcapture_cb() - Register pkt capture mode callback
|
||||
* @soc: soc handle
|
||||
* @pdev_id: pdev id
|
||||
*
|
||||
* Return: QDF_STATUS Enumeration
|
||||
*/
|
||||
static QDF_STATUS ol_txrx_deregister_pktcapture_cb(struct cdp_soc_t *soc,
|
||||
uint8_t pdev_id)
|
||||
{
|
||||
ol_txrx_pdev_handle pdev = ol_txrx_get_pdev_from_pdev_id(
|
||||
cdp_soc_t_to_ol_txrx_soc_t(soc),
|
||||
pdev_id);
|
||||
|
||||
if (qdf_unlikely(!pdev)) {
|
||||
qdf_print("%s: pdev is NULL!\n", __func__);
|
||||
qdf_assert(0);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
pdev->mon_osif_dev = NULL;
|
||||
pdev->mon_cb = NULL;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* ol_txrx_get_pktcapture_mode() - return pktcapture mode
|
||||
* @soc: soc handle
|
||||
* @pdev_id: pdev id
|
||||
*
|
||||
* Return: 0 - disable
|
||||
* 1 - Mgmt packets
|
||||
* 2 - Data packets
|
||||
* 3 - Both Mgmt and Data packets
|
||||
*/
|
||||
static uint8_t ol_txrx_get_pktcapture_mode(struct cdp_soc_t *soc,
|
||||
uint8_t pdev_id)
|
||||
{
|
||||
struct ol_txrx_pdev_t *pdev = ol_txrx_get_pdev_from_pdev_id(
|
||||
cdp_soc_t_to_ol_txrx_soc_t(soc),
|
||||
pdev_id);
|
||||
|
||||
if (!pdev) {
|
||||
qdf_print("%s: pdev is NULL\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!pdev->mon_cb || !pdev->mon_osif_dev)
|
||||
return 0;
|
||||
|
||||
return pdev->pktcapture_mode_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* ol_txrx_set_pktcapture_mode() - set pktcapture mode
|
||||
* @soc: soc handle
|
||||
* @pdev_id: pdev id
|
||||
* @val : 0 - disable
|
||||
* 1 - Mgmt packets
|
||||
* 2 - Data packets
|
||||
* 3 - Both Mgmt and Data packets
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
static void ol_txrx_set_pktcapture_mode(struct cdp_soc_t *soc,
|
||||
uint8_t pdev_id, uint8_t val)
|
||||
{
|
||||
struct ol_txrx_pdev_t *pdev = ol_txrx_get_pdev_from_pdev_id(
|
||||
cdp_soc_t_to_ol_txrx_soc_t(soc),
|
||||
pdev_id);
|
||||
|
||||
if (!pdev) {
|
||||
qdf_print("%s: pdev is NULL\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
pdev->pktcapture_mode_value = val;
|
||||
}
|
||||
#endif /* WLAN_FEATURE_PKT_CAPTURE */
|
||||
|
||||
static struct cdp_cmn_ops ol_ops_cmn = {
|
||||
.txrx_soc_attach_target = ol_txrx_soc_attach_target,
|
||||
.txrx_vdev_attach = ol_txrx_vdev_attach,
|
||||
@ -6164,6 +6275,15 @@ static struct cdp_raw_ops ol_ops_raw = {
|
||||
/* EMPTY FOR MCL */
|
||||
};
|
||||
|
||||
#ifdef WLAN_FEATURE_PKT_CAPTURE
|
||||
static struct cdp_pktcapture_ops ol_ops_pkt_capture = {
|
||||
.txrx_pktcapture_cb_register = ol_txrx_register_pktcapture_cb,
|
||||
.txrx_pktcapture_cb_deregister = ol_txrx_deregister_pktcapture_cb,
|
||||
.txrx_pktcapture_set_mode = ol_txrx_set_pktcapture_mode,
|
||||
.txrx_pktcapture_get_mode = ol_txrx_get_pktcapture_mode,
|
||||
};
|
||||
#endif /* #ifdef WLAN_FEATURE_PKT_CAPTURE */
|
||||
|
||||
static struct cdp_ops ol_txrx_ops = {
|
||||
.cmn_drv_ops = &ol_ops_cmn,
|
||||
.ctrl_ops = &ol_ops_ctrl,
|
||||
@ -6190,7 +6310,10 @@ static struct cdp_ops ol_txrx_ops = {
|
||||
.throttle_ops = &ol_ops_throttle,
|
||||
.mob_stats_ops = &ol_ops_mob_stats,
|
||||
.delay_ops = &ol_ops_delay,
|
||||
.pmf_ops = &ol_ops_pmf
|
||||
.pmf_ops = &ol_ops_pmf,
|
||||
#ifdef WLAN_FEATURE_PKT_CAPTURE
|
||||
.pktcapture_ops = &ol_ops_pkt_capture,
|
||||
#endif
|
||||
};
|
||||
|
||||
ol_txrx_soc_handle ol_txrx_soc_attach(void *scn_handle,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013-2020 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
|
||||
@ -653,6 +653,13 @@ struct ol_txrx_pdev_t {
|
||||
|
||||
htt_pdev_handle htt_pdev;
|
||||
|
||||
#ifdef WLAN_FEATURE_PKT_CAPTURE
|
||||
void *mon_osif_dev;
|
||||
QDF_STATUS (*mon_cb)(void *osif_dev,
|
||||
qdf_nbuf_t msdu_list);
|
||||
uint8_t pktcapture_mode_value;
|
||||
#endif /* WLAN_FEATURE_PKT_CAPTURE */
|
||||
|
||||
#ifdef WLAN_FEATURE_FASTPATH
|
||||
struct CE_handle *ce_tx_hdl; /* Handle to Tx packet posting CE */
|
||||
struct CE_handle *ce_htt_msg_hdl; /* Handle to TxRx completion CE */
|
||||
|
Loading…
Reference in New Issue
Block a user