diff options
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x2_mac.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x2_mac.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c index 2e12fc0d5c9e..75f2843847d0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c @@ -265,6 +265,15 @@ static void mt76x2_remove_hdr_pad(struct sk_buff *skb) skb_pull(skb, 2); } +static struct mt76_wcid * +mt76x2_rx_get_wcid(struct mt76x2_dev *dev, u8 idx) +{ + if (idx >= ARRAY_SIZE(dev->wcid)) + return NULL; + + return rcu_dereference(dev->wcid[idx]); +} + int mt76x2_mac_process_rx(struct mt76x2_dev *dev, struct sk_buff *skb, void *rxi) { @@ -272,8 +281,12 @@ int mt76x2_mac_process_rx(struct mt76x2_dev *dev, struct sk_buff *skb, struct mt76x2_rxwi *rxwi = rxi; u32 ctl = le32_to_cpu(rxwi->ctl); u16 rate = le16_to_cpu(rxwi->rate); + u8 wcid; int len; + wcid = FIELD_GET(MT_RXWI_CTL_WCID, ctl); + status->wcid = mt76x2_rx_get_wcid(dev, wcid); + if (rxwi->rxinfo & cpu_to_le32(MT_RXINFO_L2PAD)) mt76x2_remove_hdr_pad(skb); |