Skip to contentSkip to conversation

mac80211: sets basic rate set parameter for IBSS creator

RFC In review Mohammed Shafi Shajakhan 2 participants 6 messages Sep 28, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 mac80211: sets basic rate set parameter for IBSS creator

From: Mohammed Shafi Shajakhan <[email protected]>

This fix sets the basic rate set parameter for IBSS creator when the basic rates are not explicitly specified in the user space.

---
 net/mac80211/ibss.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
net/mac80211/ibss.c +3 -0
index 1a3aae5..e117155 100644
@@ -541,6 +541,9 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
 		capability |= WLAN_CAPABILITY_PRIVACY;
 	else
 		sdata->drop_unencrypted = 0;
+	if (ifibss->basic_rates == 0)
+		ifibss->basic_rates = ieee80211_mandatory_rates(local,
+					local->hw.conf.channel->band);
 
 	__ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
 				  ifibss->channel, ifibss->basic_rates,
Signature · 1 line
1.7.0.4
maintainer
#1 lore raw
Quoted 15 lines · Mohammed Shafi Shajakhan

From: Mohammed Shafi Shajakhan <[email protected]>

This fix sets the basic rate set parameter for IBSS creator when the basic rates are not explicitly specified in the user space.

---
 net/mac80211/ibss.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
net/mac80211/ibss.c +0 -0
index 1a3aae5..e117155 100644

net/mac80211/ibss.c static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) · line 546

Quoted 6 lines
net/mac80211/ibss.c +3 -0
@@ -541,6 +541,9 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
 		capability |= WLAN_CAPABILITY_PRIVACY;
 	else
 		sdata->drop_unencrypted = 0;
+	if (ifibss->basic_rates == 0)
+		ifibss->basic_rates = ieee80211_mandatory_rates(local,
+					local->hw.conf.channel->band);

Shouldn't cfg80211 do this?

johannes

#2 lore raw
Quoted 26 lines · Johannes Berg
Quoted 15 lines · Mohammed Shafi Shajakhan

From: Mohammed Shafi Shajakhan<[email protected]>

This fix sets the basic rate set parameter for IBSS creator when the basic rates are not explicitly specified in the user space.

---
  net/mac80211/ibss.c |    3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)
net/mac80211/ibss.c +0 -0
index 1a3aae5..e117155 100644

net/mac80211/ibss.c static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) · line 547

Quoted 7 lines
net/mac80211/ibss.c +3 -0
@@ -541,6 +541,9 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
  		capability |= WLAN_CAPABILITY_PRIVACY;
  	else
  		sdata->drop_unencrypted = 0;
+	if (ifibss->basic_rates == 0)
+		ifibss->basic_rates = ieee80211_mandatory_rates(local,
+					local->hw.conf.channel->band);
 

Shouldn't cfg80211 do this?

Quoted 2 lines

johannes

Hi Johannes ,

Thank you for your suggestion,just found out ,i
think its already there to configure basic rates (if the user had not expicitly specified the basic rates in user space) in the nl80211_join_ibss(nl80211.c) , but the basic rates does not seems to get set there.I had checked its status in mac80211 in function ieee80211_ibss_join function , its still zero and I thought of calling it there itself , but the basic rate was not properly set for 2Ghz, so called it here and I had tested it ,and everything working fine. Pleas correct me if I am wrong .

with thanks,

shafi

maintainer
#3 lore raw
Quoted 6 lines · Mohammed Shafi
Quoted 5 lines

net/mac80211/ibss.c static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) · line 546

Quoted 4 lines
net/mac80211/ibss.c +3 -0
+	if (ifibss->basic_rates == 0)
+		ifibss->basic_rates = ieee80211_mandatory_rates(local,
+					local->hw.conf.channel->band);

Shouldn't cfg80211 do this?

Quoted 9 lines

Thank you for your suggestion,just found out ,i
think its already there to configure basic rates (if the user had not expicitly specified the basic rates in user space) in the nl80211_join_ibss(nl80211.c) , but the basic rates does not seems to get set there.I had checked its status in mac80211 in function ieee80211_ibss_join function , its still zero and I thought of calling it there itself , but the basic rate was not properly set for 2Ghz, so called it here and I had tested it ,and everything working fine. Pleas correct me if I am wrong .

Well, I still think cfg80211 should do this, and it looks like it will except when you use iwconfig. So are you using iw or iwconfig? If iwconfig latter, you need to fix the wext code in cfg80211, if the former you need to figure out where the information gets lost.

johannes

maintainer
#4 lore raw

PATCH 1/1 cfg80211: always set IBSS basic rates

From: Johannes Berg <[email protected]>

IBSS started from wireless extensions is currently missing basic rate configuration, fix this by moving the code to generate the default to the common code that gets invoked for both nl80211 and wext.

---
 net/wireless/ibss.c    |   19 +++++++++++++++++++
 net/wireless/nl80211.c |   17 -----------------
 2 files changed, 19 insertions(+), 17 deletions(-)
net/wireless/ibss.c +19 -0
@@ -88,6 +88,25 @@ int __cfg80211_join_ibss(struct cfg80211
 	if (wdev->ssid_len)
 		return -EALREADY;
 
+	if (!params->basic_rates) {
+		/*
+		* If no rates were explicitly configured,
+		* use the mandatory rate set for 11b or
+		* 11a for maximum compatibility.
+		*/
+		struct ieee80211_supported_band *sband =
+			rdev->wiphy.bands[params->channel->band];
+		int j;
+		u32 flag = params->channel->band == IEEE80211_BAND_5GHZ ?
+			IEEE80211_RATE_MANDATORY_A :
+			IEEE80211_RATE_MANDATORY_B;
+
+		for (j = 0; j < sband->n_bitrates; j++) {
+			if (sband->bitrates[j].flags & flag)
+				params->basic_rates |= BIT(j);
+		}
+	}
+
 	if (WARN_ON(wdev->connect_keys))
 		kfree(wdev->connect_keys);
 	wdev->connect_keys = connkeys;
net/wireless/nl80211.c +0 -17
@@ -4119,23 +4119,6 @@ static int nl80211_join_ibss(struct sk_b
 				goto out;
 			}
 		}
-	} else {
-		/*
-		* If no rates were explicitly configured,
-		* use the mandatory rate set for 11b or
-		* 11a for maximum compatibility.
-		*/
-		struct ieee80211_supported_band *sband =
-			wiphy->bands[ibss.channel->band];
-		int j;
-		u32 flag = ibss.channel->band == IEEE80211_BAND_5GHZ ?
-			IEEE80211_RATE_MANDATORY_A :
-			IEEE80211_RATE_MANDATORY_B;
-
-		for (j = 0; j < sband->n_bitrates; j++) {
-			if (sband->bitrates[j].flags & flag)
-				ibss.basic_rates |= BIT(j);
-		}
 	}
 
 	err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys);
#5 lore raw
In reply to Johannes Berg
Quoted 21 lines · Johannes Berg
Quoted 8 lines · Mohammed Shafi
Quoted 7 lines

net/mac80211/ibss.c static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) · line 546

Quoted 5 lines
net/mac80211/ibss.c +3 -0
+	if (ifibss->basic_rates == 0)
+		ifibss->basic_rates = ieee80211_mandatory_rates(local,
+					local->hw.conf.channel->band);

Shouldn't cfg80211 do this?

Quoted 10 lines

Thank you for your suggestion,just found out ,i
think its already there to configure basic rates (if the user had not expicitly specified the basic rates in user space) in the nl80211_join_ibss(nl80211.c) , but the basic rates does not seems to get set there.I had checked its status in mac80211 in function ieee80211_ibss_join function , its still zero and I thought of calling it there itself , but the basic rate was not properly set for 2Ghz, so called it here and I had tested it ,and everything working fine. Pleas correct me if I am wrong .

Quoted 7 lines

Well, I still think cfg80211 should do this, and it looks like it will except when you use iwconfig. So are you using iw or iwconfig? If iwconfig latter, you need to fix the wext code in cfg80211, if the former you need to figure out where the information gets lost.

johannes

Sorry , I was using iwconfig and thanks for fixing it.

with regards ,

shafi