linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mac80211: Use G mandatory rates in 2GHz band
@ 2010-04-12  7:36 Bruno Randolf
  2010-04-12  7:37 ` [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band Bruno Randolf
  2010-04-12  7:39 ` [PATCH 1/2] mac80211: Use G mandatory rates in 2GHz band Johannes Berg
  0 siblings, 2 replies; 11+ messages in thread
From: Bruno Randolf @ 2010-04-12  7:36 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless

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...

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 net/mac80211/util.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 2b75b4f..282bda9 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -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;
 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band
  2010-04-12  7:36 [PATCH 1/2] mac80211: Use G mandatory rates in 2GHz band Bruno Randolf
@ 2010-04-12  7:37 ` Bruno Randolf
  2010-04-12  7:41   ` Johannes Berg
  2010-04-12  7:39 ` [PATCH 1/2] mac80211: Use G mandatory rates in 2GHz band Johannes Berg
  1 sibling, 1 reply; 11+ messages in thread
From: Bruno Randolf @ 2010-04-12  7:37 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless

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.

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 net/mac80211/ibss.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 01974c2..05846ab 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -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);
 }
 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] mac80211: Use G mandatory rates in 2GHz band
  2010-04-12  7:36 [PATCH 1/2] mac80211: Use G mandatory rates in 2GHz band Bruno Randolf
  2010-04-12  7:37 ` [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band Bruno Randolf
@ 2010-04-12  7:39 ` Johannes Berg
  1 sibling, 0 replies; 11+ messages in thread
From: Johannes Berg @ 2010-04-12  7:39 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless

On Mon, 2010-04-12 at 16:36 +0900, Bruno Randolf wrote:
> 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...
> 
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
>  net/mac80211/util.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/net/mac80211/util.c b/net/mac80211/util.c
> index 2b75b4f..282bda9 100644
> --- a/net/mac80211/util.c
> +++ b/net/mac80211/util.c
> @@ -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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band
  2010-04-12  7:37 ` [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band Bruno Randolf
@ 2010-04-12  7:41   ` Johannes Berg
  2010-04-12  7:58     ` Bruno Randolf
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2010-04-12  7:41 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless

On Mon, 2010-04-12 at 16:37 +0900, Bruno Randolf wrote:
> 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band
  2010-04-12  7:41   ` Johannes Berg
@ 2010-04-12  7:58     ` Bruno Randolf
  2010-04-12  8:10       ` Johannes Berg
  0 siblings, 1 reply; 11+ messages in thread
From: Bruno Randolf @ 2010-04-12  7:58 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless

On Monday 12 April 2010 16:41:22 you wrote:
> On Mon, 2010-04-12 at 16:37 +0900, Bruno Randolf wrote:
> > 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band
  2010-04-12  7:58     ` Bruno Randolf
@ 2010-04-12  8:10       ` Johannes Berg
  2010-04-12  8:34         ` Bruno Randolf
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2010-04-12  8:10 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless

On Mon, 2010-04-12 at 16:58 +0900, Bruno Randolf wrote:
> On Monday 12 April 2010 16:41:22 you wrote:
> > On Mon, 2010-04-12 at 16:37 +0900, Bruno Randolf wrote:
> > > 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.

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

> 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.

> 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?

> 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band
  2010-04-12  8:10       ` Johannes Berg
@ 2010-04-12  8:34         ` Bruno Randolf
  2010-04-12  8:40           ` Johannes Berg
  0 siblings, 1 reply; 11+ messages in thread
From: Bruno Randolf @ 2010-04-12  8:34 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless

On Monday 12 April 2010 17:10:01 Johannes Berg wrote:
> On Mon, 2010-04-12 at 16:58 +0900, Bruno Randolf wrote:
> > On Monday 12 April 2010 16:41:22 you wrote:
> > > On Mon, 2010-04-12 at 16:37 +0900, Bruno Randolf wrote:
> > > > 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.
> 
> 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.

> > 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.
> 
> > 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.

> > 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band
  2010-04-12  8:34         ` Bruno Randolf
@ 2010-04-12  8:40           ` Johannes Berg
  2010-04-13  0:16             ` Bruno Randolf
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2010-04-12  8:40 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless

On Mon, 2010-04-12 at 17:34 +0900, Bruno Randolf wrote:

> > 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.

> 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.

> > > 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band
  2010-04-12  8:40           ` Johannes Berg
@ 2010-04-13  0:16             ` Bruno Randolf
  2010-04-13  7:21               ` Johannes Berg
  0 siblings, 1 reply; 11+ messages in thread
From: Bruno Randolf @ 2010-04-13  0:16 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless

On Monday 12 April 2010 17:40:52 you wrote:
> On Mon, 2010-04-12 at 17:34 +0900, Bruno Randolf wrote:
> > 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band
  2010-04-13  0:16             ` Bruno Randolf
@ 2010-04-13  7:21               ` Johannes Berg
  2010-04-13  7:56                 ` Bruno Randolf
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2010-04-13  7:21 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless

On Tue, 2010-04-13 at 09:16 +0900, Bruno Randolf wrote:
> On Monday 12 April 2010 17:40:52 you wrote:
> > On Mon, 2010-04-12 at 17:34 +0900, Bruno Randolf wrote:
> > > 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band
  2010-04-13  7:21               ` Johannes Berg
@ 2010-04-13  7:56                 ` Bruno Randolf
  0 siblings, 0 replies; 11+ messages in thread
From: Bruno Randolf @ 2010-04-13  7:56 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless

On Tuesday 13 April 2010 16:21:15 Johannes Berg wrote:
> On Tue, 2010-04-13 at 09:16 +0900, Bruno Randolf wrote:
> > On Monday 12 April 2010 17:40:52 you wrote:
> > > On Mon, 2010-04-12 at 17:34 +0900, Bruno Randolf wrote:
> > > > 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".

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-04-13  7:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-12  7:36 [PATCH 1/2] mac80211: Use G mandatory rates in 2GHz band Bruno Randolf
2010-04-12  7:37 ` [PATCH 2/2] mac80211: Initialize IBSS basic rates according to band Bruno Randolf
2010-04-12  7:41   ` Johannes Berg
2010-04-12  7:58     ` Bruno Randolf
2010-04-12  8:10       ` Johannes Berg
2010-04-12  8:34         ` Bruno Randolf
2010-04-12  8:40           ` Johannes Berg
2010-04-13  0:16             ` Bruno Randolf
2010-04-13  7:21               ` Johannes Berg
2010-04-13  7:56                 ` Bruno Randolf
2010-04-12  7:39 ` [PATCH 1/2] mac80211: Use G mandatory rates in 2GHz band Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).