Search Linux Wireless

[PATCH 2/3] cfg80211: Allow ieee80211g mandatory rate sets in 2.4GHz band

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <ashok@xxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux