mconf->mt76.omac_idx = ieee80211_vif_is_mld(vif) ?
0 : mconf->mt76.idx;
mconf->mt76.band_idx = 0xff;
+
+ if (is_mt7927(&dev->mt76)) {
+ struct ieee80211_channel *chan;
+
+ if (link_conf->chanreq.oper.chan)
+ chan = link_conf->chanreq.oper.chan;
+ else
+ chan = mvif->phy->mt76->chandef.chan;
+
+ mconf->mt76.band_idx = mt7927_band_idx(chan->band);
+ }
+
mconf->mt76.wmm_idx = ieee80211_vif_is_mld(vif) ?
0 : mconf->mt76.idx % MT76_CONNAC_MAX_WMM_SETS;
mconf->mt76.link_idx = hweight16(mvif->valid_links);
return err;
}
+static int
+mt7927_reconfig_band(struct mt792x_dev *dev, struct ieee80211_vif *vif,
+ struct ieee80211_bss_conf *link_conf,
+ struct mt792x_bss_conf *mconf,
+ u8 band_idx)
+{
+ struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
+ struct mt792x_link_sta *mlink = &mvif->sta.deflink;
+ int ret;
+
+ ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf,
+ &mconf->mt76, &mlink->wcid,
+ false);
+ if (ret)
+ return ret;
+
+ mconf->mt76.band_idx = band_idx;
+
+ return mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf,
+ &mconf->mt76, &mlink->wcid,
+ true);
+}
+
static int mt7925_assign_vif_chanctx(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf,
struct mt792x_dev *dev = mt792x_hw_dev(hw);
struct ieee80211_bss_conf *pri_link_conf;
struct mt792x_bss_conf *mconf;
+ u8 band_idx;
mutex_lock(&dev->mt76.mutex);
NULL, true);
} else {
mconf = &mvif->bss_conf;
+
+ if (is_mt7927(&dev->mt76)) {
+ band_idx = mt7927_band_idx(ctx->def.chan->band);
+
+ mt7927_reconfig_band(dev, vif, link_conf, mconf, band_idx);
+ }
}
mconf->mt76.ctx = ctx;