On Fri, Jul 8, 2011 at 6:27 PM, Robert Budde <robert.bu...@gmx.net> wrote:
> Hi!
>
> We are using TPC per packet with the ath9k driver for AR5416/AR5418 and
> AR9280 chipsets. All these chipsets work as expected if you
>
> 1. add "REG_WRITE(ah, AR_PHY_POWER_TX_RATE_MAX, MAX_RATE_POWER |
> AR_PHY_POWER_TX_RATE_MAX_TPC_ENABLE); " to "ar5008_hw_process_ini" in
> "ar5008_phy.c" after " ah->eep_ops->set_txpower"
> 2. replace "MAX_RATE_POWER" in "ath9k_hw_set11n_txdesc(ah, ds, fi->framelen,
> frm_type, MAX_RATE_POWER, fi->keyix, fi->keytype, bf->bf_flags);" in
> function "ath_tx_setup_buffer" of "xmit.c" with some arbitrary value between
> 1 and 20
>
> You can observe how the tx power changes accordingly when altering the
> power-value.

thanks a lot, i will check into this.

>
> Enabling the TPC the same way in "ar9003_phy.c" (see step 1) does not change
> anything. The tx power is always maximum, no matter what is written to the
> tx descriptor. Cards are Sparklan WPEA-127N. Regarding the EEPROM we think
> that it should work by writing to the tx descriptor no matter what is stored
> in the EEPROM. Further, as we are also not able to REDUCE the tx-power, it
> looks uncertain that this problem is caused by the EEPROM.

please check you have this fix in your code

commit 21fdc87248d1d28492c775e05fa92b3c8c7bc8db
Author: Daniel Halperin <dhalp...@cs.washington.edu>
Date:   Tue May 31 11:59:30 2011 -0700

    ath9k: fix two more bugs in tx power

    This is the same fix as

       commit 841051602e3fa18ea468fe5a177aa92b6eb44b56
       Author: Matteo Croce <technobo...@gmail.com>
       Date:   Fri Dec 3 02:25:08 2010 +0100

       The ath9k driver subtracts 3 dBm to the txpower as with two radios the
       signal power is doubled.
       The resulting value is assigned in an u16 which overflows and makes
       the card work at full power.

    in two more places. I grepped the ath tree and didn't find any others.

    Cc: sta...@kernel.org
    Signed-off-by: Daniel Halperin <dhalp...@cs.washington.edu>
    Signed-off-by: John W. Linville <linvi...@tuxdriver.com>

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 0ca7635..ff8150e 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -4645,10 +4645,16 @@ static void
ar9003_hw_set_power_per_rate_table(struct ath_hw *ah,
        case 1:
                break;
        case 2:
-               scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN;
+               if (scaledPower > REDUCE_SCALED_POWER_BY_TWO_CHAIN)
+                       scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN;
+               else
+                       scaledPower = 0;
                break;
        case 3:
-               scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN;
+               if (scaledPower > REDUCE_SCALED_POWER_BY_THREE_CHAIN)
+                       scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN;
+               else
+                       scaledPower = 0;
                break;
        }



>
> Best regards
> Robert
>
> -----Ursprüngliche Nachricht-----
> Von: ath9k-devel-boun...@lists.ath9k.org
> [mailto:ath9k-devel-boun...@lists.ath9k.org] Im Auftrag von Mohammed Shafi
> Gesendet: Freitag, 8. Juli 2011 14:00
> An: Robert Budde
> Cc: ath9k-devel@lists.ath9k.org
> Betreff: Re: [ath9k-devel] AR9380 - Transmit power control per packet
>
> On Fri, Jul 8, 2011 at 2:54 PM, Robert Budde <robert.bu...@gmx.net> wrote:
>> Does nobody have a clue about the problem? Reproducing the issue is
>> totally
>> easy: Just set the AR_PHY_POWER_TX_RATE_MAX_TPC_ENABLE bit in the
>> AR_PHY_POWER_TX_RATE_MAX register and write a tx-power to the packet
>> descriptor - it won't work! Is nobody at Atheros bothered by the fact
>> that transmit control per packet is obviously not working with their
>> latest product on the market?
>
> can you please elaborate on this more and in detail. I have not looked into
> this previously and it will be help me read some docs and fix the issue.  I
> understand AR9300 has a different TPC.
>
>>
>> Best regards,
>> Robert
>>
>> _______________________________________________
>> ath9k-devel mailing list
>> ath9k-devel@lists.ath9k.org
>> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>>
>> _______________________________________________
>> ath9k-devel mailing list
>> ath9k-devel@lists.ath9k.org
>> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>>
>
>
>
> --
> shafi
> _______________________________________________
> ath9k-devel mailing list
> ath9k-devel@lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>
>



-- 
shafi
_______________________________________________
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

Reply via email to