Asaf Shelly <> wrote:
>
>How about that....
>It has been 10 years since I last read chapter 9. Didn't even remember there
>was a limit.
>Thanks for the answer it was really helpful.
>Now can someone please tell me why my USB1.1 hardware enjoys 2X time
>improvement when I am using 128 bytes per buffer.
Absolutely. Remember USB is a scheduled bus; the entire frame is scheduled
in advance; the hardware then executes the transfers on its own while the
HCD driver schedules the next frame. Let's say you send 64 bytes and wait,
then send 64 bytes and wait. In that case, you are going to send exactly
one packet per frame, so no more than 64 bytes per millisecond.
But when you send 128 bytes and wait, the HCD driver can schedule that as 2
64-bit packets in a single frame. That doubles your throughput. If you
send 1024-byte buffers, you'll do even better.
Howver, the device's endpoint packet size is limited to 64 bytes (for full
speed).
>* Also this is no reason for a blue-screen. The host can detect that the
>device is doing something wrong and ignore it. I know that devices are not
>expected to make such mistakes but this is load-time tests so there is no
>impact on performance. Having a device that can make the kernel read invalid
>buffers is also a potential security risk.
Well, USB is a protocol bus, and devices are expected to obey the
protocols. There are tests for protocol compliance that must be passed
before your driver can be WHQL-approved, but the system cannot be expected
to protect against every protocol violation.
Yes, you are right, and I am just making lame excuses.
--
Tim Roberts,
Providenza & Boekelheide, Inc.