On Wed, Nov 18, 2009 at 3:01 PM, Javier Cardona <[email protected]> wrote:
> Hi Luis,
>
> Thanks for your response.
>
> On Tue, Nov 17, 2009 at 6:02 PM, Luis R. Rodriguez <[email protected]> wrote:
>>> Today I've tried to set the transmission power on an SR-71A card and
>>> although the driver apparently accepted the change, I could not
>>> observer any changes with a sniffer.
>>>
>>> I will dig more into this tomorrow, but maybe someone can point me in
>>> the right direction?
>>>
>>> To change the txpower I'm using iwconfig with presumably the
>>> cfg80211/wireless extension compatibility layer:
>>>
>>> # iwconfig wlan0 txpower 20dbm
>>> # iwconfig wlan0
>>> wlan0     IEEE 802.11abgn  ESSID:"cozyguest"
>>>          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:13:10:XX:XX:XX
>>>          Bit Rate=54 Mb/s   Tx-Power=20 dBm
>>>          ...
>>>
>>> # iwconfig wlan0 txpower 0dbm
>>> # iwconfig wlan0
>>> wlan0     IEEE 802.11abgn  ESSID:"cozyguest"
>>>          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:13:10:XX:XX:XX
>>>          Bit Rate=54 Mb/s   Tx-Power=0 dBm
>>>          ...
>>>
>>> # uname -a
>>> Linux javier-jr-192-168-1-80 2.6.32-rc7-wl #1 Tue Nov 17 16:19:14 PST
>>> 2009 i586 GNU/Linux
>>
>> Yeah that should work if it doesn't its a bug.
>
> I believe it is a bug, tell me what you think:
>
> After mac80211 sets IEEE80211_CONF_CHANGE_POWER the driver updates
> sc->config.txpowlimit.  The new value is sent to the card by
> ath_update_txpow() which is only called by:
>
>   1    364  drivers/net/wireless/ath/ath9k/main.c <<ath_set_channel>>
>             ath_update_txpow(sc);
>   2   1230  drivers/net/wireless/ath/ath9k/main.c <<ath_radio_enable>>
>             ath_update_txpow(sc);
>   3   2021  drivers/net/wireless/ath/ath9k/main.c <<ath_reset>>
>             ath_update_txpow(sc);
>   4   2330  drivers/net/wireless/ath/ath9k/main.c <<ath9k_start>>
>             ath_update_txpow(sc);
>
> The new power settings only take effect if one triggers one of these
> functions, for instance by issuing a scan.
>
> Don't have a fix at this time.  The obvious fix did not solve the problem:
>
> diff --git a/drivers/net/wireless/ath/ath9k/main.c
> b/drivers/net/wireless/ath/ath9k/main.c
> index 16bdb1b..b62012e 100644
> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -2795,8 +2795,10 @@ static int ath9k_config(struct ieee80211_hw
> *hw, u32 changed)
>        }
>
>  skip_chan_change:
> -       if (changed & IEEE80211_CONF_CHANGE_POWER)
> +       if (changed & IEEE80211_CONF_CHANGE_POWER) {
>                sc->config.txpowlimit = 2 * conf->power_level;
> +               ath_update_txpow(sc);
> +       }
>
>        spin_lock_bh(&sc->wiphy_lock);
>        disable_radio = ath9k_all_wiphys_idle(sc);
>
> But issuing a scan after changing the power did:
>
> # iwconfig wlan0 txpower 10dbm; iw dev wlan0 scan
>
> ( Scanning seems to be the magic word that one must invoke to get
> things done on ath9k...
> http://bugzilla.kernel.org/show_bug.cgi?id=14187 :)
>
> I'll be happy to try/test different approaches to fix this.

Thanks for the details Javier, can you please file a bug report on
kernel.org against this?

  Luis
_______________________________________________
ath9k-devel mailing list
[email protected]
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

Reply via email to