mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7925: add link handling in mt7925_set_key
add link handling in mt7925_set_key to support MLO-enabled firmware. Co-developed-by: Ming Yen Hsieh <[email protected]> Signed-off-by: Ming Yen Hsieh <[email protected]> Co-developed-by: Deren Wu <[email protected]> Signed-off-by: Deren Wu <[email protected]> Signed-off-by: Sean Wang <[email protected]> Link: https://patch.msgid.link/164608d96ce10a40e673bc6f252189c94bc48da7.1720248331.git.sean.wang@kernel.org Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+17
-1
@@ -610,6 +610,9 @@ static int mt7925_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
||||
struct ieee80211_key_conf *key)
|
||||
{
|
||||
struct mt792x_dev *dev = mt792x_hw_dev(hw);
|
||||
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
|
||||
struct mt792x_sta *msta = sta ? (struct mt792x_sta *)sta->drv_priv :
|
||||
&mvif->sta;
|
||||
int err;
|
||||
|
||||
/* The hardware does not support per-STA RX GTK, fallback
|
||||
@@ -624,7 +627,20 @@ static int mt7925_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
||||
|
||||
mt792x_mutex_acquire(dev);
|
||||
|
||||
err = mt7925_set_link_key(hw, cmd, vif, sta, key, vif->bss_conf.link_id);
|
||||
if (ieee80211_vif_is_mld(vif)) {
|
||||
unsigned int link_id;
|
||||
unsigned long add;
|
||||
|
||||
add = key->link_id != -1 ? BIT(key->link_id) : msta->valid_links;
|
||||
|
||||
for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) {
|
||||
err = mt7925_set_link_key(hw, cmd, vif, sta, key, link_id);
|
||||
if (err < 0)
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
err = mt7925_set_link_key(hw, cmd, vif, sta, key, vif->bss_conf.link_id);
|
||||
}
|
||||
|
||||
mt792x_mutex_release(dev);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user