mt76: mt7615: fix adding active monitor interfaces
Subsystems (2)
Felix Fietkau
maintainerPATCH 1/2 mt76: mt7615: fix adding active monitor interfaces
Treat them the same as AP iftype internally for MCU commands
Signed-off-by Felix Fietkau <[email protected]>
--- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/mediatek/mt76/mt7615/main.c +1 -0
@@ -97,6 +97,7 @@ static int get_omac_idx(enum nl80211_iftype type, u32 mask)int i;switch (type) { +case NL80211_IFTYPE_MONITOR :case NL80211_IFTYPE_AP :case NL80211_IFTYPE_MESH_POINT :case NL80211_IFTYPE_ADHOC :
Signature · 1 line
2.24.0
Felix Fietkau
maintainerPATCH 2/2 mt76: mt7615: fix monitor mode on second PHY
The second PHY receives no packets unless there is an active vif present. Set the WANT_MONITOR_VIF flag to deal with that
Signed-off-by Felix Fietkau <[email protected]>
--- drivers/net/wireless/mediatek/mt76/mt7615/init.c | 3 +++ drivers/net/wireless/mediatek/mt76/mt7615/main.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7615/init.c +3 -0
@@ -415,6 +415,9 @@ int mt7615_register_ext_phy(struct mt7615_dev *dev) mphy->sband_2g.sband.n_channels =0 ; mphy->hw->wiphy->bands[NL80211_BAND_2GHZ ] =NULL ; +/* The second interface does not get any packets unless it has a vif */ +ieee80211_hw_set (mphy->hw,WANT_MONITOR_VIF ); + ret =mt76_register_phy (mphy);if (ret)ieee80211_free_hw (mphy->hw);
drivers/net/wireless/mediatek/mt76/mt7615/main.c +7 -4
@@ -177,9 +177,11 @@ static int mt7615_add_interface(struct ieee80211_hw *hw, MT_WTBL_UPDATE_ADM_COUNT_CLEAR);rcu_assign_pointer (dev->mt76.wcid[idx], &mvif->sta.wcid); - mtxq = (struct mt76_txq *)vif->txq->drv_priv; - mtxq->wcid = &mvif->sta.wcid; -mt76_txq_init (&dev->mt76, vif->txq); +if (vif->txq) { + mtxq = (struct mt76_txq *)vif->txq->drv_priv; + mtxq->wcid = &mvif->sta.wcid; +mt76_txq_init (&dev->mt76, vif->txq); + } out:mutex_unlock (&dev->mt76.mutex);
@@ -201,7 +203,8 @@ static void mt7615_remove_interface(struct ieee80211_hw *hw,mt7615_mcu_set_dev_info (dev, vif,0 );rcu_assign_pointer (dev->mt76.wcid[idx],NULL ); -mt76_txq_remove (&dev->mt76, vif->txq); +if (vif->txq) +mt76_txq_remove (&dev->mt76, vif->txq);mutex_lock (&dev->mt76.mutex); dev->vif_mask &= ~BIT (mvif->idx);
Signature · 1 line
2.24.0