rx_data is currently defined inside __ieee80211_rx_handle_packet() and is passed to the rx handlers called inside. Define it early in ieee80211_rx_list() so that new transient data that live just between the driver and mac80211 interface layer can be passed to the rx handlers as well. Signed-off-by: Pooventhiran G --- net/mac80211/rx.c | 60 +++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index a152471151a9..d7d662c9ccd5 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -5432,7 +5432,8 @@ ieee80211_link_from_freq(struct ieee80211_sub_if_data *sdata, int freq) static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, struct ieee80211_link_sta *link_pubsta, struct sk_buff *skb, - struct list_head *list) + struct list_head *list, + struct ieee80211_rx_data *rx) __must_hold_shared(RCU) { struct ieee80211_local *local = hw_to_local(hw); @@ -5442,16 +5443,14 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, struct link_sta_info *link_sta; struct sta_info *sta; __le16 fc; - struct ieee80211_rx_data rx; struct rhlist_head *tmp; bool rx_data_pending; int err = 0; fc = ((struct ieee80211_hdr *)skb->data)->frame_control; - memset(&rx, 0, sizeof(rx)); - rx.skb = skb; - rx.local = local; - rx.list = list; + rx->skb = skb; + rx->local = local; + rx->list = list; if (ieee80211_is_data(fc) || ieee80211_is_mgmt(fc)) I802_DEBUG_INC(local->dot11ReceivedFragmentCount); @@ -5483,8 +5482,8 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, } hdr = (struct ieee80211_hdr *)skb->data; - ieee80211_parse_qos(&rx); - ieee80211_verify_alignment(&rx); + ieee80211_parse_qos(rx); + ieee80211_verify_alignment(rx); if (unlikely(ieee80211_is_probe_resp(hdr->frame_control) || ieee80211_is_beacon(hdr->frame_control) || @@ -5504,9 +5503,9 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, sta = sta_from_pub(link_pubsta->sta); link_sta = rcu_dereference(sta->link[link_pubsta->link_id]); - rx.sdata = sta->sdata; - if (ieee80211_rx_data_set_link_sta(&rx, link_sta) && - ieee80211_prepare_and_rx_handle(&rx, skb, true)) + rx->sdata = sta->sdata; + if (ieee80211_rx_data_set_link_sta(rx, link_sta) && + ieee80211_prepare_and_rx_handle(rx, skb, true)) return; goto out; @@ -5526,13 +5525,13 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, continue; if (rx_data_pending) { - ieee80211_prepare_and_rx_handle(&rx, skb, + ieee80211_prepare_and_rx_handle(rx, skb, false); rx_data_pending = false; } - rx.sdata = sta->sdata; - if (!ieee80211_rx_data_set_link_sta(&rx, &sta->deflink)) + rx->sdata = sta->sdata; + if (!ieee80211_rx_data_set_link_sta(rx, &sta->deflink)) continue; rx_data_pending = true; @@ -5550,20 +5549,20 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, continue; if (rx_data_pending) { - ieee80211_prepare_and_rx_handle(&rx, skb, + ieee80211_prepare_and_rx_handle(rx, skb, false); rx_data_pending = false; } - rx.sdata = sta->sdata; - if (!ieee80211_rx_data_set_link_sta(&rx, link_sta)) + rx->sdata = sta->sdata; + if (!ieee80211_rx_data_set_link_sta(rx, link_sta)) continue; rx_data_pending = true; } if (rx_data_pending) { - if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) + if (ieee80211_prepare_and_rx_handle(rx, skb, true)) return; goto out; @@ -5635,14 +5634,14 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, if (link_sta && link && ieee80211_rx_valid_freq(status, link)) { if (rx_data_pending) { - ieee80211_prepare_and_rx_handle(&rx, skb, false); + ieee80211_prepare_and_rx_handle(rx, skb, false); rx_data_pending = false; } /* No valid_links check as we need to RX beacons */ - rx.sdata = sdata; - if (ieee80211_rx_data_set_link_sta(&rx, link_sta)) + rx->sdata = sdata; + if (ieee80211_rx_data_set_link_sta(rx, link_sta)) rx_data_pending = true; continue; @@ -5652,22 +5651,22 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, link = ieee80211_link_from_freq(sdata, status->freq); if (rx_data_pending) { - ieee80211_prepare_and_rx_handle(&rx, skb, false); + ieee80211_prepare_and_rx_handle(rx, skb, false); rx_data_pending = false; } - rx.sdata = sdata; - rx.local = sdata->local; - rx.link = link; - rx.link_id = link != &sdata->deflink ? link->link_id : -1; - rx.sta = NULL; - rx.link_sta = NULL; + rx->sdata = sdata; + rx->local = sdata->local; + rx->link = link; + rx->link_id = link != &sdata->deflink ? link->link_id : -1; + rx->sta = NULL; + rx->link_sta = NULL; rx_data_pending = true; } if (rx_data_pending && - ieee80211_prepare_and_rx_handle(&rx, skb, true)) + ieee80211_prepare_and_rx_handle(rx, skb, true)) return; out: @@ -5688,6 +5687,7 @@ void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_supported_band *sband; struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + struct ieee80211_rx_data rx = {}; WARN_ON_ONCE(softirq_count() == 0); @@ -5839,7 +5839,7 @@ void ieee80211_rx_list(struct ieee80211_hw *hw, __ieee80211_rx_handle_8023(hw, link_pubsta, skb, list); else __ieee80211_rx_handle_packet(hw, link_pubsta, skb, - list); + list, &rx); } kcov_remote_stop(); -- 2.34.1