11/*
2- * Copyright (c) 2011-2014, 2016-2018, 2021 The Linux Foundation.
3- * All rights reserved.
2+ * Copyright (c) 2011-2014, 2016-2021 The Linux Foundation. All rights reserved.
3+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
44 *
55 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
66 *
4949#include <ol_tx_classify.h> /* ol_tx_classify, ol_tx_classify_mgmt */
5050#include <ol_tx_queue.h> /* ol_tx_enqueue */
5151#include <ol_tx_sched.h> /* ol_tx_sched */
52-
52+ #include <asm/div64.h>
5353/* internal header files relevant only for specific systems (Pronto) */
5454#include <ol_txrx_encap.h> /* OL_TX_ENCAP, etc */
5555#include "vos_lock.h"
@@ -1992,14 +1992,18 @@ ol_tx_vdev_set_bundle_require(uint8_t vdev_id, unsigned long tx_bytes,
19921992{
19931993 struct ol_txrx_vdev_t * vdev = ol_txrx_get_vdev_from_vdev_id (vdev_id );
19941994 bool old_bundle_required ;
1995+ uint64_t high_th_temp ;
1996+ uint64_t low_th_temp ;
19951997
19961998 if ((!vdev ) || (low_th > high_th ))
19971999 return ;
19982000
19992001 old_bundle_required = vdev -> bundling_reqired ;
2000- if (tx_bytes > ((high_th * time_in_ms * 3 ) >> 1 ))
2002+ high_th_temp = high_th * time_in_ms * 1500 ;
2003+ low_th_temp = low_th * time_in_ms * 1500 ;
2004+ if (tx_bytes > vos_do_div (high_th_temp ,1000 ))
20012005 vdev -> bundling_reqired = true;
2002- else if (tx_bytes < (( low_th * time_in_ms * 3 ) >> 1 ))
2006+ else if (tx_bytes < vos_do_div ( low_th_temp , 1000 ))
20032007 vdev -> bundling_reqired = false;
20042008
20052009 if (old_bundle_required != vdev -> bundling_reqired )
@@ -2020,7 +2024,7 @@ ol_tx_hl_queue_flush_all(struct ol_txrx_vdev_t* vdev)
20202024{
20212025 adf_os_spin_lock_bh (& vdev -> bundle_queue .mutex );
20222026 if (vdev -> bundle_queue .txq .depth != 0 ) {
2023- adf_os_timer_cancel (& vdev -> bundle_queue .timer );
2027+ vos_timer_stop (& vdev -> bundle_queue .timer );
20242028 vdev -> pdev -> total_bundle_queue_length -=
20252029 vdev -> bundle_queue .txq .depth ;
20262030 adf_nbuf_tx_free (vdev -> bundle_queue .txq .head , 1 /*error*/ );
@@ -2044,7 +2048,7 @@ ol_tx_hl_vdev_queue_append(struct ol_txrx_vdev_t* vdev, adf_nbuf_t msdu_list)
20442048 adf_os_spin_lock_bh (& vdev -> bundle_queue .mutex );
20452049
20462050 if (!vdev -> bundle_queue .txq .head ) {
2047- adf_os_timer_start (
2051+ vos_timer_start (
20482052 & vdev -> bundle_queue .timer ,
20492053 ol_cfg_get_bundle_timer_value (vdev -> pdev -> ctrl_pdev ));
20502054 vdev -> bundle_queue .txq .head = msdu_list ;
@@ -2084,7 +2088,7 @@ ol_tx_hl_vdev_queue_send_all(struct ol_txrx_vdev_t* vdev, bool call_sched)
20842088 adf_os_spin_lock_bh (& vdev -> bundle_queue .mutex );
20852089
20862090 if (vdev -> bundle_queue .txq .depth != 0 ) {
2087- adf_os_timer_cancel (& vdev -> bundle_queue .timer );
2091+ vos_timer_stop (& vdev -> bundle_queue .timer );
20882092 vdev -> pdev -> total_bundle_queue_length -=
20892093 vdev -> bundle_queue .txq .depth ;
20902094 msdu_list = ol_tx_hl_base (vdev , ol_tx_spec_std ,
@@ -2126,18 +2130,6 @@ ol_tx_hl_pdev_queue_send_all(struct ol_txrx_pdev_t* pdev)
21262130 *
21272131 * Return: none
21282132 */
2129- #if LINUX_VERSION_CODE >= KERNEL_VERSION (4 , 15 , 0 )
2130- void
2131- ol_tx_hl_vdev_bundle_timer (struct timer_list * t )
2132- {
2133- adf_nbuf_t msdu_list ;
2134- struct ol_txrx_vdev_t * vdev = from_timer (vdev , t , bundle_queue .timer );
2135-
2136- msdu_list = ol_tx_hl_vdev_queue_send_all (vdev , true);
2137- if (msdu_list )
2138- adf_nbuf_tx_free (msdu_list , 1 /*error*/ );
2139- }
2140- #else
21412133void
21422134ol_tx_hl_vdev_bundle_timer (void * vdev )
21432135{
@@ -2147,7 +2139,6 @@ ol_tx_hl_vdev_bundle_timer(void *vdev)
21472139 if (msdu_list )
21482140 adf_nbuf_tx_free (msdu_list , 1 /*error*/ );
21492141}
2150- #endif
21512142
21522143/**
21532144 * ol_tx_hl_queue() - queueing logic to bundle in HL
0 commit comments