Skip to contentSkip to conversation

How to store HT (40MHz) support

RFC In review Rafał Miłecki 3 participants 4 messages Jan 20, 2010 – Jan 21, 2010 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

RFC 1/1 How to store HT (40MHz) support

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.

drivers/net/wireless/b43/main.c +3 -0
index 9c5c7c9..641c7de 100644
@@ -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)
drivers/net/wireless/b43/phy_common.h +4 -0
index 9edd4e8..62c7028 100644
@@ -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;
 
drivers/net/wireless/b43/phy_n.c +1 -1
index e77f1f2..ed8f372 100644
@@ -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;
Signature · 1 line
Rafał
maintainer
#1 lore raw

drivers/net/wireless/b43/main.c static int b43_op_config(struct ieee80211_hw *hw, u32 changed) · line 3574

Quoted 1 line · Rafał Miłecki
drivers/net/wireless/b43/main.c +1 -0
+	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.

drivers/net/wireless/b43/main.c static int b43_op_config(struct ieee80211_hw *hw, u32 changed) · line 3575

Quoted 1 line
drivers/net/wireless/b43/main.c +1 -0
+		phy->use_40mhz = conf_is_ht(conf);

This is wrong, conf_is_ht might also be 20mhz, look at the other helpers.

johannes

#2 lore raw

W dniu 20 stycznia 2010 11:18 użytkownik Johannes Berg

Quoted 5 lines · <[email protected]> napisał:
Quoted 1 line · Rafał Miłecki

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

Signature · 1 line
Rafał
#3 lore raw

2010/1/21 Rafał Miłecki <[email protected]>:

Quoted 8 lines

W dniu 20 stycznia 2010 11:18 użytkownik Johannes Berg

Quoted 5 lines · <[email protected]> napisał:
Quoted 1 line · Rafał Miłecki

+             phy->use_40mhz = conf_is_ht(conf);

This is wrong, conf_is_ht might also be 20mhz, look at the other helpers.

Quoted 6 lines

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.

Quoted 2 lines

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.

Quoted 4 lines

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.

Quoted 6 lines

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