Commit 8da40d69 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: mt7663u: fix dma header initialization

Fix length field corruption in usb dma header introduced adding sdio
support

Fixes: 75b10f0c ("mt76: mt76u: add mt76_skb_adjust_pad utility routine")
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent ce8463a7
...@@ -19,6 +19,7 @@ mt7663u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, ...@@ -19,6 +19,7 @@ mt7663u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
{ {
struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76); struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76);
int ret, seq, ep; int ret, seq, ep;
u32 len;
mutex_lock(&mdev->mcu.mutex); mutex_lock(&mdev->mcu.mutex);
...@@ -28,7 +29,8 @@ mt7663u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, ...@@ -28,7 +29,8 @@ mt7663u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
else else
ep = MT_EP_OUT_AC_BE; ep = MT_EP_OUT_AC_BE;
put_unaligned_le32(skb->len, skb_push(skb, sizeof(skb->len))); len = skb->len;
put_unaligned_le32(len, skb_push(skb, sizeof(len)));
ret = mt76_skb_adjust_pad(skb); ret = mt76_skb_adjust_pad(skb);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
...@@ -259,8 +259,11 @@ int mt7663_usb_sdio_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, ...@@ -259,8 +259,11 @@ int mt7663_usb_sdio_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
} }
mt7663_usb_sdio_write_txwi(dev, wcid, qid, sta, skb); mt7663_usb_sdio_write_txwi(dev, wcid, qid, sta, skb);
if (mt76_is_usb(mdev)) if (mt76_is_usb(mdev)) {
put_unaligned_le32(skb->len, skb_push(skb, sizeof(skb->len))); u32 len = skb->len;
put_unaligned_le32(len, skb_push(skb, sizeof(len)));
}
return mt76_skb_adjust_pad(skb); return mt76_skb_adjust_pad(skb);
} }
......
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