From: Felix Fietkau <nbd@nbd.name>
To: Shayne Chen <shayne.chen@mediatek.com>
Cc: linux-mediatek <linux-mediatek@lists.infradead.org>,
Lorenzo Bianconi <lorenzo.bianconi@redhat.com>,
Ryder Lee <ryder.lee@mediatek.com>,
linux-wireless <linux-wireless@vger.kernel.org>,
Evelyn Tsai <evelyn.tsai@mediatek.com>
Subject: Re: [PATCH 3/4] mt76: mt7915: add support for DT rate power limits
Date: Tue, 16 Jun 2020 20:28:23 +0200 [thread overview]
Message-ID: <779faac5-5922-80e6-299d-769e795ea419@nbd.name> (raw)
In-Reply-To: <279b29408c742c4b043e7af11217dcd5eeb7b8c2.1592276165.git.ryder.lee@mediatek.com>
On 2020-06-16 14:46, Shayne Chen wrote:
> Add support to limit per-rate max txpower from DT.
>
> Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
> ---
> .../wireless/mediatek/mt76/mt7915/eeprom.h | 2 +-
> .../net/wireless/mediatek/mt76/mt7915/mcu.c | 38 +++++++++++++++++--
> 2 files changed, 35 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h
> index 4e31d6ab4fa6..284de8b4e0a4 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h
> @@ -120,6 +120,6 @@ mt7915_tssi_enabled(struct mt7915_dev *dev, enum nl80211_band band)
> return eep[MT_EE_WIFI_CONF + 7] & MT_EE_WIFI_CONF_TSSI0_2G;
> }
>
> -extern const struct sku_group mt7915_sku_groups[];
> +extern const struct sku_group mt7915_sku_groups[MAX_SKU_RATE_GROUP_NUM];
>
> #endif
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> index 349163d0b7f2..c5e9893cbd87 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> @@ -3171,15 +3171,45 @@ int mt7915_mcu_set_sku(struct mt7915_phy *phy)
> .format_id = 4,
> .dbdc_idx = phy != &dev->phy,
> };
> - int i;
> - s8 *delta;
> + struct mt76_power_limits limits_array;
> + s8 *delta, *la = (s8 *)&limits_array;
> + int i, idx;
>
> delta = dev->rate_power[mphy->chandef.chan->band];
> mphy->txpower_cur = hw->conf.power_level * 2 +
> delta[MT7915_SKU_MAX_DELTA_IDX];
I think the delta needs to be subtracted instead of added here.
> - for (i = 0; i < MT7915_SKU_RATE_NUM; i++)
> - req.val[i] = hw->conf.power_level * 2 + delta[i];
> + mt76_get_rate_power_limits(mphy, mphy->chandef.chan,
> + &limits_array, mphy->txpower_cur);
This should set mphy->txpower_cur to the return code of
mt76_get_rate_power_limits. The nss delta is added in the core mt76 code
before reporting to user space.
- Felix
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
next prev parent reply other threads:[~2020-06-16 18:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 12:46 [PATCH 1/4] dt-bindings: net: wireless: mt76: add ru property in power-limits node Shayne Chen
2020-06-16 12:46 ` [PATCH 2/4] mt76: extend DT rate power limits to support 11ax devices Shayne Chen
2020-06-16 12:46 ` [PATCH 3/4] mt76: mt7915: add support for DT rate power limits Shayne Chen
2020-06-16 18:28 ` Felix Fietkau [this message]
2020-06-16 12:46 ` [PATCH 4/4] mt76: mt7915: add support to read per-rate tx power from HW in debugfs Shayne Chen
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=779faac5-5922-80e6-299d-769e795ea419@nbd.name \
--to=nbd@nbd.name \
--cc=evelyn.tsai@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=ryder.lee@mediatek.com \
--cc=shayne.chen@mediatek.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