Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760882Ab2BNO6R (ORCPT ); Tue, 14 Feb 2012 09:58:17 -0500 Received: from realvnc.com ([146.101.152.142]:38259 "EHLO realvnc.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753855Ab2BNO6O (ORCPT ); Tue, 14 Feb 2012 09:58:14 -0500 X-Greylist: delayed 1114 seconds by postgrey-1.27 at vger.kernel.org; Tue, 14 Feb 2012 09:58:14 EST From: Toby Gray To: Oliver Neukum , Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Toby Gray Subject: [PATCH 1/1] usb: cdc-ncm: Increase maximum allowed datagram size Date: Tue, 14 Feb 2012 14:39:35 +0000 Message-Id: <1329230375-25508-1-git-send-email-toby.gray@realvnc.com> X-Mailer: git-send-email 1.7.0.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1325 Lines: 38 Some NCM devices exist which will send datagrams larger than 2k and don't support the GetMaxDatagramSize request, such as the Nokia 701 Mobile Telephone. This sets the maximum limit of datagrams to the theoretical limit for 16-bit NTBs, preventing dropping of large datagrams received from some devices. Signed-off-by: Toby Gray --- drivers/net/usb/cdc_ncm.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 3a539a9..d9be846 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -67,8 +67,10 @@ #define CDC_NCM_MIN_TX_PKT 512 /* bytes */ -/* Default value for MaxDatagramSize */ -#define CDC_NCM_MAX_DATAGRAM_SIZE 2048 /* bytes */ +/* Maximum value for MaxDatagramSize, this is 16k (max NTB size) + * minus NTH size (12 bytes) and minus the smallest possible NDP size + * (16 bytes). */ +#define CDC_NCM_MAX_DATAGRAM_SIZE 16356 /* bytes */ /* * Maximum amount of datagrams in NCM Datagram Pointer Table, not counting -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/