diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2022-07-20 19:56:37 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-09-15 13:53:57 +0300 |
commit | 12d7440e3bf94c87c7cf518c11577a532a9be350 (patch) | |
tree | 8f542fcfc9b4fb65f2bdb95af148d9476de30525 /drivers/net/wireless/mediatek/mt76/usb.c | |
parent | 60c45a78c35dec6eedd48a6bd43c4e4271501b33 (diff) |
wifi: mt76: add rx_check callback for usb devices
Introduce rx_check callback support for mt7663u and mt7921u drivers.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/usb.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/usb.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c index 6b8964c19f50..4c4033bb1bb3 100644 --- a/drivers/net/wireless/mediatek/mt76/usb.c +++ b/drivers/net/wireless/mediatek/mt76/usb.c @@ -528,6 +528,11 @@ mt76u_process_rx_entry(struct mt76_dev *dev, struct urb *urb, head_room = drv_flags & MT_DRV_RX_DMA_HDR ? 0 : MT_DMA_HDR_LEN; data_len = min_t(int, len, data_len - head_room); + + if (len == data_len && + dev->drv->rx_check && !dev->drv->rx_check(dev, data, data_len)) + return 0; + skb = mt76u_build_rx_skb(dev, data, data_len, buf_size); if (!skb) return 0; |