zephyr/subsys/usb/class/netusb
Michael Hope 2262ed7b18 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: Michael Hope <mlhx@google.com>
2018-03-02 07:34:53 +01:00
..
CMakeLists.txt usb: rndis: Add Remote NDIS protocol handling 2018-01-17 18:53:05 -05:00
function_ecm.c netusb: drop the extra byte added for multiple-of-64-byte packets. 2018-03-02 07:34:53 +01:00
function_rndis.c usb: rndis: Use offsetof macro to ease offset calculations 2018-01-17 18:53:05 -05:00
function_rndis.h usb: Add RNDIS packet boundary check 2018-01-17 18:53:05 -05:00
Kconfig kconfig: fix more help spacing issues 2018-02-15 23:20:55 -05:00
netusb.c usb: usbnet: Clean up code 2018-01-31 07:42:19 -05:00
netusb.h usb: rndis: Add Remote NDIS protocol handling 2018-01-17 18:53:05 -05:00