Re: [RFC 4/5] mt76: move mt76x02_mac_write_txwi in mt76x02-lib module

2018-10-01 Thread Stanislaw Gruszka
On Mon, Oct 01, 2018 at 12:06:56PM +0200, Lorenzo Bianconi wrote: > > 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

Re: [RFC 4/5] mt76: move mt76x02_mac_write_txwi in mt76x02-lib module

2018-10-01 Thread Lorenzo Bianconi
> On Sat, Sep 29, 2018 at 07:44:55PM +0200, Lorenzo Bianconi wrote: > > + 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

Re: [RFC 4/5] mt76: move mt76x02_mac_write_txwi in mt76x02-lib module

2018-10-01 Thread Felix Fietkau
On 2018-10-01 07:48, Stanislaw Gruszka wrote: > 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;

Re: [RFC 4/5] mt76: move mt76x02_mac_write_txwi in mt76x02-lib module

2018-09-30 Thread Stanislaw Gruszka
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; > +

[RFC 4/5] mt76: move mt76x02_mac_write_txwi in mt76x02-lib module

2018-09-29 Thread Lorenzo Bianconi
Move mt76x02_mac_write_txwi in mt76x02_mac.c since it is shared between mt76x0 and mt76x2 drivers. This is a preliminary patch to unify txwi configuration between mt76x0 and mt76x2 drivers Signed-off-by: Lorenzo Bianconi --- .../net/wireless/mediatek/mt76/mt76x02_mac.c | 63 +++