WriteCompletion and Bulk transfer time clarification

Hi,

From my USB driver, transfer of 50 bytes takes 145 usec ( as per USBlyzer). I am wondering as why it takes so much of time?

Write is async and when time logs are taken using KeQuerySystemTime(), difference is shown as 0.

KeQuerySystemTime(&startTime); // inside UsbEvtIoWrite

KeQuerySystemTime(&WriteAckEndTime); // Inside writecompletion routine
diffTimeJustWrite = (ULONG)(WriteAckEndTime.QuadPart - startTime.QuadPart) / 10; in usec ; value is ZERO.

but in USBlyzer the BULK out is success after 145usec.

Does it mean the hardware takes 145usec to respond back to the USB ACPI driver? If this is correct, Can I assume the device USB firmware is slow in responding. Device controller runs at 300Mhz clock.

srinivaskumar.r@in.bosch.com wrote:

From my USB driver, transfer of 50 bytes takes 145 usec ( as per USBlyzer). I am wondering as why it takes so much of time?

Write is async and when time logs are taken using KeQuerySystemTime(), difference is shown as 0.

KeQuerySystemTime(&startTime); // inside UsbEvtIoWrite

KeQuerySystemTime(&WriteAckEndTime); // Inside writecompletion routine
diffTimeJustWrite = (ULONG)(WriteAckEndTime.QuadPart - startTime.QuadPart) / 10; in usec ; value is ZERO.

KeQuerySystemTime is only updated on scheduler intervals, every 10ms or
so. Any interval less than 10ms will read as 0.

Does it mean the hardware takes 145usec to respond back to the USB ACPI driver? If this is correct, Can I assume the device USB firmware is slow in responding. Device controller runs at 300Mhz clock.

I think you may be confused on how USB works. USB is a scheduled,
protocol bus. It’s not like RS232 where stuff goes out in real time.
Every microframe (125us) is scheduled by the host controller in
advance. The schedule for that microframe gets sent to the hardware,
which acts on it, and fires an interrupt when the microframe is
complete. The host controller driver can then act on whatever
completions occurred during that interval, while it submits the next
interval.


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