Skip to contentSkip to conversation

ath10k: Fix OFDM rx-rate reporting.

PATCH In review [email protected] 2 participants 2 messages Oct 6, 2015 – Oct 9, 2015 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: Fix OFDM rx-rate reporting.

From: Ben Greear <[email protected]>

The ath10k hw_rate codes are duplicated for
cck and ofdm modes, so we have to check a flag to
see if rate is cck or not when searching for
the proper bitrate.

This fixes monitor mode reporting invalid rates
on my setup.

---
 drivers/net/wireless/ath/ath10k/htt_rx.c | 2 +-
 drivers/net/wireless/ath/ath10k/mac.c    | 8 +++++++-
 drivers/net/wireless/ath/ath10k/mac.h    | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +1 -1
index ca3ff1c..7c634b5 100644
@@ -671,7 +671,7 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar,
 		rate &= ~RX_PPDU_START_RATE_FLAG;
 
 		sband = &ar->mac.sbands[status->band];
-		status->rate_idx = ath10k_mac_hw_rate_to_idx(sband, rate);
+		status->rate_idx = ath10k_mac_hw_rate_to_idx(sband, rate, cck);
 		break;
 	case HTT_RX_HT:
 	case HTT_RX_HT_WITH_TXBF:
drivers/net/wireless/ath/ath10k/mac.c +7 -1
index 34d47f9..e091c37 100644
@@ -91,7 +91,7 @@ static u8 ath10k_mac_bitrate_to_rate(int bitrate)
 }
 
 u8 ath10k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,
-			     u8 hw_rate)
+			     u8 hw_rate, u8 cck)
 {
 	const struct ieee80211_rate *rate;
 	int i;
@@ -99,6 +99,12 @@ u8 ath10k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,
 	for (i = 0; i < sband->n_bitrates; i++) {
 		rate = &sband->bitrates[i];
 
+		/* hw_rate values are not unique, have to tie-break with bitrate
+		 * and cck check.
+		 */
+		if (ath10k_mac_bitrate_is_cck(rate->bitrate) && !cck)
+			continue;
+
 		if (rate->hw_value == hw_rate)
 			return i;
 		else if (rate->flags & IEEE80211_RATE_SHORT_PREAMBLE &&
drivers/net/wireless/ath/ath10k/mac.h +1 -1
index 4497002..7dce7b1 100644
@@ -71,7 +71,7 @@ void ath10k_mac_handle_tx_pause(struct ath10k *ar, u32 vdev_id,
 				enum wmi_tlv_tx_pause_action action);
 
 u8 ath10k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,
-			     u8 hw_rate);
+			     u8 hw_rate, u8 cck);
 u8 ath10k_mac_bitrate_to_idx(const struct ieee80211_supported_band *sband,
 			     u32 bitrate);
 
Signature · 1 line
2.4.3
#1 lore raw
Quoted 11 lines · [email protected] writes:

From: Ben Greear <[email protected]>

The ath10k hw_rate codes are duplicated for
cck and ofdm modes, so we have to check a flag to
see if rate is cck or not when searching for
the proper bitrate.

This fixes monitor mode reporting invalid rates
on my setup.

Please rebase, doesn't apply and it used unknown SHA1 ids:

Applying: ath10k: Fix OFDM rx-rate reporting.
fatal: sha1 information is lacking or useless (drivers/net/wireless/ath/ath10k/htt_rx.c). Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 ath10k: Fix OFDM rx-rate reporting.

drivers/net/wireless/ath/ath10k/mac.c static u8 ath10k_mac_bitrate_to_rate(int bitrate) · line 94

Quoted 3 lines

u8 ath10k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,

drivers/net/wireless/ath/ath10k/mac.c +1 -1
-			     u8 hw_rate)
+			     u8 hw_rate, u8 cck)

A boolean for cck would be nice because that's what it release is.

drivers/net/wireless/ath/ath10k/mac.c u8 ath10k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband, · line 106

Quoted 9 lines
drivers/net/wireless/ath/ath10k/mac.c +5 -0
@@ -99,6 +99,12 @@ u8 ath10k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,
 	for (i = 0; i < sband->n_bitrates; i++) {
 		rate = &sband->bitrates[i];
 
+		/* hw_rate values are not unique, have to tie-break with bitrate
+		 * and cck check.
+		 */
+		if (ath10k_mac_bitrate_is_cck(rate->bitrate) && !cck)
+			continue;

Then this check could be just 'if (is_cck() != cck)

Signature · 1 line
Kalle Valo