qcacmn: Add lite monitor set/get functions

-Add lite monitor tx/rx filter config set/get fucntions
-Add lite monitor tx/rx peer config set/get functions

Change-Id: I47cc1085c64468b8a0fada871e2f5d3707ca7063
CRs-Fixed: 3078298
This commit is contained in:
Jeevan Kukkalli
2021-11-18 23:49:47 +05:30
committed by Madan Koyyalamudi
parent a68a2f3b18
commit 7f9da4ae12
11 changed files with 375 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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
@@ -68,4 +69,153 @@ cdp_deliver_tx_mgmt(ol_txrx_soc_handle soc, uint8_t pdev_id,
return soc->ops->mon_ops->txrx_deliver_tx_mgmt(soc, pdev_id, nbuf);
}
#ifdef QCA_SUPPORT_LITE_MONITOR
/*
* cdp_set_lite_mon_config() - Set lite monitor config/filter
*
*@soc: dp soc handle
*@config: lite monitor config
*@pdev_id: pdev id
*
* This API is used to enable/disable lite monitor feature
*
* Return: QDF_STATUS_SUCCESS if value set successfully
* QDF_STATUS_E_INVAL false if error
*/
static inline QDF_STATUS
cdp_set_lite_mon_config(ol_txrx_soc_handle soc,
struct cdp_lite_mon_filter_config *config,
uint8_t pdev_id)
{
if (!soc || !soc->ops) {
dp_cdp_debug("Invalid Instance");
return QDF_STATUS_E_INVAL;
}
if (!soc->ops->mon_ops ||
!soc->ops->mon_ops->txrx_set_lite_mon_config)
return QDF_STATUS_E_INVAL;
return soc->ops->mon_ops->txrx_set_lite_mon_config(soc, config,
pdev_id);
}
/*
* cdp_get_lite_mon_config() - Get lite monitor config
*
*@soc: dp soc handle
*@config: lite monitor config
*@pdev_id: pdev id
*
* This API is used to get lite monitor feature config
*
* Return: QDF_STATUS_SUCCESS if get is successfully
* QDF_STATUS_E_INVAL false if error
*/
static inline QDF_STATUS
cdp_get_lite_mon_config(ol_txrx_soc_handle soc,
struct cdp_lite_mon_filter_config *config,
uint8_t pdev_id)
{
if (!soc || !soc->ops) {
dp_cdp_debug("Invalid Instance");
return QDF_STATUS_E_INVAL;
}
if (!soc->ops->mon_ops ||
!soc->ops->mon_ops->txrx_get_lite_mon_config)
return QDF_STATUS_E_INVAL;
return soc->ops->mon_ops->txrx_get_lite_mon_config(soc, config,
pdev_id);
}
/*
* cdp_set_lite_mon_peer_config() - Set lite monitor peer config
*
*@soc: dp soc handle
*@config: lite monitor peer config
*@pdev_id: pdev id
*
* This API is used to add/del lite monitor peers
*
* Return: QDF_STATUS_SUCCESS if value set successfully
* QDF_STATUS_E_INVAL false if error
*/
static inline QDF_STATUS
cdp_set_lite_mon_peer_config(ol_txrx_soc_handle soc,
struct cdp_lite_mon_peer_config *config,
uint8_t pdev_id)
{
if (!soc || !soc->ops) {
dp_cdp_debug("Invalid Instance");
return QDF_STATUS_E_INVAL;
}
if (!soc->ops->mon_ops ||
!soc->ops->mon_ops->txrx_set_lite_mon_peer_config)
return QDF_STATUS_E_INVAL;
return soc->ops->mon_ops->txrx_set_lite_mon_peer_config(soc, config,
pdev_id);
}
/*
* cdp_get_lite_mon_peer_config() - Get lite monitor peer list
*
*@soc: dp soc handle
*@info: lite monitor peer info
*@pdev_id: pdev id
*
* This API is used to get lite monitor peers
*
* Return: QDF_STATUS_SUCCESS if value set successfully
* QDF_STATUS_E_INVAL false if error
*/
static inline QDF_STATUS
cdp_get_lite_mon_peer_config(ol_txrx_soc_handle soc,
struct cdp_lite_mon_peer_info *info,
uint8_t pdev_id)
{
if (!soc || !soc->ops) {
dp_cdp_debug("Invalid Instance");
return QDF_STATUS_E_INVAL;
}
if (!soc->ops->mon_ops ||
!soc->ops->mon_ops->txrx_get_lite_mon_peer_config)
return QDF_STATUS_E_INVAL;
return soc->ops->mon_ops->txrx_get_lite_mon_peer_config(soc, info,
pdev_id);
}
/*
* cdp_is_lite_mon_enabled() - Get lite monitor enable status
*
*@soc: dp soc handle
*@pdev_id: pdev id
*@dir: direction tx/rx
*
* This API is used to get lite monitor enable status
*
* Return: 0 if disabled
* 1 if enabled
*/
static inline int
cdp_is_lite_mon_enabled(ol_txrx_soc_handle soc,
uint8_t pdev_id, uint8_t dir)
{
if (!soc || !soc->ops) {
dp_cdp_debug("Invalid Instance");
return 0;
}
if (!soc->ops->mon_ops ||
!soc->ops->mon_ops->txrx_is_lite_mon_enabled)
return 0;
return soc->ops->mon_ops->txrx_is_lite_mon_enabled(soc, pdev_id, dir);
}
#endif
#endif