A question on payload data size in a URB

I am making a performance test of DUN through a phone, acting as a modem. the test is like this :

1 ) download a big file. With some tool , I can get to know USB DL URB is 1505 bytes on phone side.

2 ) By checking Log , I can get to know my driver receive and handle these data in batches of 250bytes . But my buffer for the Continuous Reader is set up to 4 K .

Then my question is :

  1. Does this 250 is determined by USB Stack Driver although my buffer is up to 4K ? 2) Can I code to increase it to a larger size ?

Thanks a lot .

On Fri, Jun 19, 2009 at 02:14:17AM -0400, xiedong_sl@126.com wrote:

I am making a performance test of DUN through a phone, acting as a modem.
the test is like this :

1 ) download a big file. With some tool , I can get to know USB DL URB
is 1505 bytes on phone side.

What does that mean? URBs exist only on the host side, not on the
phone side. Where did you find the 1505 figure?

2 ) By checking Log , I can get to know my driver receive and handle
these data in batches of 250bytes . But my buffer for the Continuous
Reader is set up to 4 K .

What kind of pipe is it? This could mean that your phone’s USB endpoint
has a packet size of 250 bytes, or maybe that the packet size is larger
but it only sends 250 bytes at a time.

Then my question is :

  1. Does this 250 is determined by USB Stack Driver although my buffer is
    up to 4K ? 2) Can I code to increase it to a larger size ?

This is almost certainly coming from the device itself. Remember that
packets on the USB wire are small – 512 bytes for a bulk pipe, no
more than 1024 for isochronous or interrupt pipes.

Tim Roberts, xxxxx@probo.com
Providenza & Boeklheide, Inc.

Thanks to Tim ,

As for question 1, I think I have been confused by some concepts . Yes . URB doesn’t exsit on phone side .

As for question 2, The pipe is a type of BULK IN.

Daniel Xie wrote:

  1. Does this 250 is determined by USB Stack Driver although my
    buffer is up to 4K ? 2) Can I code to increase it to a larger size ?

Under the assumption that your device’s bulk endpoints are 64 or 512 bytes, this isn’t going to work very well for you. 250 bytes is three 64-byte packets followed by a 58-byte one, or just a fraction of one 512-byte packet.

In either case, you will get a short transfer (and your URB will be completed back to you) because you didn’t keep sending full packets from your device.