* [RFC] How to store HT (40MHz) support
@ 2010-01-20 0:06 Rafał Miłecki
2010-01-20 10:18 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Rafał Miłecki @ 2010-01-20 0:06 UTC (permalink / raw)
To: linux-wireless@vger.kernel.org, Michael Buesch
Cc: bcm43xx-dev@lists.berlios.de
In N-PHY code we have to make some decisions based on fact if band is 40MHz.
AFAIU when registering device, driver reports to mac80211 HT capability and this is not implemented yet. For that we will need to modify:
static struct ieee80211_supported_band b43_band_5GHz_nphy = { ... }
Then mac80211 can request switching to 40MHz usage using ieee80211_ops.config (which we handle in b43_op_config).
Is that correct? If so, is attached patch fine for storing 40MHz usage? We don't report HT support to mac80211 so it should not request 40MHz usage for now.
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 9c5c7c9..641c7de 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3571,6 +3571,9 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
dev = wl->current_dev;
phy = &dev->phy;
+ if (phy->supports_40mhz)
+ phy->use_40mhz = conf_is_ht(conf);
+
b43_mac_suspend(dev);
if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS)
diff --git a/drivers/net/wireless/b43/phy_common.h b/drivers/net/wireless/b43/phy_common.h
index 9edd4e8..62c7028 100644
--- a/drivers/net/wireless/b43/phy_common.h
+++ b/drivers/net/wireless/b43/phy_common.h
@@ -212,6 +212,10 @@ struct b43_phy {
bool supports_2ghz;
bool supports_5ghz;
+ /* Band width support and usage */
+ bool supports_40mhz;
+ bool use_40mhz;
+
/* GMODE bit enabled? */
bool gmode;
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index e77f1f2..ed8f372 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -1787,7 +1787,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
b43_phy_write(dev, B43_NPHY_IQLOCAL_CMDGCTL, 0x8AA9);
- if (1 /* FIXME: the band width is 20 MHz */)
+ if (!dev->phy.use_40mhz)
freq = 2500;
else
freq = 5000;
--
Rafał
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [RFC] How to store HT (40MHz) support
2010-01-20 0:06 [RFC] How to store HT (40MHz) support Rafał Miłecki
@ 2010-01-20 10:18 ` Johannes Berg
2010-01-21 15:50 ` Rafał Miłecki
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2010-01-20 10:18 UTC (permalink / raw)
To: Rafał Miłecki
Cc: linux-wireless@vger.kernel.org, Michael Buesch,
bcm43xx-dev@lists.berlios.de
[-- Attachment #1: Type: text/plain, Size: 333 bytes --]
On Wed, 2010-01-20 at 01:06 +0100, Rafał Miłecki wrote:
> + if (phy->supports_40mhz)
That is useless, if it doesn't support it then you should not advertise
it and mac80211 will not use it.
> + phy->use_40mhz = conf_is_ht(conf);
This is wrong, conf_is_ht might also be 20mhz, look at the other
helpers.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] How to store HT (40MHz) support
2010-01-20 10:18 ` Johannes Berg
@ 2010-01-21 15:50 ` Rafał Miłecki
2010-01-21 17:18 ` Luis R. Rodriguez
0 siblings, 1 reply; 4+ messages in thread
From: Rafał Miłecki @ 2010-01-21 15:50 UTC (permalink / raw)
To: Johannes Berg
Cc: linux-wireless@vger.kernel.org, Michael Buesch,
bcm43xx-dev@lists.berlios.de
W dniu 20 stycznia 2010 11:18 użytkownik Johannes Berg
<johannes@sipsolutions.net> napisał:
> On Wed, 2010-01-20 at 01:06 +0100, Rafał Miłecki wrote:
>> + phy->use_40mhz = conf_is_ht(conf);
>
> This is wrong, conf_is_ht might also be 20mhz, look at the other
> helpers.
I tried to understand what actually is HT and after reading many
articles I have more knowledge but still I'm not 100% sure.
AFAIU:
1) HT means using more than 1 stream in channel (and can be on any:
20MHz or 40MHz)
2) conf_is_ht(...) checks if mac80211 want us to use more than 1
stream in channel
3) conf_is_ht40_minus(...) checks if we should use frequency below
current as additional 20MHz, so for example for channel 7 which is
2,431->2,453 we should use additinal 20MHz in channel 3 which is
2,411->2,433
4) conf_is_ht40_plus(...) checks if we should use frequency over
current as additional 20MHz, so for example for channel 3 which is
2,411->2,433 we should use additinal 20MHz in channel 7 which is
2,431->2,453
Is that correct?
--
Rafał
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] How to store HT (40MHz) support
2010-01-21 15:50 ` Rafał Miłecki
@ 2010-01-21 17:18 ` Luis R. Rodriguez
0 siblings, 0 replies; 4+ messages in thread
From: Luis R. Rodriguez @ 2010-01-21 17:18 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Johannes Berg, linux-wireless@vger.kernel.org, Michael Buesch,
bcm43xx-dev@lists.berlios.de
2010/1/21 Rafał Miłecki <zajec5@gmail.com>:
> W dniu 20 stycznia 2010 11:18 użytkownik Johannes Berg
> <johannes@sipsolutions.net> napisał:
>> On Wed, 2010-01-20 at 01:06 +0100, Rafał Miłecki wrote:
>>> + phy->use_40mhz = conf_is_ht(conf);
>>
>> This is wrong, conf_is_ht might also be 20mhz, look at the other
>> helpers.
>
> I tried to understand what actually is HT and after reading many
> articles I have more knowledge but still I'm not 100% sure.
>
> AFAIU:
> 1) HT means using more than 1 stream in channel (and can be on any:
> 20MHz or 40MHz)
No, you can have single stream HT devices.
> 2) conf_is_ht(...) checks if mac80211 want us to use more than 1
> stream in channel
No, conf_is_ht() tells you whether or not the current device
configuration is set up to be on HT configuration.
> 3) conf_is_ht40_minus(...) checks if we should use frequency below
> current as additional 20MHz, so for example for channel 7 which is
> 2,431->2,453 we should use additinal 20MHz in channel 3 which is
> 2,411->2,433
Right it just means the secondary channel is on the lower part of the
primary, ht40_plus means its above.
> 4) conf_is_ht40_plus(...) checks if we should use frequency over
> current as additional 20MHz, so for example for channel 3 which is
> 2,411->2,433 we should use additinal 20MHz in channel 7 which is
> 2,431->2,453
>
> Is that correct?
Almost, may want to read this:
http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n
I hope that helps.
Luis
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-21 17:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20 0:06 [RFC] How to store HT (40MHz) support Rafał Miłecki
2010-01-20 10:18 ` Johannes Berg
2010-01-21 15:50 ` Rafał Miłecki
2010-01-21 17:18 ` Luis R. Rodriguez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox