diff options
author | Johannes Berg <johannes.berg@intel.com> | 2022-07-15 15:37:23 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2022-07-22 14:27:41 +0200 |
commit | 8a9be422f5ff34ec7abec289c6fe862d9e7864d2 (patch) | |
tree | 2c070a18fd4fcc8fbf9524107f4001a84707dcd2 /net/mac80211 | |
parent | f1cee996f1858ba07dce9e377559ea33f318af0f (diff) | |
download | linux-8a9be422f5ff34ec7abec289c6fe862d9e7864d2.tar.bz2 |
wifi: mac80211: tx: use AP address in some places for MLO
In a few places we need to use the AP (MLD) address, not the
deflink BSSID, the link address translation will happen later.
To make that work properly for fast-xmit, set up the ap_addr
in the vif.cfg earlier.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/mlme.c | 6 | ||||
-rw-r--r-- | net/mac80211/tx.c | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 912095e4e256..ee1a72519c15 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -2743,8 +2743,6 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata, changed[link_id] |= ieee80211_link_set_associated(link, cbss); } - memcpy(sdata->vif.cfg.ap_addr, assoc_data->ap_addr, ETH_ALEN); - /* just to be sure */ ieee80211_stop_poll(sdata); @@ -4893,6 +4891,9 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, sta->sta.wme = (elems->wmm_param || elems->s1g_capab) && local->hw.queues >= IEEE80211_NUM_ACS; + /* needed for fast-xmit setup in sta_info_move_state() */ + memcpy(sdata->vif.cfg.ap_addr, assoc_data->ap_addr, ETH_ALEN); + err = sta_info_move_state(sta, IEEE80211_STA_ASSOC); if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT)) err = sta_info_move_state(sta, IEEE80211_STA_AUTHORIZED); @@ -4927,6 +4928,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, return true; out_err: + eth_zero_addr(sdata->vif.cfg.ap_addr); mutex_unlock(&sdata->local->sta_mtx); return false; } diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 34dae26646a6..cded1b207b73 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2735,7 +2735,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, } else { fc |= cpu_to_le16(IEEE80211_FCTL_TODS); /* BSSID SA DA */ - memcpy(hdr.addr1, sdata->deflink.u.mgd.bssid, ETH_ALEN); + memcpy(hdr.addr1, sdata->vif.cfg.ap_addr, ETH_ALEN); memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); memcpy(hdr.addr3, skb->data, ETH_ALEN); hdrlen = 24; @@ -3023,7 +3023,7 @@ void ieee80211_check_fast_xmit(struct sta_info *sta) } fc |= cpu_to_le16(IEEE80211_FCTL_TODS); /* BSSID SA DA */ - memcpy(hdr->addr1, sdata->deflink.u.mgd.bssid, ETH_ALEN); + memcpy(hdr->addr1, sdata->vif.cfg.ap_addr, ETH_ALEN); build.da_offs = offsetof(struct ieee80211_hdr, addr3); build.sa_offs = offsetof(struct ieee80211_hdr, addr2); build.hdr_len = 24; @@ -3250,7 +3250,7 @@ static bool ieee80211_amsdu_prepare_head(struct ieee80211_sub_if_data *sdata, */ switch (sdata->vif.type) { case NL80211_IFTYPE_STATION: - bssid = sdata->deflink.u.mgd.bssid; + bssid = sdata->vif.cfg.ap_addr; break; case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP_VLAN: |