Skip to content

Commit

Permalink
cdc_ncm: fix short packet issue on some devices
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Hans Petter Selasky authored and David S. Miller committed Apr 25, 2011
1 parent 9ac067a commit 8c61d9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/usb/cdc_ncm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 8c61d9d

Please sign in to comment.