mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 21:36:52 +00:00
mt76: split mt76_rx_complete
Add a separate function for processing frames after A-MPDU reordering, reduce code duplication Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+18
-6
@@ -384,7 +384,7 @@ int mt76_get_survey(struct ieee80211_hw *hw, int idx,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_get_survey);
|
||||
|
||||
struct ieee80211_sta *mt76_rx_convert(struct sk_buff *skb)
|
||||
static struct ieee80211_sta *mt76_rx_convert(struct sk_buff *skb)
|
||||
{
|
||||
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
|
||||
struct mt76_rx_status mstat;
|
||||
@@ -410,9 +410,24 @@ struct ieee80211_sta *mt76_rx_convert(struct sk_buff *skb)
|
||||
return wcid_to_sta(mstat.wcid);
|
||||
}
|
||||
|
||||
void mt76_rx_complete(struct mt76_dev *dev, enum mt76_rxq_id q)
|
||||
void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
|
||||
int queue)
|
||||
{
|
||||
struct napi_struct *napi = NULL;
|
||||
struct ieee80211_sta *sta;
|
||||
struct sk_buff *skb;
|
||||
|
||||
if (queue >= 0)
|
||||
napi = &dev->napi[queue];
|
||||
|
||||
while ((skb = __skb_dequeue(frames)) != NULL) {
|
||||
sta = mt76_rx_convert(skb);
|
||||
ieee80211_rx_napi(dev->hw, sta, skb, napi);
|
||||
}
|
||||
}
|
||||
|
||||
void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q)
|
||||
{
|
||||
struct sk_buff_head frames;
|
||||
struct sk_buff *skb;
|
||||
|
||||
@@ -421,8 +436,5 @@ void mt76_rx_complete(struct mt76_dev *dev, enum mt76_rxq_id q)
|
||||
while ((skb = __skb_dequeue(&dev->rx_skb[q])) != NULL)
|
||||
mt76_rx_aggr_reorder(skb, &frames);
|
||||
|
||||
while ((skb = __skb_dequeue(&frames)) != NULL) {
|
||||
sta = mt76_rx_convert(skb);
|
||||
ieee80211_rx_napi(dev->hw, sta, skb, &dev->napi[q]);
|
||||
}
|
||||
mt76_rx_complete(dev, &frames, q);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user