linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: use correct (original) max power
@ 2012-08-01  9:03 Johannes Berg
  2012-08-01  9:07 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2012-08-01  9:03 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

When calculating the maximum TX power for a channel,
the original maximum power should be restricted to
the current regulatory TX power. Restricting the
current maximum TX power has the effect that it'll
never be possible to increase the power again when
the regulatory requirement changes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/wireless/reg.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 2303ee7..070b88c 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -901,7 +901,7 @@ static void handle_channel(struct wiphy *wiphy,
 	chan->max_antenna_gain = min(chan->orig_mag,
 		(int) MBI_TO_DBI(power_rule->max_antenna_gain));
 	chan->max_reg_power = (int) MBM_TO_DBM(power_rule->max_eirp);
-	chan->max_power = min(chan->max_power, chan->max_reg_power);
+	chan->max_power = min(chan->orig_mpwr, chan->max_reg_power);
 }
 
 static void handle_band(struct wiphy *wiphy,
-- 
1.7.10.4


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

* Re: [PATCH] cfg80211: use correct (original) max power
  2012-08-01  9:03 [PATCH] cfg80211: use correct (original) max power Johannes Berg
@ 2012-08-01  9:07 ` Johannes Berg
  2012-08-01 11:09   ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2012-08-01  9:07 UTC (permalink / raw)
  To: linux-wireless; +Cc: Hong Wu, Luis R. Rodriguez

On Wed, 2012-08-01 at 11:03 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> When calculating the maximum TX power for a channel,
> the original maximum power should be restricted to
> the current regulatory TX power. Restricting the
> current maximum TX power has the effect that it'll
> never be possible to increase the power again when
> the regulatory requirement changes.


No ... this isn't right either. Hong Wu, can you please fix this mess?

I have a feeling your patch

commit eccc068e8e84c8fe997115629925e0422a98e4de
Author: Hong Wu <Hong.Wu@dspg.com>
Date:   Wed Jan 11 20:33:39 2012 +0200

    wireless: Save original maximum regulatory transmission power for
the calucation of the local maximum transmit power


should just be reverted?

johannes


> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  net/wireless/reg.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> index 2303ee7..070b88c 100644
> --- a/net/wireless/reg.c
> +++ b/net/wireless/reg.c
> @@ -901,7 +901,7 @@ static void handle_channel(struct wiphy *wiphy,
>  	chan->max_antenna_gain = min(chan->orig_mag,
>  		(int) MBI_TO_DBI(power_rule->max_antenna_gain));
>  	chan->max_reg_power = (int) MBM_TO_DBM(power_rule->max_eirp);
> -	chan->max_power = min(chan->max_power, chan->max_reg_power);
> +	chan->max_power = min(chan->orig_mpwr, chan->max_reg_power);
>  }
>  
>  static void handle_band(struct wiphy *wiphy,



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

* Re: [PATCH] cfg80211: use correct (original) max power
  2012-08-01  9:07 ` Johannes Berg
@ 2012-08-01 11:09   ` Johannes Berg
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2012-08-01 11:09 UTC (permalink / raw)
  To: linux-wireless; +Cc: Hong Wu, Luis R. Rodriguez

On Wed, 2012-08-01 at 11:07 +0200, Johannes Berg wrote:
> On Wed, 2012-08-01 at 11:03 +0200, Johannes Berg wrote:
> > From: Johannes Berg <johannes.berg@intel.com>
> > 
> > When calculating the maximum TX power for a channel,
> > the original maximum power should be restricted to
> > the current regulatory TX power. Restricting the
> > current maximum TX power has the effect that it'll
> > never be possible to increase the power again when
> > the regulatory requirement changes.
> 
> 
> No ... this isn't right either. Hong Wu, can you please fix this mess?

Never mind. Stanislaw already did fix this, I just forgot about it
because I was checking mac80211-next.git and had (of course) applied his
fix to mac80211.git. Sorry!

johannes


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

end of thread, other threads:[~2012-08-01 11:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-01  9:03 [PATCH] cfg80211: use correct (original) max power Johannes Berg
2012-08-01  9:07 ` Johannes Berg
2012-08-01 11:09   ` 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).