Skip to contentSkip to conversation

b43legacy: Partial Fix for Range issue

PATCH In review Larry Finger 3 participants 6 messages Apr 3, 2008 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

PATCH 1/1 b43legacy: Partial Fix for Range issue

When the mac80211 channel tables were recently changed, the power_level member was removed. As a result, the value passed to b43legacy in conf->power_level became zero. This value is transferred to phy->power_level and used in calculating the desired TX power, which thus became zero. This patch does not fix all the power problems with b43legacy, but it will be needed anyway.

---

John,

This is 2.6.25 material.

Larry

drivers/net/wireless/b43legacy/main.c +1 -0
Index: wireless-testing/drivers/net/wireless/b43legacy/main.c
===================================================================
@@ -127,6 +127,7 @@ static struct ieee80211_rate __b43legacy
 	{							\
 		.center_freq	= (_freq),			\
 		.hw_value	= (_chanid),			\
+		.max_power	= 0x14,				\
 	}
 static struct ieee80211_channel b43legacy_bg_chantable[] = {
 	CHANTAB_ENT(1, 2412),

When the mac80211 channel tables were recently changed, the power_level member was removed. As a result, the value passed to b43legacy in conf->power_level became zero. This value is transferred to phy->power_level and used in calculating the desired power, which thus became zero.

---

John,

This is 2.6.25 material.

Larry

drivers/net/wireless/b43legacy/main.c +1 -0
Index: wireless-testing/drivers/net/wireless/b43legacy/main.c
===================================================================
@@ -127,6 +127,7 @@ static struct ieee80211_rate __b43legacy
 	{							\
 		.center_freq	= (_freq),			\
 		.hw_value	= (_chanid),			\
+		.max_power	= 0x14,				\
 	}
 static struct ieee80211_channel b43legacy_bg_chantable[] = {
 	CHANTAB_ENT(1, 2412),
#3 lore raw
Quoted 25 lines · On Thursday 03 April 2008 20:38:37 Larry Finger wrote:

When the mac80211 channel tables were recently changed, the power_level member was removed. As a result, the value passed to b43legacy in conf->power_level became zero. This value is transferred to phy->power_level and used in calculating the desired TX power, which thus became zero. This patch does not fix all the power problems with b43legacy, but it will be needed anyway.

---

John,

This is 2.6.25 material.

Larry

Index: wireless-testing/drivers/net/wireless/b43legacy/main.c
===================================================================

drivers/net/wireless/b43legacy/main.c static struct ieee80211_rate __b43legacy · line 133

Quoted 7 lines
drivers/net/wireless/b43legacy/main.c +1 -0
@@ -127,6 +127,7 @@ static struct ieee80211_rate __b43legacy
  	{							\
  		.center_freq	= (_freq),			\
  		.hw_value	= (_chanid),			\
+		.max_power	= 0x14,				\
  	}
  static struct ieee80211_channel b43legacy_bg_chantable[] = {
  	CHANTAB_ENT(1, 2412),

In b43 I set this value to 30.
I dunno what the real HW upper limit is, so I set it so something that's way above the actual value mac80211 will ever try anyway (because mac80211 won't try illegal rates, if implemented correctly).

Signature · 1 line
Greetings Michael.
#4 lore raw
Quoted 6 lines · Michael Buesch

In b43 I set this value to 30.
I dunno what the real HW upper limit is, so I set it so something that's way above the actual value mac80211 will ever try anyway (because mac80211 won't try illegal rates, if implemented correctly).

I used 20 (0x14) because 20 dBm is the regulatory maximum for almost all regions. In fact, the value of desired_pwr (in Q5.2) that results is 37, or 9.25 dBm. My guess is that this value is too low; however, changing the initialization value to 30 as it is in b43 did not change anything.

Larry

#5 lore raw

PATCH 1/1 cfg80211: default to regulatory max power for channel

In reply to Larry Finger

If the driver does not specify a maximum power output, default to the regulatory max.

---
Is this a worth alternative to Larry's b43legacy patch? It looked like ath5k wasn't setting max_power either -- how does it work?

 net/wireless/reg.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
net/wireless/reg.c +4 -1
index 8cc6037..185488d 100644
@@ -136,7 +136,10 @@ static void handle_channel(struct ieee80211_channel *chan,
 	chan->flags = flags;
 	chan->max_antenna_gain = min(chan->orig_mag,
 					 rg->max_antenna_gain);
-	chan->max_power = min(chan->orig_mpwr, rg->max_power);
+	if (chan->orig_mpwr)
+		chan->max_power = min(chan->orig_mpwr, rg->max_power);
+	else
+		chan->max_power = rg->max_power;
 }
 
 static void handle_band(struct ieee80211_supported_band *sband,
Signature · 1 line
1.5.3.3
#6 lore raw

Re: [PATCH] cfg80211: default to regulatory max power for channel

Quoted 6 lines · On Thursday 03 April 2008 21:32:54 John W. Linville wrote:

If the driver does not specify a maximum power output, default to the regulatory max.

---
Is this a worth alternative to Larry's b43legacy patch? It looked like

Yeah, I like this one much better.
The b43 devices can all be configured up to regulatory limits. So it doesn't really make sense to define a hardware limit. And I think we currently don't even know the real HW limit. One might try to calculate it, but that seems difficult.

Quoted 21 lines

ath5k wasn't setting max_power either -- how does it work?

 net/wireless/reg.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
net/wireless/reg.c +4 -1
index 8cc6037..185488d 100644
@@ -136,7 +136,10 @@ static void handle_channel(struct ieee80211_channel *chan,
 	chan->flags = flags;
 	chan->max_antenna_gain = min(chan->orig_mag,
 					 rg->max_antenna_gain);
-	chan->max_power = min(chan->orig_mpwr, rg->max_power);
+	if (chan->orig_mpwr)
+		chan->max_power = min(chan->orig_mpwr, rg->max_power);
+	else
+		chan->max_power = rg->max_power;
 }
 
 static void handle_band(struct ieee80211_supported_band *sband,
Signature · 1 line
Greetings Michael.
#7 lore raw

Re: [PATCH] cfg80211: default to regulatory max power for channel

In reply to John W. Linville
Quoted 7 lines · John W. Linville

If the driver does not specify a maximum power output, default to the regulatory max.

---
Is this a worth alternative to Larry's b43legacy patch? It looked like ath5k wasn't setting max_power either -- how does it work?

It works the same as my patch did. Yours is clearly better as it "fixes" all drivers.

Larry