All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] wl1271: Fix warning about unsupported RX rate
@ 2010-10-14  9:00 Teemu Paasikivi
  2010-10-15  5:42 ` Juuso Oikarinen
  2010-10-18 14:31 ` Luciano Coelho
  0 siblings, 2 replies; 5+ messages in thread
From: Teemu Paasikivi @ 2010-10-14  9:00 UTC (permalink / raw)
  To: luciano.coelho; +Cc: linux-wireless, Teemu Paasikivi

While scanning, it is possible that beacon and probe response frames are
received on other band than configured to the driver. In rx status
handling this has caused "Unsupported RX rate from HW" warnings. This
patch changes the wl1271_rate_to_index function to take the band of the
received frame as a parameter instead of using value configuret to
wl->band.

Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
---
Changes v1 -> v2: Fixed patch to apply on wl12xx tree

 drivers/net/wireless/wl12xx/wl1271_main.c |    6 +++---
 drivers/net/wireless/wl12xx/wl1271_rx.c   |   10 +++++++++-
 drivers/net/wireless/wl12xx/wl1271_rx.h   |    2 +-
 drivers/net/wireless/wl12xx/wl1271_tx.c   |    2 +-
 drivers/net/wireless/wl12xx/wl1271_tx.h   |    2 +-
 5 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 48a4b99..a225400 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -2281,18 +2281,18 @@ static const struct ieee80211_ops wl1271_ops = {
 };
 
 
-u8 wl1271_rate_to_idx(struct wl1271 *wl, int rate)
+u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band)
 {
 	u8 idx;
 
-	BUG_ON(wl->band >= sizeof(wl1271_band_rate_to_idx)/sizeof(u8 *));
+	BUG_ON(band >= sizeof(wl1271_band_rate_to_idx)/sizeof(u8 *));
 
 	if (unlikely(rate >= CONF_HW_RXTX_RATE_MAX)) {
 		wl1271_error("Illegal RX rate from HW: %d", rate);
 		return 0;
 	}
 
-	idx = wl1271_band_rate_to_idx[wl->band][rate];
+	idx = wl1271_band_rate_to_idx[band][rate];
 	if (unlikely(idx == CONF_HW_RXTX_RATE_UNSUPPORTED)) {
 		wl1271_error("Unsupported RX rate from HW: %d", rate);
 		return 0;
diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.c b/drivers/net/wireless/wl12xx/wl1271_rx.c
index bea133b..282d286 100644
--- a/drivers/net/wireless/wl12xx/wl1271_rx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_rx.c
@@ -48,10 +48,18 @@ static void wl1271_rx_status(struct wl1271 *wl,
 			     struct ieee80211_rx_status *status,
 			     u8 beacon)
 {
+	enum ieee80211_band desc_band;
+
 	memset(status, 0, sizeof(struct ieee80211_rx_status));
 
 	status->band = wl->band;
-	status->rate_idx = wl1271_rate_to_idx(wl, desc->rate);
+
+	if ((desc->flags & WL1271_RX_DESC_BAND_MASK) == WL1271_RX_DESC_BAND_BG)
+		desc_band = IEEE80211_BAND_2GHZ;
+	else
+		desc_band = IEEE80211_BAND_5GHZ;
+
+	status->rate_idx = wl1271_rate_to_idx(desc->rate, desc_band);
 
 	status->signal = desc->rssi;
 
diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.h b/drivers/net/wireless/wl12xx/wl1271_rx.h
index 13a2323..6d41981 100644
--- a/drivers/net/wireless/wl12xx/wl1271_rx.h
+++ b/drivers/net/wireless/wl12xx/wl1271_rx.h
@@ -116,6 +116,6 @@ struct wl1271_rx_descriptor {
 } __packed;
 
 void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_status *status);
-u8 wl1271_rate_to_idx(struct wl1271 *wl, int rate);
+u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band);
 
 #endif
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.c b/drivers/net/wireless/wl12xx/wl1271_tx.c
index e3dc13c..c97ba31 100644
--- a/drivers/net/wireless/wl12xx/wl1271_tx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_tx.c
@@ -298,7 +298,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
 	if (result->status == TX_SUCCESS) {
 		if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
 			info->flags |= IEEE80211_TX_STAT_ACK;
-		rate = wl1271_rate_to_idx(wl, result->rate_class_index);
+		rate = wl1271_rate_to_idx(result->rate_class_index, wl->band);
 		retries = result->ack_failures;
 	} else if (result->status == TX_RETRY_EXCEEDED) {
 		wl->stats.excessive_retries++;
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.h b/drivers/net/wireless/wl12xx/wl1271_tx.h
index d12a129..eff1260 100644
--- a/drivers/net/wireless/wl12xx/wl1271_tx.h
+++ b/drivers/net/wireless/wl12xx/wl1271_tx.h
@@ -143,7 +143,7 @@ void wl1271_tx_work(struct work_struct *work);
 void wl1271_tx_complete(struct wl1271 *wl);
 void wl1271_tx_reset(struct wl1271 *wl);
 void wl1271_tx_flush(struct wl1271 *wl);
-u8 wl1271_rate_to_idx(struct wl1271 *wl, int rate);
+u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band);
 u32 wl1271_tx_enabled_rates_get(struct wl1271 *wl, u32 rate_set);
 
 #endif
-- 
1.7.1


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

* Re: [PATCH v2] wl1271: Fix warning about unsupported RX rate
  2010-10-14  9:00 [PATCH v2] wl1271: Fix warning about unsupported RX rate Teemu Paasikivi
@ 2010-10-15  5:42 ` Juuso Oikarinen
  2010-10-18 14:31 ` Luciano Coelho
  1 sibling, 0 replies; 5+ messages in thread
From: Juuso Oikarinen @ 2010-10-15  5:42 UTC (permalink / raw)
  To: ext Teemu Paasikivi
  Cc: Coelho Luciano (Nokia-MS/Helsinki),
	linux-wireless@vger.kernel.org

On Thu, 2010-10-14 at 11:00 +0200, ext Teemu Paasikivi wrote:
> While scanning, it is possible that beacon and probe response frames are
> received on other band than configured to the driver. In rx status
> handling this has caused "Unsupported RX rate from HW" warnings. This
> patch changes the wl1271_rate_to_index function to take the band of the
> received frame as a parameter instead of using value configuret to
> wl->band.
> 
> Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
> ---
> Changes v1 -> v2: Fixed patch to apply on wl12xx tree
> 
>  drivers/net/wireless/wl12xx/wl1271_main.c |    6 +++---
>  drivers/net/wireless/wl12xx/wl1271_rx.c   |   10 +++++++++-
>  drivers/net/wireless/wl12xx/wl1271_rx.h   |    2 +-
>  drivers/net/wireless/wl12xx/wl1271_tx.c   |    2 +-
>  drivers/net/wireless/wl12xx/wl1271_tx.h   |    2 +-
>  5 files changed, 15 insertions(+), 7 deletions(-)
> 

Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>

-Juuso



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

* Re: [PATCH v2] wl1271: Fix warning about unsupported RX rate
  2010-10-14  9:00 [PATCH v2] wl1271: Fix warning about unsupported RX rate Teemu Paasikivi
  2010-10-15  5:42 ` Juuso Oikarinen
@ 2010-10-18 14:31 ` Luciano Coelho
  2010-10-18 15:12   ` Luciano Coelho
  1 sibling, 1 reply; 5+ messages in thread
From: Luciano Coelho @ 2010-10-18 14:31 UTC (permalink / raw)
  To: Teemu Paasikivi; +Cc: linux-wireless@vger.kernel.org

On Thu, 2010-10-14 at 11:00 +0200, Teemu Paasikivi wrote:
> While scanning, it is possible that beacon and probe response frames are
> received on other band than configured to the driver. In rx status
> handling this has caused "Unsupported RX rate from HW" warnings. This
> patch changes the wl1271_rate_to_index function to take the band of the
> received frame as a parameter instead of using value configuret to
> wl->band.
> 
> Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
> ---

Applied, thanks!


-- 
Cheers,
Luca.


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

* Re: [PATCH v2] wl1271: Fix warning about unsupported RX rate
  2010-10-18 14:31 ` Luciano Coelho
@ 2010-10-18 15:12   ` Luciano Coelho
  2010-10-22  7:49     ` Teemu Paasikivi
  0 siblings, 1 reply; 5+ messages in thread
From: Luciano Coelho @ 2010-10-18 15:12 UTC (permalink / raw)
  To: Paasikivi Teemu.3 (EXT-Ixonos/Tampere); +Cc: linux-wireless@vger.kernel.org

On Mon, 2010-10-18 at 16:31 +0200, ext Luciano Coelho wrote:
> On Thu, 2010-10-14 at 11:00 +0200, Teemu Paasikivi wrote:
> > While scanning, it is possible that beacon and probe response frames are
> > received on other band than configured to the driver. In rx status
> > handling this has caused "Unsupported RX rate from HW" warnings. This
> > patch changes the wl1271_rate_to_index function to take the band of the
> > received frame as a parameter instead of using value configuret to
> > wl->band.
> > 
> > Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
> > ---
> 
> Applied, thanks!

Hmmm... I'm now getting loads of these:

[  465.265594] wl1271: ERROR Unsupported RX rate from HW: 15

...when scanning with my beagle board.  I have also included the 11n
patches by Shahar and Ido's "optimizations and fixes".

Teemu, I had to merge your patch on top of Ido's and Shahar's patches.
Can you check your patch in the wl12xx/master tree and confirm that it
is okay? To me it looks good, but you never know ;)


-- 
Cheers,
Luca.


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

* Re: [PATCH v2] wl1271: Fix warning about unsupported RX rate
  2010-10-18 15:12   ` Luciano Coelho
@ 2010-10-22  7:49     ` Teemu Paasikivi
  0 siblings, 0 replies; 5+ messages in thread
From: Teemu Paasikivi @ 2010-10-22  7:49 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless@vger.kernel.org

On Mon, 2010-10-18 at 18:12 +0300, Luciano Coelho wrote:
> On Mon, 2010-10-18 at 16:31 +0200, ext Luciano Coelho wrote:
> > On Thu, 2010-10-14 at 11:00 +0200, Teemu Paasikivi wrote:
> > > While scanning, it is possible that beacon and probe response frames are
> > > received on other band than configured to the driver. In rx status
> > > handling this has caused "Unsupported RX rate from HW" warnings. This
> > > patch changes the wl1271_rate_to_index function to take the band of the
> > > received frame as a parameter instead of using value configuret to
> > > wl->band.
> > > 
> > > Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
> > > ---
> > 
> > Applied, thanks!
> 
> Hmmm... I'm now getting loads of these:
> 
> [  465.265594] wl1271: ERROR Unsupported RX rate from HW: 15
> 
> ...when scanning with my beagle board.  I have also included the 11n
> patches by Shahar and Ido's "optimizations and fixes".
> 
> Teemu, I had to merge your patch on top of Ido's and Shahar's patches.
> Can you check your patch in the wl12xx/master tree and confirm that it
> is okay? To me it looks good, but you never know ;)
> 
> 

Ok, I checked this with a beagle board and it looks like that it's
caused by the firmware marking some packets received during scanning as
being received from 5 GHz band. After some testing I have pinpointed the
problem being caused by the firmware nvs file used. It's just annoying
that those errors are being emitted when scanning. I suppose that the
message could be changed from "ERROR" to "WARNING".


Br,

Teemu



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

end of thread, other threads:[~2010-10-22  7:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-14  9:00 [PATCH v2] wl1271: Fix warning about unsupported RX rate Teemu Paasikivi
2010-10-15  5:42 ` Juuso Oikarinen
2010-10-18 14:31 ` Luciano Coelho
2010-10-18 15:12   ` Luciano Coelho
2010-10-22  7:49     ` Teemu Paasikivi

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.