All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath10k:  Fix OFDM rx-rate reporting.
@ 2015-10-06 23:21 ` greearb
  0 siblings, 0 replies; 4+ messages in thread
From: greearb @ 2015-10-06 23:21 UTC (permalink / raw)
  To: linux-wireless; +Cc: ath10k, Ben Greear

From: Ben Greear <greearb@candelatech.com>

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.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 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(-)

diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index ca3ff1c..7c634b5 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -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:
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 34d47f9..e091c37 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -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 &&
diff --git a/drivers/net/wireless/ath/ath10k/mac.h b/drivers/net/wireless/ath/ath10k/mac.h
index 4497002..7dce7b1 100644
--- a/drivers/net/wireless/ath/ath10k/mac.h
+++ b/drivers/net/wireless/ath/ath10k/mac.h
@@ -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);
 
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ath10k:  Fix OFDM rx-rate reporting.
@ 2015-10-06 23:21 ` greearb
  0 siblings, 0 replies; 4+ messages in thread
From: greearb @ 2015-10-06 23:21 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear, ath10k

From: Ben Greear <greearb@candelatech.com>

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.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 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(-)

diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index ca3ff1c..7c634b5 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -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:
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 34d47f9..e091c37 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -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 &&
diff --git a/drivers/net/wireless/ath/ath10k/mac.h b/drivers/net/wireless/ath/ath10k/mac.h
index 4497002..7dce7b1 100644
--- a/drivers/net/wireless/ath/ath10k/mac.h
+++ b/drivers/net/wireless/ath/ath10k/mac.h
@@ -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);
 
-- 
2.4.3


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath10k:  Fix OFDM rx-rate reporting.
  2015-10-06 23:21 ` greearb
@ 2015-10-09 14:41   ` Kalle Valo
  -1 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2015-10-09 14:41 UTC (permalink / raw)
  To: greearb; +Cc: linux-wireless, ath10k

greearb@candelatech.com writes:

> From: Ben Greear <greearb@candelatech.com>
>
> 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.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>

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.

>  u8 ath10k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,
> -			     u8 hw_rate)
> +			     u8 hw_rate, u8 cck)

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

> @@ -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)

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath10k:  Fix OFDM rx-rate reporting.
@ 2015-10-09 14:41   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2015-10-09 14:41 UTC (permalink / raw)
  To: greearb; +Cc: linux-wireless, ath10k

greearb@candelatech.com writes:

> From: Ben Greear <greearb@candelatech.com>
>
> 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.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>

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.

>  u8 ath10k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,
> -			     u8 hw_rate)
> +			     u8 hw_rate, u8 cck)

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

> @@ -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)

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-09 14:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-06 23:21 [PATCH] ath10k: Fix OFDM rx-rate reporting greearb
2015-10-06 23:21 ` greearb
2015-10-09 14:41 ` Kalle Valo
2015-10-09 14:41   ` Kalle Valo

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.