From 8433f9021398a9cee055d429cdf659ea9133db72 Mon Sep 17 00:00:00 2001 From: Sravan Kumar Kairam Date: Thu, 10 Jan 2019 15:53:54 +0530 Subject: [PATCH] qcacld-3.0: Fix cdp api cdp_tx_desc_thresh_reached The CDP api cdp_tx_desc_thresh_reached should return true if the available data path tx desc reaches threshold. But this api returns wrong value in case of helium targets. Fix this by returning correct value. Change-Id: I571841ab1e4a4b24242fadc21bd13a85ef8da781 CRs-Fixed: 2378898 --- core/dp/txrx/ol_txrx.c | 4 ++-- core/dp/txrx/ol_txrx.h | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index fe0977041f12..a404c17659da 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2019 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 @@ -5556,7 +5556,7 @@ static struct cdp_flowctl_ops ol_ops_flowctl = { .register_pause_cb = ol_txrx_register_pause_cb, .set_desc_global_pool_size = ol_tx_set_desc_global_pool_size, .dump_flow_pool_info = ol_tx_dump_flow_pool_info, - .tx_desc_thresh_reached = ol_txrx_fwd_desc_thresh_check, + .tx_desc_thresh_reached = ol_tx_desc_thresh_reached, #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */ }; diff --git a/core/dp/txrx/ol_txrx.h b/core/dp/txrx/ol_txrx.h index df2c21fe3dac..ed04aacc5dc5 100644 --- a/core/dp/txrx/ol_txrx.h +++ b/core/dp/txrx/ol_txrx.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2019 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 @@ -315,6 +315,18 @@ QDF_STATUS ol_txrx_register_pause_cb(struct cdp_soc_t *soc, * false; not enough descriptors, drop the packet */ bool ol_txrx_fwd_desc_thresh_check(struct cdp_vdev *vdev); + +/** + * ol_tx_desc_thresh_reached() - is tx desc threshold reached + * @vdev: vdev handle + * + * Return: true if tx desc available reached threshold or false otherwise + */ +static inline bool ol_tx_desc_thresh_reached(struct cdp_vdev *vdev) +{ + return !(ol_txrx_fwd_desc_thresh_check(vdev)); +} + #else /** * ol_tx_get_total_free_desc() - get total free descriptors