From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Jonas Jelonek <jelonek.jonas@gmail.com>, linux-wireless@vger.kernel.org
Cc: thomas.huehn@hs-nordhausen.de, nbd@nbd.name, kvalo@kernel.org,
johannes.berg@intel.com, lorenzo@kernel.org,
Jonas Jelonek <jelonek.jonas@gmail.com>
Subject: Re: [PATCH v2] ath9k: fix per-packet TX-power cap for TPC
Date: Thu, 30 Mar 2023 17:11:07 +0200 [thread overview]
Message-ID: <87r0t6mfzo.fsf@toke.dk> (raw)
In-Reply-To: <20230330132159.758088-1-jelonek.jonas@gmail.com>
Jonas Jelonek <jelonek.jonas@gmail.com> writes:
> Fix incorrect usage of plain rate_idx as index into the max (power) per
> rate lookup table.
>
> For transmit power control (TPC), the ath9k driver maintains internal
> tables (in struct ath_hw) to store the max allowed power level per rate.
> They are used to limit a given TX-power according to regulatory and user
> limits in the TX-path per packet. The tables are filled in a predefined
> order, starting with values for CCK + OFDM rates and followed by the
> values for MCS rates. Thus, the maximum power levels for MCS do not
> start at index 0 in the table but are shifted by a fixed value.
>
> The TX-power limiting in ath_get_rate_txpower currently does not apply
> this shift, thus retrieves the incorrect maximum power level for a given
> rate. In particular for MCS rates, the maximum power levels for CCK/OFDM
> rates were used, e.g. maximum power for OFDM 0 was used for MCS 0. If
> STBC is used, the power is mostly limited to 0 because the STBC table
> is zeroed for legacy CCK/OFDM rates. Encountered this during testing of
> our work-in-progress TPC per packet for ath9k.
> This only has an effect when TPC is enabled in ath9k (tpc_enabled in
> struct ath_hw) which defaults to false. In this case it has a
> significant impact on the used TX-power, throughput + RSSI. Otherwise
> the affected code is just skipped and TX-power is limited with the
> hardware registers only. This patch fixes this table lookup.
>
> Tested on OpenWrt (kernel 5.15.98, but backported ath9k driver) with
> small desk setup using ath9k chips AR9280 and AR9580. Cap of TX-power is
> working properly for all rates now, throughput and RSSI as expected,
> equal to as if TPC was disabled.
> Compile-tested with latest 6.3 kernel + allyesconfig.
>
> Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
next prev parent reply other threads:[~2023-03-30 15:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-30 13:21 [PATCH v2] ath9k: fix per-packet TX-power cap for TPC Jonas Jelonek
2023-03-30 15:11 ` Toke Høiland-Jørgensen [this message]
2023-04-17 10:31 ` Kalle Valo
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=87r0t6mfzo.fsf@toke.dk \
--to=toke@toke.dk \
--cc=jelonek.jonas@gmail.com \
--cc=johannes.berg@intel.com \
--cc=kvalo@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=thomas.huehn@hs-nordhausen.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.