Skip to content

Commit 9a04a85

Browse files
nvswarrentrini
authored andcommitted
net: asix: don't pad odd-length TX packets
For Ethernet/USB RX packets, the ASIX HW pads odd-sized packets so that they have an even size. Currently, asix_recv() does remove this padding, and asic_send() adds equivalent padding in the TX path. However, the HW does not appear to need this packing for TX packets in practical testing with "ASIX Elec. Corp. AX88x72A 000001" Vendor: 0x0b95 Product 0x7720 Version 0.1. The Linux kernel does no such padding for the TX path. Remove the padding from the TX path: * For consistency with the Linux kernel. * NVIDIA has a Tegra simulator which validates that the length of USB packets sent to an ASIX device matches the packet length value inside the packet data. Having U-Boot and the kernel do the same thing when creating the TX packets simplifies the simulator's validation. Cc: Lucas Stach <[email protected]> Cc: Marek Vasut <[email protected]> Cc: Simon Glass <[email protected]> Signed-off-by: Stephen Warren <[email protected]> Acked-by: Simon Glass <[email protected]> Acked-by: Marek Vasut <[email protected]> Tested-by: Marek Vasut <[email protected]> Tested-by: Gerhard Sittig <[email protected]>
1 parent e4b87e5 commit 9a04a85

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/usb/eth/asix.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,6 @@ static int asix_send(struct eth_device *eth, void *packet, int length)
468468

469469
memcpy(msg, &packet_len, sizeof(packet_len));
470470
memcpy(msg + sizeof(packet_len), (void *)packet, length);
471-
if (length & 1)
472-
length++;
473471

474472
err = usb_bulk_msg(dev->pusb_dev,
475473
usb_sndbulkpipe(dev->pusb_dev, dev->ep_out),

0 commit comments

Comments
 (0)