mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76x2: add functions for setting extended MAC address registers
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+6
-1
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user