Skip to content

Commit e48da5c

Browse files
committed
wifi: mt76: mt7996: fix monitor mode
Enable sniffer mode via MCU command in order to properly enable promiscuous mode on the device. Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
1 parent 69d54ce commit e48da5c

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

drivers/net/wireless/mediatek/mt76/mt7996/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ static void mt7996_set_monitor(struct mt7996_phy *phy, bool enabled)
368368
mt76_rmw_field(dev, MT_DMA_DCR0(phy->mt76->band_idx),
369369
MT_DMA_DCR0_RXD_G5_EN, enabled);
370370
mt7996_phy_set_rxfilter(phy);
371+
mt7996_mcu_set_sniffer_mode(phy, enabled);
371372
}
372373

373374
static int mt7996_add_interface(struct ieee80211_hw *hw,

drivers/net/wireless/mediatek/mt76/mt7996/mcu.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4496,6 +4496,27 @@ int mt7996_mcu_wed_rro_reset_sessions(struct mt7996_dev *dev, u16 id)
44964496
sizeof(req), true);
44974497
}
44984498

4499+
int mt7996_mcu_set_sniffer_mode(struct mt7996_phy *phy, bool enabled)
4500+
{
4501+
struct mt7996_dev *dev = phy->dev;
4502+
struct {
4503+
u8 band_idx;
4504+
u8 _rsv[3];
4505+
__le16 tag;
4506+
__le16 len;
4507+
u8 enable;
4508+
u8 _pad[3];
4509+
} __packed req = {
4510+
.band_idx = phy->mt76->band_idx,
4511+
.tag = 0,
4512+
.len = cpu_to_le16(sizeof(req) - 4),
4513+
.enable = enabled,
4514+
};
4515+
4516+
return mt76_mcu_send_msg(&dev->mt76, MCU_WM_UNI_CMD(SNIFFER), &req,
4517+
sizeof(req), true);
4518+
}
4519+
44994520
int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy)
45004521
{
45014522
#define TX_POWER_LIMIT_TABLE_RATE 0

drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ void mt7996_mcu_rx_event(struct mt7996_dev *dev, struct sk_buff *skb);
621621
void mt7996_mcu_exit(struct mt7996_dev *dev);
622622
int mt7996_mcu_get_all_sta_info(struct mt7996_phy *phy, u16 tag);
623623
int mt7996_mcu_wed_rro_reset_sessions(struct mt7996_dev *dev, u16 id);
624+
int mt7996_mcu_set_sniffer_mode(struct mt7996_phy *phy, bool enabled);
624625

625626
static inline u8 mt7996_max_interface_num(struct mt7996_dev *dev)
626627
{

0 commit comments

Comments
 (0)