Commit b229bf7d authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Felix Fietkau

mt76: usb: fix endian in mt76u_copy

In contrast to mt76_wr() which we use to program registers,
on mt76_wr_copy() we should not change endian of the data.

Fixes: b40b15e1 ("mt76: add usb support to mt76 layer")
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 820e4da1
...@@ -165,11 +165,11 @@ static void mt76u_copy(struct mt76_dev *dev, u32 offset, ...@@ -165,11 +165,11 @@ static void mt76u_copy(struct mt76_dev *dev, u32 offset,
mutex_lock(&usb->usb_ctrl_mtx); mutex_lock(&usb->usb_ctrl_mtx);
for (i = 0; i < DIV_ROUND_UP(len, 4); i++) { for (i = 0; i < DIV_ROUND_UP(len, 4); i++) {
put_unaligned_le32(val[i], usb->data); put_unaligned(val[i], (u32 *) usb->data);
ret = __mt76u_vendor_request(dev, MT_VEND_MULTI_WRITE, ret = __mt76u_vendor_request(dev, MT_VEND_MULTI_WRITE,
USB_DIR_OUT | USB_TYPE_VENDOR, USB_DIR_OUT | USB_TYPE_VENDOR,
0, offset + i * 4, usb->data, 0, offset + i * 4, usb->data,
sizeof(__le32)); sizeof(u32));
if (ret < 0) if (ret < 0)
break; break;
} }
......
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