Skip to content

Commit

Permalink
mt76: mt7915: make vif index per adapter instead of per band
Browse files Browse the repository at this point in the history
The firmware treats it as global, so we need to avoid collisions here

Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
Felix Fietkau committed Jan 27, 2021
1 parent 9093cff commit 51742a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/wireless/mediatek/mt76/mt7915/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
is_zero_ether_addr(vif->addr))
phy->monitor_vif = vif;

mvif->idx = ffs(~phy->mt76->vif_mask) - 1;
mvif->idx = ffs(~dev->mphy.vif_mask) - 1;
if (mvif->idx >= MT7915_MAX_INTERFACES) {
ret = -ENOSPC;
goto out;
Expand All @@ -186,7 +186,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
if (ret)
goto out;

phy->mt76->vif_mask |= BIT(mvif->idx);
dev->mphy.vif_mask |= BIT(mvif->idx);
phy->omac_mask |= BIT_ULL(mvif->omac_idx);

idx = MT7915_WTBL_RESERVED - mvif->idx;
Expand Down Expand Up @@ -241,7 +241,7 @@ static void mt7915_remove_interface(struct ieee80211_hw *hw,
rcu_assign_pointer(dev->mt76.wcid[idx], NULL);

mutex_lock(&dev->mt76.mutex);
phy->mt76->vif_mask &= ~BIT(mvif->idx);
dev->mphy.vif_mask &= ~BIT(mvif->idx);
phy->omac_mask &= ~BIT_ULL(mvif->omac_idx);
mutex_unlock(&dev->mt76.mutex);

Expand Down

0 comments on commit 51742a9

Please sign in to comment.