]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ath10k: replace hardcoded constant with define
authorErik Stromdahl <erik.stromdahl@gmail.com>
Mon, 18 Jun 2018 14:01:29 +0000 (17:01 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 28 Jun 2018 09:56:17 +0000 (12:56 +0300)
The hardcoded values used in ath10k_mac_tx_push_pending and
ath10k_mac_op_wake_tx_queue set an upper limit of how many packets that
can be consumed from the TX queue.

HTC_HOST_MAX_MSG_PER_TX_BUNDLE is a proper name for this constant, as
the value effectively limits the number of messages that can be consumed
in one step. Thus, the value is an upper limit of the number of messages
that can be added to a TX message bundle.

Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/htc.h
drivers/net/wireless/ath/ath10k/mac.c

index e60fbea698a996e739b8f6f04e37a9029a63d8fd..d69bb83049c4461093669c3ade30275addc56108 100644 (file)
@@ -51,6 +51,7 @@ struct ath10k;
  */
 
 #define HTC_HOST_MAX_MSG_PER_RX_BUNDLE        8
+#define HTC_HOST_MAX_MSG_PER_TX_BUNDLE        16
 
 enum ath10k_htc_tx_flags {
        ATH10K_HTC_FLAG_NEED_CREDIT_UPDATE = 0x01,
index a6a34486eca3ba34c5428a43af487fd8e7fc2c36..1cfb774be2eb31347a6a6ef62cbce873ec47d0c0 100644 (file)
@@ -4026,7 +4026,7 @@ void ath10k_mac_tx_push_pending(struct ath10k *ar)
                                   drv_priv);
 
                /* Prevent aggressive sta/tid taking over tx queue */
-               max = 16;
+               max = HTC_HOST_MAX_MSG_PER_TX_BUNDLE;
                ret = 0;
                while (ath10k_mac_tx_can_push(hw, txq) && max--) {
                        ret = ath10k_mac_tx_push_txq(hw, txq);
@@ -4288,7 +4288,7 @@ static void ath10k_mac_op_wake_tx_queue(struct ieee80211_hw *hw,
        struct ieee80211_txq *f_txq;
        struct ath10k_txq *f_artxq;
        int ret = 0;
-       int max = 16;
+       int max = HTC_HOST_MAX_MSG_PER_TX_BUNDLE;
 
        spin_lock_bh(&ar->txqs_lock);
        if (list_empty(&artxq->list))