net: asix: Fix AX88772B when used with DriverModel
authorJoshua Scott <joshua.scott@alliedtelesis.co.nz>
Tue, 6 Sep 2016 04:03:11 +0000 (16:03 +1200)
committerJoe Hershberger <joe.hershberger@ni.com>
Fri, 9 Sep 2016 18:13:42 +0000 (13:13 -0500)
A previous patch (net: asix: fix operation without eeprom) added a
two-byte shift to the packet buffer when receiving a packet on the
AX88772B.

This shift was not included when the driver was updated to work with
DriverModel. Testing on a Marvell DB-88F6820-ACM showed that the adapter
was not functioning correctly (EHCI timeouts).

This patch brings the two-byte shift to the DriverModel implementation
of ops->recv (asix_eth_recv).

Testing on the same board, we were able to TFTP a file over and confirm
that the crc32 was correct.

Signed-off-by: Joshua Scott <joshua.scott@alliedtelesis.co.nz>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/usb/eth/asix.c

index ad083cf8ae4a28b4a6e56202f26dab0fcd56e592..a610ae447bf7a576f09fa1c0657b8651761b81ac 100644 (file)
@@ -819,6 +819,11 @@ int asix_eth_recv(struct udevice *dev, int flags, uchar **packetp)
        }
 
        *packetp = ptr + sizeof(packet_len);
+
+       if ((ueth->pusb_dev->descriptor.idVendor == ASIX_USB_VENDOR_ID) &&
+           (ueth->pusb_dev->descriptor.idProduct == AX88772B_USB_PRODUCT_ID))
+               *packetp += 2;
+
        return packet_len;
 
 err: