diff --git a/mt76x2_init.c b/mt76x2_init.c index f48c9733..6f942e50 100644 --- a/mt76x2_init.c +++ b/mt76x2_init.c @@ -279,6 +279,8 @@ int mt76x2_mac_reset(struct mt76x2_dev *dev, bool hard) FIELD_PREP(MT_MAC_BSSID_DW1_MBSS_MODE, 3) | /* 8 beacons */ MT_MAC_BSSID_DW1_MBSS_LOCAL_BIT); + mt76_set(dev, MT_MAC_ADDR_EXT_CTL, MT_MAC_ADDR_EXT_CTL_EN); + /* Fire a pre-TBTT interrupt 8 ms before TBTT */ mt76_rmw_field(dev, MT_INT_TIMER_CFG, MT_INT_TIMER_CFG_PRE_TBTT, 8 << 4); @@ -296,10 +298,13 @@ int mt76x2_mac_reset(struct mt76x2_dev *dev, bool hard) for (i = 0; i < 256; i++) mt76x2_mac_wcid_setup(dev, i, 0, NULL); - for (i = 0; i < 16; i++) + for (i = 0; i < 16; i++) { for (k = 0; k < 4; k++) mt76x2_mac_shared_key_setup(dev, i, k, NULL); + mt76x2_mac_set_ext_mac(dev, i, NULL); + } + for (i = 0; i < 8; i++) { mt76x2_mac_set_bssid(dev, i, null_addr); mt76x2_mac_set_beacon(dev, i, NULL); diff --git a/mt76x2_mac.c b/mt76x2_mac.c index a7416a01..b8af60d9 100644 --- a/mt76x2_mac.c +++ b/mt76x2_mac.c @@ -28,6 +28,19 @@ void mt76x2_mac_set_bssid(struct mt76x2_dev *dev, u8 idx, const u8 *addr) get_unaligned_le16(addr + 4)); } +void mt76x2_mac_set_ext_mac(struct mt76x2_dev *dev, u8 idx, const u8 *addr) +{ + u32 lo = 0, hi = 0; + + if (addr) { + lo = get_unaligned_le32(addr); + hi = get_unaligned_le16(addr + 4); + } + + mt76_wr(dev, MT_MAC_ADDR_EXT_L(idx), lo); + mt76_wr(dev, MT_MAC_ADDR_EXT_H(idx), hi); +} + static int mt76x2_mac_process_rate(struct ieee80211_rx_status *status, u16 rate) { diff --git a/mt76x2_mac.h b/mt76x2_mac.h index 8a8a25e3..a993c383 100644 --- a/mt76x2_mac.h +++ b/mt76x2_mac.h @@ -162,6 +162,7 @@ int mt76x2_mac_start(struct mt76x2_dev *dev); void mt76x2_mac_stop(struct mt76x2_dev *dev, bool force); void mt76x2_mac_resume(struct mt76x2_dev *dev); void mt76x2_mac_set_bssid(struct mt76x2_dev *dev, u8 idx, const u8 *addr); +void mt76x2_mac_set_ext_mac(struct mt76x2_dev *dev, u8 idx, const u8 *addr); int mt76x2_mac_process_rx(struct mt76x2_dev *dev, struct sk_buff *skb, void *rxi); diff --git a/mt76x2_regs.h b/mt76x2_regs.h index ce3ab85c..95c1e955 100644 --- a/mt76x2_regs.h +++ b/mt76x2_regs.h @@ -438,6 +438,14 @@ #define MT_TX_SW_CFG3 0x1478 +#define MT_MAC_ADDR_EXT_CTL 0x147c +#define MT_MAC_ADDR_EXT_CTL_EN BIT(0) + +#define MT_MAC_ADDR_EXT_BASE 0x1480 +#define MT_MAC_ADDR_EXT_L(_n) (MT_MAC_ADDR_EXT_BASE + ((_n) * 8)) +#define MT_MAC_ADDR_EXT_H(_n) (MT_MAC_ADDR_EXT_BASE + ((_n) * 8 + 4)) +#define MT_MAC_ADDR_EXT_H_MASK GENMASK(15, 0) + #define MT_PN_PAD_MODE 0x150c #define MT_TXOP_HLDR_ET 0x1608