All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Gottschall <s.gottschall@dd-wrt.com>
To: Christian Lamparter <chunkeey@gmail.com>, linux-wireless@vger.kernel.org
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Subject: Re: [PATCH] ath10k: fix recent bandwidth conversion bug
Date: Wed, 1 Nov 2017 21:37:53 +0100	[thread overview]
Message-ID: <224e2890-3775-967b-d4ce-4297574c0642@dd-wrt.com> (raw)
In-Reply-To: <20171101200157.27096-1-chunkeey@gmail.com>

a additional array bounds check would be good

Am 01.11.2017 um 21:01 schrieb Christian Lamparter:
> The commit "cfg80211: make RATE_INFO_BW_20 the default" changed
> the index of RATE_INFO_BW_20, but the updates to ath10k missed
> the special bandwidth calculation case in
> ath10k_update_per_peer_tx_stats().
>
> Fixes: 842be75c77cb ("cfg80211: make RATE_INFO_BW_20 the default")
> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
> ---
>   drivers/net/wireless/ath/ath10k/htt_rx.c | 23 +++++------------------
>   1 file changed, 5 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
> index a3f5dc78353f..26b0d201a698 100644
> --- a/drivers/net/wireless/ath/ath10k/htt_rx.c
> +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
> @@ -592,6 +592,9 @@ struct amsdu_subframe_hdr {
>   
>   #define GROUP_ID_IS_SU_MIMO(x) ((x) == 0 || (x) == 63)
>   
> +static const u8 ath10k_bw_to_mac80211[] = { RATE_INFO_BW_20, RATE_INFO_BW_40,
> +	RATE_INFO_BW_80, RATE_INFO_BW_160 };
> +
>   static void ath10k_htt_rx_h_rates(struct ath10k *ar,
>   				  struct ieee80211_rx_status *status,
>   				  struct htt_rx_desc *rxd)
> @@ -694,23 +697,7 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar,
>   		if (sgi)
>   			status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
>   
> -		switch (bw) {
> -		/* 20MHZ */
> -		case 0:
> -			break;
> -		/* 40MHZ */
> -		case 1:
> -			status->bw = RATE_INFO_BW_40;
> -			break;
> -		/* 80MHZ */
> -		case 2:
> -			status->bw = RATE_INFO_BW_80;
> -			break;
> -		case 3:
> -			status->bw = RATE_INFO_BW_160;
> -			break;
> -		}
> -
> +		status->bw = ath10k_bw_to_mac80211[bw];
>   		status->encoding = RX_ENC_VHT;
>   		break;
>   	default:
> @@ -2297,7 +2284,7 @@ ath10k_update_per_peer_tx_stats(struct ath10k *ar,
>   		arsta->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI;
>   
>   	arsta->txrate.nss = txrate.nss;
> -	arsta->txrate.bw = txrate.bw + RATE_INFO_BW_20;
> +	arsta->txrate.bw = ath10k_bw_to_mac80211[txrate.bw];
>   }
>   
>   static void ath10k_htt_fetch_peer_stats(struct ath10k *ar,


-- 
Mit freundlichen Grüssen / Regards

Sebastian Gottschall / CTO

NewMedia-NET GmbH - DD-WRT
Firmensitz:  Stubenwaldallee 21a, 64625 Bensheim
Registergericht: Amtsgericht Darmstadt, HRB 25473
Geschäftsführer: Peter Steinhäuser, Christian Scheele
http://www.dd-wrt.com
email: s.gottschall@dd-wrt.com
Tel.: +496251-582650 / Fax: +496251-5826565

  parent reply	other threads:[~2017-11-01 20:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 20:01 [PATCH] ath10k: fix recent bandwidth conversion bug Christian Lamparter
2017-11-01 20:36 ` Sebastian Gottschall
2017-11-01 20:37 ` Sebastian Gottschall [this message]
2017-11-02 19:34   ` Christian Lamparter
2017-11-02 21:08     ` Sebastian Gottschall
2017-11-13  8:53       ` Johannes Berg
2017-11-20 11:57     ` Kalle Valo
2017-11-20 17:05       ` Christian Lamparter
2017-12-14 13:21         ` Kalle Valo
2018-03-01 11:52           ` Rafał Miłecki
2018-03-11  7:12             ` Kalle Valo
2018-03-11 21:01               ` Rafał Miłecki
2018-03-10 12:20 Anilkumar Kolli
2018-03-10 12:20 ` Anilkumar Kolli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=224e2890-3775-967b-d4ce-4297574c0642@dd-wrt.com \
    --to=s.gottschall@dd-wrt.com \
    --cc=chunkeey@gmail.com \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.