Skip to contentSkip to conversation

cdc_ncm: fix short packet issue on some devices

PATCH Applied Greg KH 2 participants 2 messages Apr 24, 2011 – Apr 25, 2011

Subsystems (4)
lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 cdc_ncm: fix short packet issue on some devices

From: Hans Petter Selasky <[email protected]>

The default maximum transmit length for NCM USB frames should be so that a short packet happens at the end if the device supports a length greater than the defined maximum. This is achieved by adding 4 bytes to the maximum length so that the existing logic can fit a short packet there.

---
 drivers/net/usb/cdc_ncm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/usb/cdc_ncm.c +2 -2
index 967371f..1033ef6 100644
@@ -54,13 +54,13 @@
 #include <linux/usb/usbnet.h>
 #include <linux/usb/cdc.h>
 
-#define	DRIVER_VERSION				"7-Feb-2011"
+#define	DRIVER_VERSION				"23-Apr-2011"
 
 /* CDC NCM subclass 3.2.1 */
 #define USB_CDC_NCM_NDP16_LENGTH_MIN		0x10
 
 /* Maximum NTB length */
-#define	CDC_NCM_NTB_MAX_SIZE_TX			16384	/* bytes */
+#define	CDC_NCM_NTB_MAX_SIZE_TX			(16384 + 4) /* bytes, must be short terminated */
 #define	CDC_NCM_NTB_MAX_SIZE_RX			16384	/* bytes */
 
 /* Minimum value for MaxDatagramSize, ch. 6.2.9 */
Signature · 1 line
1.7.1.1
maintainer Applied
#1 lore raw

From: Greg KH <[email protected]>
Date: Sun, 24 Apr 2011 16:59:30 -0700

Quoted 10 lines

From: Hans Petter Selasky <[email protected]>

The default maximum transmit length for NCM USB frames should be so that a short packet happens at the end if the device supports a length greater than the defined maximum. This is achieved by adding 4 bytes to the maximum length so that the existing logic can fit a short packet there.

Applied, thanks Greg.