1 From: Hante Meuleman <meuleman@broadcom.com>
2 Date: Thu, 8 Oct 2015 20:33:16 +0200
3 Subject: [PATCH] brcmfmac: Fix station info rate information.
5 Txrate and rxrate in get_station got assigned first with value
6 in kbps and then divided by 100 to get it in 100kbps unit. The
7 problem with that is that type of rate is u16 which resulted
8 in incorrect values for high data rate values.
10 Reviewed-by: Arend Van Spriel <arend@broadcom.com>
11 Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
12 Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
13 Signed-off-by: Arend van Spriel <arend@broadcom.com>
14 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
17 --- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
18 +++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
19 @@ -2477,13 +2477,13 @@ brcmf_cfg80211_get_station(struct wiphy
20 sinfo->rx_packets += le32_to_cpu(sta_info_le.rx_mcast_pkts);
21 if (sinfo->tx_packets) {
22 sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
23 - sinfo->txrate.legacy = le32_to_cpu(sta_info_le.tx_rate);
24 - sinfo->txrate.legacy /= 100;
25 + sinfo->txrate.legacy =
26 + le32_to_cpu(sta_info_le.tx_rate) / 100;
28 if (sinfo->rx_packets) {
29 sinfo->filled |= BIT(NL80211_STA_INFO_RX_BITRATE);
30 - sinfo->rxrate.legacy = le32_to_cpu(sta_info_le.rx_rate);
31 - sinfo->rxrate.legacy /= 100;
32 + sinfo->rxrate.legacy =
33 + le32_to_cpu(sta_info_le.rx_rate) / 100;
35 if (le16_to_cpu(sta_info_le.ver) >= 4) {
36 sinfo->filled |= BIT(NL80211_STA_INFO_TX_BYTES);