mt76: mt7915: use proper aid value in mt7915_mcu_sta_basic_tlv
authorLorenzo Bianconi <lorenzo@kernel.org>
Wed, 22 Dec 2021 16:06:36 +0000 (17:06 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 3 Feb 2022 12:57:57 +0000 (13:57 +0100)
Similar to mt7915_mcu_wtbl_generic_tlv, rely on vif->bss_conf.aid for
aid in sta mode and not on sta->aid.

Fixes: e57b7901469fc ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c

index a1d50bbdece23ef49ca4535b087dd781f8338a31..ec7ca7e90c4845738ebbb38133024341bab3dc35 100644 (file)
@@ -1045,12 +1045,15 @@ mt7915_mcu_sta_basic_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
        case NL80211_IFTYPE_MESH_POINT:
        case NL80211_IFTYPE_AP:
                basic->conn_type = cpu_to_le32(CONNECTION_INFRA_STA);
+               basic->aid = cpu_to_le16(sta->aid);
                break;
        case NL80211_IFTYPE_STATION:
                basic->conn_type = cpu_to_le32(CONNECTION_INFRA_AP);
+               basic->aid = cpu_to_le16(vif->bss_conf.aid);
                break;
        case NL80211_IFTYPE_ADHOC:
                basic->conn_type = cpu_to_le32(CONNECTION_IBSS_ADHOC);
+               basic->aid = cpu_to_le16(sta->aid);
                break;
        default:
                WARN_ON(1);
@@ -1058,7 +1061,6 @@ mt7915_mcu_sta_basic_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
        }
 
        memcpy(basic->peer_addr, sta->addr, ETH_ALEN);
-       basic->aid = cpu_to_le16(sta->aid);
        basic->qos = sta->wme;
 }