summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2021-10-19 01:11:38 +0200
committerFelix Fietkau <nbd@nbd.name>2021-10-20 10:36:57 +0200
commitf0ff5d3aa648128d0fc8055df072551d0d89c88d (patch)
tree0a632889d64e4d1ff24666bc0f26a5581fed2054 /drivers
parentmt76: mt7663s: rely on mcu reg access utility (diff)
downloadlinux-f0ff5d3aa648128d0fc8055df072551d0d89c88d.tar.xz
linux-f0ff5d3aa648128d0fc8055df072551d0d89c88d.zip
mt76: mt7921: make all event parser reusable between mt7921s and mt7921e
The longer event such as the event for mcu_get_nic_capability would hold the data in paged fragment skb for the SDIO device so we turn the skb to be linearized skb before accessing it to reuse the same event parser betweem mt7921s and mt7921e. Tested-by: Deren Wu <deren.wu@mediatek.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7921/mcu.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index 10b992103ade..e315eb4186d3 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -455,7 +455,12 @@ mt7921_mcu_rx_unsolicited_event(struct mt7921_dev *dev, struct sk_buff *skb)
void mt7921_mcu_rx_event(struct mt7921_dev *dev, struct sk_buff *skb)
{
- struct mt7921_mcu_rxd *rxd = (struct mt7921_mcu_rxd *)skb->data;
+ struct mt7921_mcu_rxd *rxd;
+
+ if (skb_linearize(skb))
+ return;
+
+ rxd = (struct mt7921_mcu_rxd *)skb->data;
if (rxd->eid == 0x6) {
mt76_mcu_rx_event(&dev->mt76, skb);