From: David Brownell <david-b@pacbell.net>
To: Network development list <netdev@vger.kernel.org>
Cc: "Jean-Christophe Dubois" <jcd@tribudubois.net>
Subject: [RESEND patch 2.6.25-rc2-git] rndis_host: fix transfer size negotiation
Date: Thu, 13 Mar 2008 14:56:36 -0800 [thread overview]
Message-ID: <200803131556.36960.david-b@pacbell.net> (raw)
From: Jean-Christophe Dubois <jcd@tribudubois.net>
This patch should resolve a problem that's troubled support for
some RNDIS peripherals. It seems to have boiled down to using a
variable to establish transfer size limits before it was assigned,
which caused those devices to fallback to a default "jumbogram"
mode we don't support. Fix by assigning it earlier for RNDIS.
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
[ cleanups ]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
This bugfix should be merged before 2.6.25-final.
drivers/net/usb/rndis_host.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- g26.orig/drivers/net/usb/rndis_host.c 2008-02-01 22:24:38.000000000 -0800
+++ g26/drivers/net/usb/rndis_host.c 2008-02-16 12:55:35.000000000 -0800
@@ -16,10 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-// #define DEBUG // error path messages, extra info
-// #define VERBOSE // more; success messages
-
#include <linux/module.h>
#include <linux/init.h>
#include <linux/netdevice.h>
@@ -318,6 +314,14 @@ generic_rndis_bind(struct usbnet *dev, s
net->hard_header_len += sizeof (struct rndis_data_hdr);
dev->hard_mtu = net->mtu + net->hard_header_len;
+ dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1);
+ if (dev->maxpacket == 0) {
+ if (netif_msg_probe(dev))
+ dev_dbg(&intf->dev, "dev->maxpacket can't be 0\n");
+ retval = -EINVAL;
+ goto fail_and_release;
+ }
+
dev->rx_urb_size = dev->hard_mtu + (dev->maxpacket + 1);
dev->rx_urb_size &= ~(dev->maxpacket - 1);
u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size);
next reply other threads:[~2008-03-13 22:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-13 22:56 David Brownell [this message]
2008-03-17 12:08 ` [RESEND patch 2.6.25-rc2-git] rndis_host: fix transfer size negotiation Jeff Garzik
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=200803131556.36960.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=jcd@tribudubois.net \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.