mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Toby Gray <toby.gray@realvnc.com>
To: Oliver Neukum <oliver@neukum.name>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Toby Gray <toby.gray@realvnc.com>
Subject: [PATCH 1/1] usb: cdc-ncm: Increase maximum allowed datagram size
Date: Tue, 14 Feb 2012 14:39:35 +0000	[thread overview]
Message-ID: <1329230375-25508-1-git-send-email-toby.gray@realvnc.com> (raw)

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 <toby.gray@realvnc.com>
---
 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


             reply	other threads:[~2012-02-14 14:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14 14:39 Toby Gray [this message]
2012-02-14 19:46 ` David Miller
2012-02-14 22:27   ` Alexey Orishko
2012-02-15  8:53     ` Oliver Neukum
2012-02-15 14:40       ` Alexey Orishko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1329230375-25508-1-git-send-email-toby.gray@realvnc.com \
    --to=toby.gray@realvnc.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oliver@neukum.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®