* [PATCH] wireless: Fix WARN_ON() with ieee802.11b
@ 2008-02-02 22:53 Ivo van Doorn
2008-02-03 1:39 ` Nick Kossifidis
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Ivo van Doorn @ 2008-02-02 22:53 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Johannes Berg
When the driver registers a IEEE80211_BAND_2GHZ band,
it can either be 802.11b or 802.11g. But when 802.11b rates
are registered "want" will be 3 (since 4 rates are being registered,
and each of those 4 rates will decrease "want").
Since this is a correct situation, there is no need to trigger
a WARN_ON() for this.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 0dcccbf..5304c62 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -80,7 +80,7 @@ static void set_mandatory_flags_band(struct ieee80211_supported_band *sband,
sband->bitrates[i].flags |=
IEEE80211_RATE_ERP_G;
}
- WARN_ON(want != 0 && want != 6);
+ WARN_ON(want != 0 && want != 3 && want != 6);
break;
case IEEE80211_NUM_BANDS:
WARN_ON(1);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] wireless: Fix WARN_ON() with ieee802.11b
2008-02-02 22:53 [PATCH] wireless: Fix WARN_ON() with ieee802.11b Ivo van Doorn
@ 2008-02-03 1:39 ` Nick Kossifidis
2008-02-03 10:21 ` Johannes Berg
2008-02-03 12:42 ` Johannes Berg
2 siblings, 0 replies; 6+ messages in thread
From: Nick Kossifidis @ 2008-02-03 1:39 UTC (permalink / raw)
To: Ivo van Doorn; +Cc: John W. Linville, linux-wireless, Johannes Berg
2008/2/3, Ivo van Doorn <ivdoorn@gmail.com>:
> When the driver registers a IEEE80211_BAND_2GHZ band,
> it can either be 802.11b or 802.11g. But when 802.11b rates
> are registered "want" will be 3 (since 4 rates are being registered,
> and each of those 4 rates will decrease "want").
> Since this is a correct situation, there is no need to trigger
> a WARN_ON() for this.
>
> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
>
> ---
> diff --git a/net/wireless/util.c b/net/wireless/util.c
> index 0dcccbf..5304c62 100644
> --- a/net/wireless/util.c
> +++ b/net/wireless/util.c
> @@ -80,7 +80,7 @@ static void set_mandatory_flags_band(struct ieee80211_supported_band *sband,
> sband->bitrates[i].flags |=
> IEEE80211_RATE_ERP_G;
> }
> - WARN_ON(want != 0 && want != 6);
> + WARN_ON(want != 0 && want != 3 && want != 6);
> break;
> case IEEE80211_NUM_BANDS:
> WARN_ON(1);
Had the same problem when registering an AR5211 card (a/b only), this
patch fixes it ;-)
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] wireless: Fix WARN_ON() with ieee802.11b
2008-02-02 22:53 [PATCH] wireless: Fix WARN_ON() with ieee802.11b Ivo van Doorn
2008-02-03 1:39 ` Nick Kossifidis
@ 2008-02-03 10:21 ` Johannes Berg
2008-02-03 11:21 ` Ivo van Doorn
2008-02-03 12:42 ` Johannes Berg
2 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2008-02-03 10:21 UTC (permalink / raw)
To: Ivo van Doorn; +Cc: John W. Linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 512 bytes --]
> When the driver registers a IEEE80211_BAND_2GHZ band,
> it can either be 802.11b or 802.11g. But when 802.11b rates
> are registered "want" will be 3 (since 4 rates are being registered,
> and each of those 4 rates will decrease "want").
Huh, yeah, you're right, this is a thinko.
> - WARN_ON(want != 0 && want != 6);
> + WARN_ON(want != 0 && want != 3 && want != 6);
However, I think it should just be
WARN_ON(want != 0 && want != 3);
6 just doesn't make sense, does it?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] wireless: Fix WARN_ON() with ieee802.11b
2008-02-03 10:21 ` Johannes Berg
@ 2008-02-03 11:21 ` Ivo van Doorn
2008-02-03 12:38 ` Johannes Berg
0 siblings, 1 reply; 6+ messages in thread
From: Ivo van Doorn @ 2008-02-03 11:21 UTC (permalink / raw)
To: Johannes Berg; +Cc: John W. Linville, linux-wireless
On Sunday 03 February 2008, Johannes Berg wrote:
>
> > When the driver registers a IEEE80211_BAND_2GHZ band,
> > it can either be 802.11b or 802.11g. But when 802.11b rates
> > are registered "want" will be 3 (since 4 rates are being registered,
> > and each of those 4 rates will decrease "want").
>
> Huh, yeah, you're right, this is a thinko.
>
> > - WARN_ON(want != 0 && want != 6);
> > + WARN_ON(want != 0 && want != 3 && want != 6);
>
> However, I think it should just be
>
> WARN_ON(want != 0 && want != 3);
>
> 6 just doesn't make sense, does it?
Well from your code it seemed that you only made 1Mbit mandatory for
802.11b. So if you want to make all b rates mandatory then the 6 check should
indeed be removed.
But shouldn't the 2Mbit, 5.5Mbit and 11Mbit set as IEEE80211_RATE_MANDATORY_B
as well?
Ivo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] wireless: Fix WARN_ON() with ieee802.11b
2008-02-03 11:21 ` Ivo van Doorn
@ 2008-02-03 12:38 ` Johannes Berg
0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2008-02-03 12:38 UTC (permalink / raw)
To: Ivo van Doorn; +Cc: John W. Linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 404 bytes --]
> Well from your code it seemed that you only made 1Mbit mandatory for
> 802.11b. So if you want to make all b rates mandatory then the 6 check should
> indeed be removed.
> But shouldn't the 2Mbit, 5.5Mbit and 11Mbit set as IEEE80211_RATE_MANDATORY_B
> as well?
Ah, right, no, those aren't mandatory afaict so your patch is correct.
This is only a fairly lax sanity check anyway.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] wireless: Fix WARN_ON() with ieee802.11b
2008-02-02 22:53 [PATCH] wireless: Fix WARN_ON() with ieee802.11b Ivo van Doorn
2008-02-03 1:39 ` Nick Kossifidis
2008-02-03 10:21 ` Johannes Berg
@ 2008-02-03 12:42 ` Johannes Berg
2 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2008-02-03 12:42 UTC (permalink / raw)
To: Ivo van Doorn; +Cc: John W. Linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 993 bytes --]
On Sat, 2008-02-02 at 23:53 +0100, Ivo van Doorn wrote:
> When the driver registers a IEEE80211_BAND_2GHZ band,
> it can either be 802.11b or 802.11g. But when 802.11b rates
> are registered "want" will be 3 (since 4 rates are being registered,
> and each of those 4 rates will decrease "want").
> Since this is a correct situation, there is no need to trigger
> a WARN_ON() for this.
>
> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> diff --git a/net/wireless/util.c b/net/wireless/util.c
> index 0dcccbf..5304c62 100644
> --- a/net/wireless/util.c
> +++ b/net/wireless/util.c
> @@ -80,7 +80,7 @@ static void set_mandatory_flags_band(struct ieee80211_supported_band *sband,
> sband->bitrates[i].flags |=
> IEEE80211_RATE_ERP_G;
> }
> - WARN_ON(want != 0 && want != 6);
> + WARN_ON(want != 0 && want != 3 && want != 6);
> break;
> case IEEE80211_NUM_BANDS:
> WARN_ON(1);
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-02-03 12:42 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-02 22:53 [PATCH] wireless: Fix WARN_ON() with ieee802.11b Ivo van Doorn
2008-02-03 1:39 ` Nick Kossifidis
2008-02-03 10:21 ` Johannes Berg
2008-02-03 11:21 ` Ivo van Doorn
2008-02-03 12:38 ` Johannes Berg
2008-02-03 12:42 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).