On 12/15/06, David Brownell <[EMAIL PROTECTED]> wrote:
> On Wednesday 13 December 2006 2:17 pm, Ole André Vadla Ravnås wrote:
(...)
> > After debugging this issue further I discovered that RNDIS_MSG_INIT's
> > MaxTransferSize, sent by the host, is the value that
> > usbnet.rx_urb_size should be set to. If this is set to something lower
> > the device will (obviously) prepare larger URB payloads than what we
> > expect, and thus we'll fetch partial ones. This results in horrible
> > performance and makes the device stop responding after attempting a
> > few transfers.
> >
> > Patch (attached): linux-2.6.19-git-rndis_host-rx_usb_size-fix.patch
>
> This patch looks wrong.  Instead, how about this theory:  the peripheral
> is using the "pad with zeroes to end of packet" option on packets it
> sends, but the rndis_host code wasn't expecting that.  The reason your
> patch worked was because it was creating HUGE rx buffers, which also
> coincidntally happened to allow that padding.
>
> I've updated the patch to allow padded RX buffers like that.

Well, I tried with the revised patch and that seems to have broken it
completely.
My theory here is that the MaxTransferSize you specify in the
RNDIS_MSG_INIT is the maximum size you're able to read (IN) in one
transfer (one URB in the USB context). My devices here (HTC Wizard,
HTC TyTN and Dell Axim X51) all batch multiple RNDIS_MSG_PACKET
messages per transfer. So, what happens if you generate sufficient
traffic from the device to the host is that the device batches
multiple packets in each transfer, typically 13-14 kB worth of
packets. When you do one read with the buffer-size set to for instance
8 kB, the device will (obviously) give you the first 8 kB, and the
rest in the next read. So, by stating 16 kB in MaxTransferSize we
oblige to have an rx buffer at least that big. And when sending URBs
to the device, we should never do bigger (OUT) transfers than what the
device reports as MaxTransferSize in the RNDIS_MSG_INIT reply.

Ole André

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to