linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Robin Dong <hao.bigrat@gmail.com>
Cc: linux-wireless@vger.kernel.org, Robin Dong <sanbai@taobao.com>
Subject: Re: [PATCH] fix iwl3945 tx power setting in iwl3945_init_drv
Date: Mon, 11 Apr 2011 20:25:31 +0200	[thread overview]
Message-ID: <20110411182531.GA5344@redhat.com> (raw)
In-Reply-To: <1302433562-4078-1-git-send-email-hao.bigrat@gmail.com>

Hi Robin

> When I build and run the kernel-2.6.39-rc2 on my laptop, my intel-3945-a/b/g wireless
> card will not work and the dmesg is:
> 
> [   58.597834] iwl3945 0000:03:00.0: Requested user TXPOWER 15 above upper limit 14.
> [   58.597839] iwl3945 0000:03:00.0: Error setting Tx power (-22).
> [   58.598276] iwl3945 0000:03:00.0: Requested user TXPOWER 15 above upper limit 14.
> [   58.598279] iwl3945 0000:03:00.0: Error setting Tx power (-22).
> [   94.064147] iwl3945 0000:03:00.0: Requested user TXPOWER 15 above upper limit 14.
> [   94.064152] iwl3945 0000:03:00.0: Error setting Tx power (-22).
> [   94.064529] iwl3945 0000:03:00.0: Requested user TXPOWER 15 above upper limit 14.
> [   94.064533] iwl3945 0000:03:00.0: Error setting Tx power (-22).
> [  133.892160] sky2 0000:02:00.0: eth1: disabling interface
> [  473.313935] sky2 0000:02:00.0: eth1: enabling interface
> [  473.314238] ADDRCONF(NETDEV_UP): eth1: link is not ready
> [  473.383740] iwl3945 0000:03:00.0: Requested user TXPOWER 15 above upper limit 14.
> [  473.383748] iwl3945 0000:03:00.0: Error setting Tx power (-22).
> [  473.384146] iwl3945 0000:03:00.0: Requested user TXPOWER 15 above upper limit 14.
> [  473.384153] iwl3945 0000:03:00.0: Error setting Tx power (-22).
> [  473.455655] iwl3945 0000:03:00.0: Requested user TXPOWER 15 above upper limit 14.
> [  473.455663] iwl3945 0000:03:00.0: Error setting Tx power (-22).
> [  473.456128] iwl3945 0000:03:00.0: Requested user TXPOWER 15 above upper limit 14.
> [  473.456134] iwl3945 0000:03:00.0: Error setting Tx power (-22).
> 
> It is weird the iwl3945 set txpower 15 above limit 14.
> So I checked iwl4965 and iwl3945 driver and found out it will set 
> tx_power_next to 0 in "iwl4965_init_drv" but to 15 in "iwl3945_init_drv"
> I change tx_power_next=0 in "iwl3945_init_drv", and my wireless card works.

Thanks for catching this. I wonder if this is a problem of bad
tx_power_device_lmt value instead of default setting, because on older
kernel default tx_power value 15 worked, right? I would like to avoid
changing default setting is possible.

Could you apply below simple patch and apply similar changes on older
kernel to compare if tx_power_device_lmt change on your system between
kernels and why?

diff --git a/drivers/net/wireless/iwlegacy/iwl-core.c b/drivers/net/wireless/iwlegacy/iwl-core.c
index 7007d61..78af49b 100644
--- a/drivers/net/wireless/iwlegacy/iwl-core.c
+++ b/drivers/net/wireless/iwlegacy/iwl-core.c
@@ -235,6 +235,9 @@ int iwl_legacy_init_geos(struct iwl_priv *priv)
 
 			geo_ch->flags |= ch->ht40_extension_channel;
 
+			printk("ch->max_power_avg %u, priv->tx_power_device_lmt %u\n",
+				ch->max_power_avg, priv->tx_power_device_lmt);
+
 			if (ch->max_power_avg > priv->tx_power_device_lmt)
 				priv->tx_power_device_lmt = ch->max_power_avg;
 		} else {
diff --git a/drivers/net/wireless/iwlegacy/iwl-eeprom.c b/drivers/net/wireless/iwlegacy/iwl-eeprom.c
index 04c5648..45f458b 100644
--- a/drivers/net/wireless/iwlegacy/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlegacy/iwl-eeprom.c
@@ -448,6 +448,7 @@ int iwl_legacy_init_channel_map(struct iwl_priv *priv)
 			/* Initialize regulatory-based run-time data */
 			ch_info->max_power_avg = ch_info->curr_txpow =
 			    eeprom_ch_info[ch].max_power_avg;
+			printk("band %d ch %d max_power_avg %d\n", band, ch, ch_info->max_power_avg);
 			ch_info->scan_power = eeprom_ch_info[ch].max_power_avg;
 			ch_info->min_power = 0;
 

  reply	other threads:[~2011-04-11 18:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-10 11:06 [PATCH] fix iwl3945 tx power setting in iwl3945_init_drv Robin Dong
2011-04-11 18:25 ` Stanislaw Gruszka [this message]
2011-04-12 14:26   ` Stanislaw Gruszka
2011-04-13  6:06     ` Robin Dong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110411182531.GA5344@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=hao.bigrat@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sanbai@taobao.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).