@@ -728,12 +728,13 @@ static int mt7925_mac_link_sta_add(struct mt76_dev *mdev,
struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
struct ieee80211_bss_conf *link_conf;
+ u8 link_id = link_sta->link_id;
struct mt792x_link_sta *mlink;
struct mt792x_sta *msta;
int ret, idx;
msta = (struct mt792x_sta *)link_sta->sta->drv_priv;
- mlink = mt792x_sta_to_link(msta, link_sta->link_id);
+ mlink = mt792x_sta_to_link(msta, link_id);
idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT792x_WTBL_STA - 1);
if (idx < 0)
@@ -753,12 +754,16 @@ static int mt7925_mac_link_sta_add(struct mt76_dev *mdev,
mt7925_mac_wtbl_update(dev, idx,
MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
- link_conf = mt792x_vif_to_bss_conf(vif, vif->bss_conf.link_id);
+ link_conf = mt792x_vif_to_bss_conf(vif, link_id);
/* should update bss info before STA add */
- if (vif->type == NL80211_IFTYPE_STATION && !link_sta->sta->tdls)
- mt7925_mcu_add_bss_info(&dev->phy, mvif->bss_conf.mt76.ctx,
+ if (vif->type == NL80211_IFTYPE_STATION && !link_sta->sta->tdls) {
+ struct mt792x_bss_conf *mconf;
+
+ mconf = mt792x_vif_to_link(mvif, link_id);
+ mt7925_mcu_add_bss_info(&dev->phy, mconf->mt76.ctx,
link_conf, link_sta, false);
+ }
ret = mt7925_mcu_sta_update(dev, link_sta, vif, true,
MT76_STA_INFO_STATE_NONE);
@@ -830,11 +835,12 @@ static void mt7925_mac_link_sta_remove(struct mt76_dev *mdev,
{
struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
struct ieee80211_bss_conf *link_conf;
+ u8 link_id = link_sta->link_id;
struct mt792x_link_sta *mlink;
struct mt792x_sta *msta;
msta = (struct mt792x_sta *)link_sta->sta->drv_priv;
- mlink = mt792x_sta_to_link(msta, link_sta->link_id);
+ mlink = mt792x_sta_to_link(msta, link_id);
mt76_connac_free_pending_tx_skbs(&dev->pm, &mlink->wcid);
mt76_connac_pm_wake(&dev->mphy, &dev->pm);
@@ -844,12 +850,14 @@ static void mt7925_mac_link_sta_remove(struct mt76_dev *mdev,
mt7925_mac_wtbl_update(dev, mlink->wcid.idx,
MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
- link_conf = mt792x_vif_to_bss_conf(vif, vif->bss_conf.link_id);
+ link_conf = mt792x_vif_to_bss_conf(vif, link_id);
if (vif->type == NL80211_IFTYPE_STATION && !link_sta->sta->tdls) {
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
- mt7925_mcu_add_bss_info(&dev->phy,
- mvif->bss_conf.mt76.ctx, link_conf,
+ struct mt792x_bss_conf *mconf;
+
+ mconf = mt792x_vif_to_link(mvif, link_id);
+ mt7925_mcu_add_bss_info(&dev->phy, mconf->mt76.ctx, link_conf,
link_sta, false);
}