On 2018-11-08 16:52, Stanislaw Gruszka wrote: > On Thu, Nov 08, 2018 at 03:58:29PM +0100, Lorenzo Bianconi wrote: >> > For STA mode configure legacy basic rates according to info >> > mac80211 provides to us, as well as follback registers, which >> > are setup in vendor driver under CONFIG_STA_SUPPORT . >> > For LB_FBK_CFG1 register use values from vendor driver, which >> > are different for mt76x0 and mt76x2 . >> > >> > Signed-off-by: Stanislaw Gruszka <sgrus...@redhat.com> >> > --- >> > drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 12 ++++++++++++ >> > 1 file changed, 12 insertions(+) >> > >> > diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c >> > b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c >> > index 87ce6a51fb05..2be4b527477f 100644 >> > --- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c >> > +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c >> > @@ -678,6 +678,18 @@ void mt76x02_bss_info_changed(struct ieee80211_hw *hw, >> > tasklet_enable(&dev->pre_tbtt_tasklet); >> > } >> > >> > + if (changed & BSS_CHANGED_BASIC_RATES && >> > + vif->type == NL80211_IFTYPE_STATION) { >> > + mt76_wr(dev, MT_LEGACY_BASIC_RATE, info->basic_rates); >> > + mt76_wr(dev, MT_VHT_HT_FBK_CFG0, 0x65432100); >> > + mt76_wr(dev, MT_VHT_HT_FBK_CFG1, 0xedcba980); >> > + mt76_wr(dev, MT_LG_FBK_CFG0, 0xedcba988); >> > + if (is_mt76x2(dev)) >> > + mt76_wr(dev, MT_LG_FBK_CFG1, 0x87872100); >> > + else >> > + mt76_wr(dev, MT_LG_FBK_CFG1, 0x00872100); >> > + } >> > + >> >> since these values are constant, why not put them init_vals? > > I wanted them to be used only in STA mode like vendor driver does. > However if we will have AP+STA , we still will configure them, > so better to configure them anyway and put in init_vals . Yes, I think we should put them in initvals. Also, I think we should keep the values the shared between mt76x0 and mt76x2.
For MT_LG_FBK_CFG1 there is no need to make a distinction between 76x2 and 76x0, because 76x0 will simply ignore the upper values (they apply to 2SS transmission only). Also, I don't think MT_VHT_HT_FBK_CFG1 even gets used on mt76x0, because it is for 2SS rates only. However, the value in there seems more useful than the one we currently use on mt76x2, because it allows fallback from 2SS MCS0 to 1SS MCS0. The contents of MT_LG_FBK_CFG0 also match the default initialization values documented in the 7612E datasheet. I don't think there is any meaningful difference between the 76x2 and the 76x0 MAC except for the missing 2SS support. - Felix