Commit 0044cc17 authored by Johannes Berg's avatar Johannes Berg

mac80211: unify queueing SKB to iface

We have a bunch of places that open-code the same to queue
an SKB to an interface, unify that.

Link: https://lore.kernel.org/r/20210517230754.113b65febd5a.Ie0e1d58a2885e75f242cb6e06f3b9660117fef93@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 0edab4ff
...@@ -214,6 +214,16 @@ ieee80211_rx_radiotap_hdrlen(struct ieee80211_local *local, ...@@ -214,6 +214,16 @@ ieee80211_rx_radiotap_hdrlen(struct ieee80211_local *local,
return len; return len;
} }
static void ieee80211_queue_skb_to_iface(struct ieee80211_sub_if_data *sdata,
struct sta_info *sta,
struct sk_buff *skb)
{
skb_queue_tail(&sdata->skb_queue, skb);
ieee80211_queue_work(&sdata->local->hw, &sdata->work);
if (sta)
sta->rx_stats.packets++;
}
static void ieee80211_handle_mu_mimo_mon(struct ieee80211_sub_if_data *sdata, static void ieee80211_handle_mu_mimo_mon(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb, struct sk_buff *skb,
int rtap_space) int rtap_space)
...@@ -254,8 +264,7 @@ static void ieee80211_handle_mu_mimo_mon(struct ieee80211_sub_if_data *sdata, ...@@ -254,8 +264,7 @@ static void ieee80211_handle_mu_mimo_mon(struct ieee80211_sub_if_data *sdata,
if (!skb) if (!skb)
return; return;
skb_queue_tail(&sdata->skb_queue, skb); ieee80211_queue_skb_to_iface(sdata, NULL, skb);
ieee80211_queue_work(&sdata->local->hw, &sdata->work);
} }
/* /*
...@@ -1339,7 +1348,6 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx, ...@@ -1339,7 +1348,6 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx,
struct sk_buff_head *frames) struct sk_buff_head *frames)
{ {
struct sk_buff *skb = rx->skb; struct sk_buff *skb = rx->skb;
struct ieee80211_local *local = rx->local;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
struct sta_info *sta = rx->sta; struct sta_info *sta = rx->sta;
struct tid_ampdu_rx *tid_agg_rx; struct tid_ampdu_rx *tid_agg_rx;
...@@ -1391,8 +1399,7 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx, ...@@ -1391,8 +1399,7 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx,
/* if this mpdu is fragmented - terminate rx aggregation session */ /* if this mpdu is fragmented - terminate rx aggregation session */
sc = le16_to_cpu(hdr->seq_ctrl); sc = le16_to_cpu(hdr->seq_ctrl);
if (sc & IEEE80211_SCTL_FRAG) { if (sc & IEEE80211_SCTL_FRAG) {
skb_queue_tail(&rx->sdata->skb_queue, skb); ieee80211_queue_skb_to_iface(rx->sdata, NULL, skb);
ieee80211_queue_work(&local->hw, &rx->sdata->work);
return; return;
} }
...@@ -3493,10 +3500,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) ...@@ -3493,10 +3500,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
return RX_QUEUED; return RX_QUEUED;
queue: queue:
skb_queue_tail(&sdata->skb_queue, rx->skb); ieee80211_queue_skb_to_iface(sdata, rx->sta, rx->skb);
ieee80211_queue_work(&local->hw, &sdata->work);
if (rx->sta)
rx->sta->rx_stats.packets++;
return RX_QUEUED; return RX_QUEUED;
} }
...@@ -3644,10 +3648,7 @@ ieee80211_rx_h_ext(struct ieee80211_rx_data *rx) ...@@ -3644,10 +3648,7 @@ ieee80211_rx_h_ext(struct ieee80211_rx_data *rx)
return RX_DROP_MONITOR; return RX_DROP_MONITOR;
/* for now only beacons are ext, so queue them */ /* for now only beacons are ext, so queue them */
skb_queue_tail(&sdata->skb_queue, rx->skb); ieee80211_queue_skb_to_iface(sdata, rx->sta, rx->skb);
ieee80211_queue_work(&rx->local->hw, &sdata->work);
if (rx->sta)
rx->sta->rx_stats.packets++;
return RX_QUEUED; return RX_QUEUED;
} }
...@@ -3704,11 +3705,7 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx) ...@@ -3704,11 +3705,7 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx)
return RX_DROP_MONITOR; return RX_DROP_MONITOR;
} }
/* queue up frame and kick off work to process it */ ieee80211_queue_skb_to_iface(sdata, rx->sta, rx->skb);
skb_queue_tail(&sdata->skb_queue, rx->skb);
ieee80211_queue_work(&rx->local->hw, &sdata->work);
if (rx->sta)
rx->sta->rx_stats.packets++;
return RX_QUEUED; return RX_QUEUED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment