--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
-@@ -4067,6 +4067,55 @@ static void ieee80211_invoke_rx_handlers
+@@ -4067,6 +4067,56 @@ static void ieee80211_invoke_rx_handlers
#undef CALL_RXH
}
+
+ if (sta) {
+ rx->local = sta->sdata->local;
-+ rx->sdata = sta->sdata;
++ if (!rx->sdata)
++ rx->sdata = sta->sdata;
+ rx->link_sta = &sta->deflink;
+
+ if (link_id >= 0 &&
/*
* This function makes calls into the RX path, therefore
* it has to be invoked under RCU read lock.
-@@ -4075,16 +4124,19 @@ void ieee80211_release_reorder_timeout(s
+@@ -4075,16 +4125,19 @@ void ieee80211_release_reorder_timeout(s
{
struct sk_buff_head frames;
struct ieee80211_rx_data rx = {
tid_agg_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]);
if (!tid_agg_rx)
-@@ -4104,10 +4156,6 @@ void ieee80211_release_reorder_timeout(s
+@@ -4104,10 +4157,6 @@ void ieee80211_release_reorder_timeout(s
};
drv_event_callback(rx.local, rx.sdata, &event);
}
ieee80211_rx_handlers(&rx, &frames);
}
-@@ -4123,7 +4171,6 @@ void ieee80211_mark_rx_ba_filtered_frame
+@@ -4123,7 +4172,6 @@ void ieee80211_mark_rx_ba_filtered_frame
/* This is OK -- must be QoS data frame */
.security_idx = tid,
.seqno_idx = tid,
};
int i, diff;
-@@ -4134,10 +4181,8 @@ void ieee80211_mark_rx_ba_filtered_frame
+@@ -4134,10 +4182,8 @@ void ieee80211_mark_rx_ba_filtered_frame
sta = container_of(pubsta, struct sta_info, sta);
rcu_read_lock();
tid_agg_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]);
-@@ -4524,15 +4569,6 @@ void ieee80211_check_fast_rx_iface(struc
+@@ -4524,15 +4570,6 @@ void ieee80211_check_fast_rx_iface(struc
mutex_unlock(&local->sta_mtx);
}
static void ieee80211_rx_8023(struct ieee80211_rx_data *rx,
struct ieee80211_fast_rx *fast_rx,
int orig_len)
-@@ -4643,7 +4679,6 @@ static bool ieee80211_invoke_fast_rx(str
+@@ -4643,7 +4680,6 @@ static bool ieee80211_invoke_fast_rx(str
struct sk_buff *skb = rx->skb;
struct ieee80211_hdr *hdr = (void *)skb->data;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
int orig_len = skb->len;
int hdrlen = ieee80211_hdrlen(hdr->frame_control);
int snap_offs = hdrlen;
-@@ -4655,7 +4690,6 @@ static bool ieee80211_invoke_fast_rx(str
+@@ -4655,7 +4691,6 @@ static bool ieee80211_invoke_fast_rx(str
u8 da[ETH_ALEN];
u8 sa[ETH_ALEN];
} addrs __aligned(2);
struct ieee80211_sta_rx_stats *stats;
/* for parallel-rx, we need to have DUP_VALIDATED, otherwise we write
-@@ -4758,18 +4792,10 @@ static bool ieee80211_invoke_fast_rx(str
+@@ -4758,18 +4793,10 @@ static bool ieee80211_invoke_fast_rx(str
drop:
dev_kfree_skb(skb);
stats->dropped++;
return true;
-@@ -4787,8 +4813,8 @@ static bool ieee80211_prepare_and_rx_han
+@@ -4787,8 +4814,8 @@ static bool ieee80211_prepare_and_rx_han
struct ieee80211_local *local = rx->local;
struct ieee80211_sub_if_data *sdata = rx->sdata;
struct ieee80211_hdr *hdr = (void *)skb->data;
rx->skb = skb;
-@@ -4810,35 +4836,6 @@ static bool ieee80211_prepare_and_rx_han
+@@ -4810,35 +4837,6 @@ static bool ieee80211_prepare_and_rx_han
if (!ieee80211_accept_frame(rx))
return false;
if (!consume) {
struct skb_shared_hwtstamps *shwt;
-@@ -4858,7 +4855,7 @@ static bool ieee80211_prepare_and_rx_han
+@@ -4858,7 +4856,7 @@ static bool ieee80211_prepare_and_rx_han
shwt->hwtstamp = skb_hwtstamps(skb)->hwtstamp;
}
/* translate to MLD addresses */
if (ether_addr_equal(link->conf->addr, hdr->addr1))
ether_addr_copy(hdr->addr1, rx->sdata->vif.addr);
-@@ -4888,6 +4885,7 @@ static void __ieee80211_rx_handle_8023(s
+@@ -4888,6 +4886,7 @@ static void __ieee80211_rx_handle_8023(s
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
struct ieee80211_fast_rx *fast_rx;
struct ieee80211_rx_data rx;
memset(&rx, 0, sizeof(rx));
rx.skb = skb;
-@@ -4904,12 +4902,8 @@ static void __ieee80211_rx_handle_8023(s
+@@ -4904,12 +4903,8 @@ static void __ieee80211_rx_handle_8023(s
if (!pubsta)
goto drop;
/*
* TODO: Should the frame be dropped if the right link_id is not
-@@ -4918,19 +4912,8 @@ static void __ieee80211_rx_handle_8023(s
+@@ -4918,19 +4913,8 @@ static void __ieee80211_rx_handle_8023(s
* link_id is used only for stats purpose and updating the stats on
* the deflink is fine?
*/
fast_rx = rcu_dereference(rx.sta->fast_rx);
if (!fast_rx)
-@@ -4948,6 +4931,8 @@ static bool ieee80211_rx_for_interface(s
+@@ -4948,6 +4932,8 @@ static bool ieee80211_rx_for_interface(s
{
struct link_sta_info *link_sta;
struct ieee80211_hdr *hdr = (void *)skb->data;
/*
* Look up link station first, in case there's a
-@@ -4957,24 +4942,19 @@ static bool ieee80211_rx_for_interface(s
+@@ -4957,24 +4943,19 @@ static bool ieee80211_rx_for_interface(s
*/
link_sta = link_sta_info_get_bss(rx->sdata, hdr->addr2);
if (link_sta) {
return ieee80211_prepare_and_rx_handle(rx, skb, consume);
}
-@@ -5033,19 +5013,15 @@ static void __ieee80211_rx_handle_packet
+@@ -5033,19 +5014,15 @@ static void __ieee80211_rx_handle_packet
if (ieee80211_is_data(fc)) {
struct sta_info *sta, *prev_sta;
/*
* In MLO connection, fetch the link_id using addr2
* when the driver does not pass link_id in status.
-@@ -5063,7 +5039,7 @@ static void __ieee80211_rx_handle_packet
+@@ -5063,7 +5040,7 @@ static void __ieee80211_rx_handle_packet
if (!link_sta)
goto out;
}
if (ieee80211_prepare_and_rx_handle(&rx, skb, true))
-@@ -5079,30 +5055,25 @@ static void __ieee80211_rx_handle_packet
+@@ -5079,30 +5056,25 @@ static void __ieee80211_rx_handle_packet
continue;
}