From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Cc: nbd@nbd.name, linux-wireless@vger.kernel.org
Subject: Re: [RFC 4/5] mt76: move mt76x02_mac_write_txwi in mt76x02-lib module
Date: Mon, 1 Oct 2018 07:48:39 +0200 [thread overview]
Message-ID: <20181001054838.GC22206@redhat.com> (raw)
In-Reply-To: <20180929174456.995-5-lorenzo.bianconi@redhat.com>
On Sat, Sep 29, 2018 at 07:44:55PM +0200, Lorenzo Bianconi wrote:
> + spin_lock_bh(&dev->lock);
> + if (wcid && (rate->idx < 0 || !rate->count)) {
> + txwi->rate = wcid->tx_rate;
> + max_txpwr_adj = wcid->max_txpwr_adj;
> + nss = wcid->tx_rate_nss;
> + } else {
> + txwi->rate = mt76x02_mac_tx_rate_val(dev, rate, &nss);
> + max_txpwr_adj = mt76x02_tx_get_max_txpwr_adj(dev, rate);
> + }
> + spin_unlock_bh(&dev->lock);
> +
> + if (dev->drv->get_tx_txpwr_adj) {
> + txpwr_adj = dev->drv->get_tx_txpwr_adj(dev, dev->txpower_conf,
> + max_txpwr_adj);
> + txwi->ctl2 = FIELD_PREP(MT_TX_PWR_ADJ, txpwr_adj);
> + }
> +
> + if (is_mt76x2(dev) && mt76_rev(dev) >= MT76XX_REV_E4)
> + txwi->txstream = 0x13;
> + else if (is_mt76x2(dev) && mt76_rev(dev) >= MT76XX_REV_E3 &&
> + !(txwi->rate & cpu_to_le16(rate_ht_mask)))
> + txwi->txstream = 0x93;
All above looks mt76x2 specific, maybe would be beter to place this in
in setup_txwi() calback i.e:
if (dev->drv->setup_txwi)
drv->drv->setup_txwi(...)
or maybe you plan to implement get_tx_txpwr_adj() for mt76x0 as well,
is this feature supported by the MT76x0 chips ?
Thanks
Stanislaw
next prev parent reply other threads:[~2018-10-01 5:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-29 17:44 [RFC 4/5] mt76: move mt76x02_mac_write_txwi in mt76x02-lib module Lorenzo Bianconi
2018-10-01 5:48 ` Stanislaw Gruszka [this message]
2018-10-01 10:04 ` Felix Fietkau
2018-10-01 10:06 ` Lorenzo Bianconi
2018-10-01 16:00 ` Stanislaw Gruszka
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=20181001054838.GC22206@redhat.com \
--to=sgruszka@redhat.com \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=nbd@nbd.name \
/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.