mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt7603: set wtbl entry vif index
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -236,7 +236,7 @@ int mt7603_mcu_set_timing(struct mt7603_dev *dev, int slot, int sifs, int rifs,
|
||||
int eifs);
|
||||
void mt7603_mcu_exit(struct mt7603_dev *dev);
|
||||
|
||||
void mt7603_wtbl_init(struct mt7603_dev *dev, int idx, const u8 *addr);
|
||||
void mt7603_wtbl_init(struct mt7603_dev *dev, int idx, int vif, const u8 *addr);
|
||||
void mt7603_wtbl_clear(struct mt7603_dev *dev, int idx);
|
||||
void mt7603_wtbl_update_cap(struct mt7603_dev *dev, struct ieee80211_sta *sta);
|
||||
void mt7603_wtbl_set_rates(struct mt7603_dev *dev, struct mt7603_sta *sta,
|
||||
|
||||
+1
-1
@@ -229,7 +229,7 @@ mt7603_mac_init(struct mt7603_dev *dev)
|
||||
mt7603_wtbl_clear(dev, i);
|
||||
|
||||
eth_broadcast_addr(bc_addr);
|
||||
mt7603_wtbl_init(dev, MT7603_WTBL_RESERVED, bc_addr);
|
||||
mt7603_wtbl_init(dev, MT7603_WTBL_RESERVED, -1, bc_addr);
|
||||
dev->global_sta.wcid.idx = MT7603_WTBL_RESERVED;
|
||||
rcu_assign_pointer(dev->wcid[MT7603_WTBL_RESERVED],
|
||||
&dev->global_sta.wcid);
|
||||
|
||||
+11
-3
@@ -101,16 +101,24 @@ mt7603_wtbl4_addr(int idx)
|
||||
return base + idx * MT_WTBL4_SIZE;
|
||||
}
|
||||
|
||||
void mt7603_wtbl_init(struct mt7603_dev *dev, int idx, const u8 *mac_addr)
|
||||
void mt7603_wtbl_init(struct mt7603_dev *dev, int idx, int vif,
|
||||
const u8 *mac_addr)
|
||||
{
|
||||
const void *_mac = mac_addr;
|
||||
u32 addr = mt7603_wtbl1_addr(idx);
|
||||
u32 w0;
|
||||
int i;
|
||||
|
||||
w0 = FIELD_PREP(MT_WTBL1_W0_ADDR_HI, get_unaligned_le16(_mac + 4));
|
||||
if (vif < 0)
|
||||
vif = 0;
|
||||
else
|
||||
w0 |= MT_WTBL1_W0_RX_CHECK_A1;
|
||||
w0 |= FIELD_PREP(MT_WTBL1_W0_MUAR_IDX, vif);
|
||||
|
||||
mt76_poll(dev, MT_WTBL_UPDATE, MT_WTBL_UPDATE_BUSY, 0, 5000);
|
||||
|
||||
mt76_set(dev, addr + 0 * 4,
|
||||
FIELD_PREP(MT_WTBL1_W0_ADDR_HI, get_unaligned_le16(_mac + 4)));
|
||||
mt76_set(dev, addr + 0 * 4, w0);
|
||||
mt76_set(dev, addr + 1 * 4,
|
||||
FIELD_PREP(MT_WTBL1_W1_ADDR_LO, get_unaligned_le32(_mac)));
|
||||
mt76_set(dev, addr + 2 * 4, MT_WTBL1_W2_ADMISSION_CONTROL);
|
||||
|
||||
+3
-2
@@ -94,7 +94,7 @@ mt7603_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
||||
mvif->sta.wcid.hw_key_idx = -1;
|
||||
|
||||
eth_broadcast_addr(bc_addr);
|
||||
mt7603_wtbl_init(dev, idx, bc_addr);
|
||||
mt7603_wtbl_init(dev, idx, mvif->idx, bc_addr);
|
||||
|
||||
rcu_assign_pointer(dev->wcid[idx], &mvif->sta.wcid);
|
||||
mt7603_txq_init(dev, vif->txq);
|
||||
@@ -257,6 +257,7 @@ mt7603_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
{
|
||||
struct mt7603_dev *dev = hw->priv;
|
||||
struct mt7603_sta *msta = (struct mt7603_sta *) sta->drv_priv;
|
||||
struct mt7603_vif *mvif = (struct mt7603_vif *) vif->drv_priv;
|
||||
int i, idx;
|
||||
int ret = 0;
|
||||
|
||||
@@ -272,7 +273,7 @@ mt7603_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
mt7603_txq_init(dev, sta->txq[i]);
|
||||
|
||||
msta->wcid.idx = idx;
|
||||
mt7603_wtbl_init(dev, idx, sta->addr);
|
||||
mt7603_wtbl_init(dev, idx, mvif->idx, sta->addr);
|
||||
mt7603_wtbl_update_cap(dev, sta);
|
||||
|
||||
rcu_assign_pointer(dev->wcid[idx], &msta->wcid);
|
||||
|
||||
Reference in New Issue
Block a user