With the current logic of ieee80211_mandatory_rates(), only 11b mandatory rates
are returned when operating in 2.4GHz band. 802.11g mandatory rates are not
fetched even if the operating mode is 11g. This patch assumes 11g support
implies a 11g operation and returns the appropriate mandatory rates.

Signed-off-by: Ashok Nagarajan <[email protected]>
---
 net/wireless/util.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index d6727f2..d4e3dfa 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -43,12 +43,19 @@ u32 ieee80211_mandatory_rates(struct 
ieee80211_supported_band *sband)
        if (WARN_ON(!sband))
                return 1;
 
-       if (sband->band == IEEE80211_BAND_2GHZ)
-               mandatory_flag = IEEE80211_RATE_MANDATORY_B;
-       else
+       bitrates = sband->bitrates;
+       if (sband->band == IEEE80211_BAND_5GHZ)
                mandatory_flag = IEEE80211_RATE_MANDATORY_A;
+       else {
+               mandatory_flag = IEEE80211_RATE_MANDATORY_B;
+               for (i = 0; i < sband->n_bitrates; i++)
+                       if (bitrates[i].bitrate > 110) {
+                               mandatory_flag =
+                                       IEEE80211_RATE_MANDATORY_G;
+                               break;
+                       }
+       }
 
-       bitrates = sband->bitrates;
        for (i = 0; i < sband->n_bitrates; i++)
                if (bitrates[i].flags & mandatory_flag)
                        mandatory_rates |= BIT(i);
-- 
1.7.5.4

_______________________________________________
Devel mailing list
[email protected]
http://lists.open80211s.org/cgi-bin/mailman/listinfo/devel

Reply via email to