Skip to contentSkip to conversation

mac80211: Use G mandatory rates in 2GHz band

PATCH NAK Bruno Randolf 2 participants 11 messages Apr 12, 2010 – Apr 13, 2010 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mac80211: Use G mandatory rates in 2GHz band

This changes the mandatory (basic) rates in the 2GHz band to the ERP mandatory rates (1, 2, 5.5, 11, 6, 12, 24Mbps - as defined in 802.11 section 19.1.) instead of the "B" mode basic rate (1Mbps - why not 2Mbps too?).

B-only drivers (are there any?) should still work with this change, since they simply don't have the faster rates. The functional change is that we now default to faster basic rates, but as far as i can tell this is only really used in IBSS code (STAs have to adapt to their AP).

BTW: Is there a way to configure mac80211 to B-only mode or G-only mode? When this is the case this has to be revised...

---
 net/mac80211/util.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/mac80211/util.c +2 -1
index 2b75b4f..282bda9 100644
@@ -844,7 +844,8 @@ u32 ieee80211_mandatory_rates(struct ieee80211_local *local,
 	}
 
 	if (band == IEEE80211_BAND_2GHZ)
-		mandatory_flag = IEEE80211_RATE_MANDATORY_B;
+		mandatory_flag = IEEE80211_RATE_MANDATORY_B |
+				 IEEE80211_RATE_MANDATORY_G;
 	else
 		mandatory_flag = IEEE80211_RATE_MANDATORY_A;
 
#1 lore raw

PATCH 2/2 mac80211: Initialize IBSS basic rates according to band

When we create an IBSS we are can define the basic rates according to the band in use. Previously only the B mode rates (1 and 2Mbps) were used unconditionally, which resulted in low thruput when using RTS/CTS.

Also we should save the IBSS basic rates configuration when we join an IBSS.

---
 net/mac80211/ibss.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
net/mac80211/ibss.c +7 -1
index 01974c2..05846ab 100644
@@ -77,6 +77,10 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
 	u32 bss_change;
 	u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
 
+#ifdef CONFIG_MAC80211_IBSS_DEBUG
+	printk(KERN_DEBUG "JOIN IBSS basic_rates %x\n", basic_rates);
+#endif
+
 	/* Reset own TSF to allow time synchronization work. */
 	drv_reset_tsf(local);
 
@@ -165,6 +169,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
 	rcu_assign_pointer(ifibss->presp, skb);
 
 	sdata->vif.bss_conf.beacon_int = beacon_int;
+	sdata->vif.bss_conf.basic_rates = basic_rates;
 	bss_change = BSS_CHANGED_BEACON_INT;
 	bss_change |= ieee80211_reset_erp_info(sdata);
 	bss_change |= BSS_CHANGED_BSSID;
@@ -518,7 +523,8 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
 		sdata->drop_unencrypted = 0;
 
 	__ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
-				  ifibss->channel, 3, /* first two are basic */
+				  ifibss->channel,
+				  ieee80211_mandatory_rates(local, sband->band),
 				  capability, 0);
 }
 
maintainer
#2 lore raw

Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band

Quoted 5 lines · Bruno Randolf

When we create an IBSS we are can define the basic rates according to the band in use. Previously only the B mode rates (1 and 2Mbps) were used unconditionally, which resulted in low thruput when using RTS/CTS.

Also we should save the IBSS basic rates configuration when we join an IBSS.

Again, this breaks things. If you feel this is necessary for some reason, it needs to be configurable during the IBSS join by userspace.

johannes

#3 lore raw

Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band

Quoted 10 lines · On Monday 12 April 2010 16:41:22 you wrote:
Quoted 6 lines · Bruno Randolf

When we create an IBSS we are can define the basic rates according to the band in use. Previously only the B mode rates (1 and 2Mbps) were used unconditionally, which resulted in low thruput when using RTS/CTS.

Also we should save the IBSS basic rates configuration when we join an IBSS.

Again, this breaks things. If you feel this is necessary for some reason, it needs to be configurable during the IBSS join by userspace.

without the previous patch (which you NACKed) this is still the correct thing to do in B mode and will result in only 1Mbps as a basic rate. without this patch it is definetly wrong for A mode.

i can see the reason why you refused the first patch, but the main problem is that there is no clear distiction between B and G in mac80211. there needs to be a way to configure B-only, G-only and BG ERP mode. i don't believe this is applicable to IBSS mode only... is it?

btw: why is only 1Mbps used as a basic rate in B mode in set_mandatory_flags_band()? i think 2Mbps should be there as well?

anyhow, i wouldn't mind adding something to configure this from userspace. can you point me to the right direction? i mean i can add something to IBSS setup but as i said i can't believe this is only relevant to IBSS mode.

bruno

maintainer
#4 lore raw

Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band

Quoted 9 lines · Bruno Randolf
Quoted 8 lines · On Monday 12 April 2010 16:41:22 you wrote:
Quoted 6 lines · Bruno Randolf

When we create an IBSS we are can define the basic rates according to the band in use. Previously only the B mode rates (1 and 2Mbps) were used unconditionally, which resulted in low thruput when using RTS/CTS.

Also we should save the IBSS basic rates configuration when we join an IBSS.

Quoted 6 lines
Quoted 2 lines

Again, this breaks things. If you feel this is necessary for some reason, it needs to be configurable during the IBSS join by userspace.

without the previous patch (which you NACKed) this is still the correct thing to do in B mode and will result in only 1Mbps as a basic rate. without this patch it is definetly wrong for A mode.

No, you don't understand. It will break _talking to_ 11b only stations when the local station is 11g capable.

Quoted 4 lines

i can see the reason why you refused the first patch, but the main problem is that there is no clear distiction between B and G in mac80211. there needs to be a way to configure B-only, G-only and BG ERP mode. i don't believe this is applicable to IBSS mode only... is it?

It is, as far as I can tell. And mesh maybe.

Quoted 2 lines

btw: why is only 1Mbps used as a basic rate in B mode in set_mandatory_flags_band()? i think 2Mbps should be there as well?

Not sure, could be a bug?

Quoted 3 lines

anyhow, i wouldn't mind adding something to configure this from userspace. can you point me to the right direction? i mean i can add something to IBSS setup but as i said i can't believe this is only relevant to IBSS mode.

What other modes do you think it is relevant to?

johannes

#5 lore raw

Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band

Quoted 14 lines · On Monday 12 April 2010 17:10:01 Johannes Berg wrote:
Quoted 13 lines · Bruno Randolf
Quoted 11 lines · On Monday 12 April 2010 16:41:22 you wrote:
Quoted 7 lines · Bruno Randolf

When we create an IBSS we are can define the basic rates according to the band in use. Previously only the B mode rates (1 and 2Mbps) were used unconditionally, which resulted in low thruput when using RTS/CTS.

Also we should save the IBSS basic rates configuration when we join an IBSS.

Again, this breaks things. If you feel this is necessary for some reason, it needs to be configurable during the IBSS join by userspace.

Quoted 6 lines
Quoted 3 lines

without the previous patch (which you NACKed) this is still the correct thing to do in B mode and will result in only 1Mbps as a basic rate. without this patch it is definetly wrong for A mode.

No, you don't understand. It will break _talking to_ 11b only stations when the local station is 11g capable.

i understood that this is what you mean. note that i said *without* the other patch! the first patch breaks talking to 11b only stations, true. the second doesn't because:

as it is now ieee80211_mandatory_rates(local, sband->band) returns 1 (1Mbps) in a 2GHz channel. which is o.k. for B only stations.

before we unconditionally used 3 (1Mbps, 2 Mbps) as basic rates. this clearly is wrong in the 5GHz band.

Quoted 11 lines
Quoted 4 lines

i can see the reason why you refused the first patch, but the main problem is that there is no clear distiction between B and G in mac80211. there needs to be a way to configure B-only, G-only and BG ERP mode. i don't believe this is applicable to IBSS mode only... is it?

It is, as far as I can tell. And mesh maybe.

Quoted 2 lines

btw: why is only 1Mbps used as a basic rate in B mode in set_mandatory_flags_band()? i think 2Mbps should be there as well?

Not sure, could be a bug?

maybe... unfortunately i can't find a clear definition of basic rates in the 11b standard, but usually 1 and 2Mbps are used. for b/g compatibiliy i've seen 1, 2, 5.5, 11 used as basic rates - i think that's what most APs do.

Quoted 6 lines
Quoted 4 lines

anyhow, i wouldn't mind adding something to configure this from userspace. can you point me to the right direction? i mean i can add something to IBSS setup but as i said i can't believe this is only relevant to IBSS mode.

What other modes do you think it is relevant to?

i'm not so familiar with the way STA and AP operate, but i thought that also there the distiction between B, B/G and pure-G could make sense. if not i'll just add code to the IBSS setup...

bruno

maintainer
#6 lore raw

Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band

Quoted 9 lines · Bruno Randolf
Quoted 2 lines

No, you don't understand. It will break _talking to_ 11b only stations when the local station is 11g capable.

i understood that this is what you mean. note that i said *without* the other patch! the first patch breaks talking to 11b only stations, true. the second doesn't because:

as it is now ieee80211_mandatory_rates(local, sband->band) returns 1 (1Mbps) in a 2GHz channel. which is o.k. for B only stations.

Oh ok, right.

Quoted 2 lines

before we unconditionally used 3 (1Mbps, 2 Mbps) as basic rates. this clearly is wrong in the 5GHz band.

No, it's fine. Look again at how this works.

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

anyhow, i wouldn't mind adding something to configure this from userspace. can you point me to the right direction? i mean i can add something to IBSS setup but as i said i can't believe this is only relevant to IBSS mode.

What other modes do you think it is relevant to?

i'm not so familiar with the way STA and AP operate, but i thought that also there the distiction between B, B/G and pure-G could make sense.

Not unless you want your 11g+ STA to operate in 11b-only mode.

johannes

#7 lore raw

Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band

Quoted 5 lines · On Monday 12 April 2010 17:40:52 you wrote:
Quoted 2 lines · Bruno Randolf

before we unconditionally used 3 (1Mbps, 2 Mbps) as basic rates. this clearly is wrong in the 5GHz band.

No, it's fine. Look again at how this works.

(hello? can you please stop treating me like an idiot?)

this means we use 6 and 9 as basic rates in the 5GHz band. we should use 6, 12 and 24.

bruno

maintainer
#8 lore raw

Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band

Quoted 11 lines · Bruno Randolf
Quoted 5 lines · On Monday 12 April 2010 17:40:52 you wrote:
Quoted 2 lines · Bruno Randolf

before we unconditionally used 3 (1Mbps, 2 Mbps) as basic rates. this clearly is wrong in the 5GHz band.

No, it's fine. Look again at how this works.

(hello? can you please stop treating me like an idiot?)

this means we use 6 and 9 as basic rates in the 5GHz band. we should use 6, 12 and 24.

No, we can treat 6 and 9 as basic rates if we want to when we create the IBSS. You seem to be confusing basic and mandatory rates or something else that I can't make sense of. It's NOT "clearly wrong".

johannes

#9 lore raw

Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band

Quoted 8 lines · On Tuesday 13 April 2010 16:21:15 Johannes Berg wrote:
Quoted 7 lines · Bruno Randolf
Quoted 5 lines · On Monday 12 April 2010 17:40:52 you wrote:
Quoted 2 lines · Bruno Randolf

before we unconditionally used 3 (1Mbps, 2 Mbps) as basic rates. this clearly is wrong in the 5GHz band.

No, it's fine. Look again at how this works.

Quoted 8 lines
Quoted 4 lines

(hello? can you please stop treating me like an idiot?)

this means we use 6 and 9 as basic rates in the 5GHz band. we should use 6, 12 and 24.

No, we can treat 6 and 9 as basic rates if we want to when we create the IBSS. You seem to be confusing basic and mandatory rates or something else that I can't make sense of. It's NOT "clearly wrong".

ok, i agree that we are probably allowed to choose any basic rates when we create an IBSS - but the question is: why would we want to use lower rates?

does it not make sense to use all mandatory rates as basic rates?

as a side note: the reason i am concerned about the basic rates is that when we use RTC/CTS (which are sent at a basic rate) thruput gets quite low when the basic rates are (too?) low. this is a tradeoff between reliability and speed - and probably should be user configurable. so maybe instead of adding a "g-only" flag to ibss creation, should i add an iw command for setting the basic rates? what do you think about that?

bruno

maintainer NAK
#10 lore raw
In reply to Bruno Randolf
Quoted 22 lines · Bruno Randolf

This changes the mandatory (basic) rates in the 2GHz band to the ERP mandatory rates (1, 2, 5.5, 11, 6, 12, 24Mbps - as defined in 802.11 section 19.1.) instead of the "B" mode basic rate (1Mbps - why not 2Mbps too?).

B-only drivers (are there any?) should still work with this change, since they simply don't have the faster rates. The functional change is that we now default to faster basic rates, but as far as i can tell this is only really used in IBSS code (STAs have to adapt to their AP).

BTW: Is there a way to configure mac80211 to B-only mode or G-only mode? When this is the case this has to be revised...

---
 net/mac80211/util.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/mac80211/util.c +0 -0
index 2b75b4f..282bda9 100644

net/mac80211/util.c u32 ieee80211_mandatory_rates(struct ieee80211_local *local, · line 850

Quoted 8 lines
net/mac80211/util.c +2 -1
@@ -844,7 +844,8 @@ u32 ieee80211_mandatory_rates(struct ieee80211_local *local,
 	}
 
 	if (band == IEEE80211_BAND_2GHZ)
-		mandatory_flag = IEEE80211_RATE_MANDATORY_B;
+		mandatory_flag = IEEE80211_RATE_MANDATORY_B |
+				 IEEE80211_RATE_MANDATORY_G;
 	else
 		mandatory_flag = IEEE80211_RATE_MANDATORY_A;

NACK.

This will do nothing in BSS mode, and will break IBSS mode talking to 11b devices.

johannes