wireless: Fix WARN_ON() with ieee802.11b
PATCH 1/1 wireless: Fix WARN_ON() with ieee802.11b
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.
---
net/wireless/util.c +1 -1
@@ -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 );
2008/2/3, Ivo van Doorn <[email protected]>:
Quoted 15 lines
When the driver registers a
IEEE80211_BAND_2GHZband,
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 aWARN_ON()for this.Signed-off-by Ivo van Doorn <[email protected]>---
net/wireless/util.c +0
-0
net/wireless/util.c static void set_mandatory_flags_band(struct ieee80211_supported_band *sband, · line 86
Quoted 8 lines
net/wireless/util.c +1
-1@@ -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 ;-)
Signature · 3 lines
GPG ID: 0xD21DB2DB As you read this post global entropy rises. Have Fun ;-) Nick
Johannes Berg
maintainerQuoted 5 lines
When the driver registers a
IEEE80211_BAND_2GHZband,
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.
net/wireless/util.c static void set_mandatory_flags_band(struct ieee80211_supported_band *sband, · line 83
Quoted 2 lines
net/wireless/util.c +1
-1-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
Quoted 8 lines · Johannes Berg
Quoted 5 lines
When the driver registers a
IEEE80211_BAND_2GHZband,
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.
Quoted 8 lines
net/wireless/util.c static void set_mandatory_flags_band(struct ieee80211_supported_band *sband, · line 83
Quoted 2 lines
net/wireless/util.c +1
-1-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
Johannes Berg
maintainerQuoted 6 lines
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 asIEEE80211_RATE_MANDATORY_Bas well?
Ah, right, no, those aren't mandatory afaict so your patch is correct. This is only a fairly lax sanity check anyway.
johannes
Quoted 8 lines · Ivo van Doorn
When the driver registers a
IEEE80211_BAND_2GHZband,
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 aWARN_ON()for this.Signed-off-by Ivo van Doorn <[email protected]>
Quoted 15 lines
---
net/wireless/util.c +1
-1@@ -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 );