From c8eb4d60fbc533f2c0506c28a222df2207482709 Mon Sep 17 00:00:00 2001 From: nobelj Date: Thu, 4 Jan 2018 14:29:32 -0800 Subject: [PATCH] qcacmn: Add support to get monitor filter on get_monrxfilter, it get the filter value set in dp_pdev struct Change-Id: I6590ae90a606643177d905c3542edd39dbcf539a --- dp/inc/cdp_txrx_mon.h | 14 ++++----- dp/inc/cdp_txrx_ops.h | 6 ++-- dp/wifi3.0/dp_main.c | 67 +++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 74 insertions(+), 13 deletions(-) diff --git a/dp/inc/cdp_txrx_mon.h b/dp/inc/cdp_txrx_mon.h index 2c5b167b24..45d33973e1 100644 --- a/dp/inc/cdp_txrx_mon.h +++ b/dp/inc/cdp_txrx_mon.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -87,8 +87,8 @@ static inline void cdp_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) +static inline bool cdp_monitor_get_filter_ucast_data +(ol_txrx_soc_handle soc, struct cdp_vdev *vdev_txrx_handle) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, @@ -105,8 +105,8 @@ static inline u_int8_t cdp_monitor_get_filter_ucast_data(ol_txrx_soc_handle soc, (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) +static inline bool cdp_monitor_get_filter_mcast_data +(ol_txrx_soc_handle soc, struct cdp_vdev *vdev_txrx_handle) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, @@ -123,8 +123,8 @@ static inline u_int8_t cdp_monitor_get_filter_mcast_data(ol_txrx_soc_handle soc, (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) +static inline bool cdp_monitor_get_filter_non_data +(ol_txrx_soc_handle soc, struct cdp_vdev *vdev_txrx_handle) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index ed8152d602..a35ce3dd1e 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -488,11 +488,11 @@ struct cdp_mon_ops { void (*txrx_monitor_set_filter_non_data) (struct cdp_pdev *, u_int8_t val); - u_int8_t (*txrx_monitor_get_filter_ucast_data) + bool (*txrx_monitor_get_filter_ucast_data) (struct cdp_vdev *vdev_txrx_handle); - u_int8_t (*txrx_monitor_get_filter_mcast_data) + bool (*txrx_monitor_get_filter_mcast_data) (struct cdp_vdev *vdev_txrx_handle); - u_int8_t (*txrx_monitor_get_filter_non_data) + bool (*txrx_monitor_get_filter_non_data) (struct cdp_vdev *vdev_txrx_handle); int (*txrx_reset_monitor_mode)(struct cdp_pdev *pdev); diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 3bb85ac8ad..6e1ee6b6ca 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -4066,6 +4066,67 @@ static int dp_pdev_set_advance_monitor_filter(struct cdp_pdev *pdev_handle, return QDF_STATUS_SUCCESS; } +/** + * dp_vdev_get_filter_ucast_data() - get DP VDEV monitor ucast filter + * @vdev_handle: Datapath VDEV handle + * Return: true on ucast filter flag set + */ +static bool dp_vdev_get_filter_ucast_data(struct cdp_vdev *vdev_handle) +{ + struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle; + struct dp_pdev *pdev; + + pdev = vdev->pdev; + + if ((pdev->fp_data_filter & FILTER_DATA_UCAST) || + (pdev->mo_data_filter & FILTER_DATA_UCAST)) + return true; + + return false; +} + +/** + * dp_vdev_get_filter_mcast_data() - get DP VDEV monitor mcast filter + * @vdev_handle: Datapath VDEV handle + * Return: true on mcast filter flag set + */ +static bool dp_vdev_get_filter_mcast_data(struct cdp_vdev *vdev_handle) +{ + struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle; + struct dp_pdev *pdev; + + pdev = vdev->pdev; + + if ((pdev->fp_data_filter & FILTER_DATA_MCAST) || + (pdev->mo_data_filter & FILTER_DATA_MCAST)) + return true; + + return false; +} + +/** + * dp_vdev_get_filter_non_data() - get DP VDEV monitor non_data filter + * @vdev_handle: Datapath VDEV handle + * Return: true on non data filter flag set + */ +static bool dp_vdev_get_filter_non_data(struct cdp_vdev *vdev_handle) +{ + struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle; + struct dp_pdev *pdev; + + pdev = vdev->pdev; + + if ((pdev->fp_mgmt_filter & FILTER_MGMT_ALL) || + (pdev->mo_mgmt_filter & FILTER_MGMT_ALL)) { + if ((pdev->fp_ctrl_filter & FILTER_CTRL_ALL) || + (pdev->mo_ctrl_filter & FILTER_CTRL_ALL)) { + return true; + } + } + + return false; +} + #ifdef MESH_MODE_SUPPORT void dp_peer_set_mesh_mode(struct cdp_vdev *vdev_hdl, uint32_t val) { @@ -6040,9 +6101,9 @@ static struct cdp_mon_ops dp_ops_mon = { .txrx_monitor_set_filter_ucast_data = NULL, .txrx_monitor_set_filter_mcast_data = NULL, .txrx_monitor_set_filter_non_data = NULL, - .txrx_monitor_get_filter_ucast_data = NULL, - .txrx_monitor_get_filter_mcast_data = NULL, - .txrx_monitor_get_filter_non_data = NULL, + .txrx_monitor_get_filter_ucast_data = dp_vdev_get_filter_ucast_data, + .txrx_monitor_get_filter_mcast_data = dp_vdev_get_filter_mcast_data, + .txrx_monitor_get_filter_non_data = dp_vdev_get_filter_non_data, .txrx_reset_monitor_mode = dp_reset_monitor_mode, /* Added support for HK advance filter */ .txrx_set_advance_monitor_filter = dp_pdev_set_advance_monitor_filter,