Skip to content
Commit 2262ed7b authored by Michael Hope's avatar Michael Hope Committed by Anas Nashif
Browse files

netusb: drop the extra byte added for multiple-of-64-byte packets.



This fixes a bug in the cdc_ecm Ethernet over USB driver.  The ECM
spec (section 3.3.1) says that the end of an Ethernet frame is marked
using the USB short packet mechanisim, where the last packet is less
than the maximum packet size.  If the Ethernet frame is a multiple of
the USB maximum packet size then a final zero length packet must be
sent.

Linux however sends a one byte packet (usbnet.c:1393) to work
around hardware issues with zero length packets.

The current Zephyr driver works most of the time except when you send
an Ethernet frame of the right length where the last byte is zero,
such as:

$ ping 192.0.2.1 -s 23 -p 0

Zephyr then drops the last byte, creating a short frame which gets
dropped higher up in the stack.

Signed-off-by: default avatarMichael Hope <mlhx@google.com>
parent 3012157a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment