none
USB Transfer and Packet Sizes with WDM kernel driver RRS feed

  • Question

  • I have legacy WDM USB kernel driver on Windows 7 embedded x64 platform. The driver is compiled under WinDDK\7600.16385.1

    The spec reads that Windows' USB stack has a maximum hardcoded packet size of 4k for the default control endpoint. http://msdn.microsoft.com/en-us/library/windows/hardware/ff538112(v=vs.85).aspx

    I have full speed devices connected to a machine using this driver. The application is sending control transfers  bigger that 4k on default endpoint (I hooked up a USB comm. analyzer to confirm this). is this just luck or am I misinterpreting the specs.

    The application could send up to 64k payload on the control endpoint. I am worried that it would fail in the field.

    Wednesday, November 12, 2014 1:08 AM

Answers

  • It might happen to work because the limit is not enforced uniformly across different controllers and OSes. In some cases, it is applied only on non-default control endpoints and in some cases (for e.g. Windows 8 XHCI), it is applied for all control endpoints. In order to guarantee that it works across all OSes and controllers, the driver should follow the MSDN guideline.

    Thanks,

    Vivek

    Wednesday, November 12, 2014 1:41 AM

All replies

  • It might happen to work because the limit is not enforced uniformly across different controllers and OSes. In some cases, it is applied only on non-default control endpoints and in some cases (for e.g. Windows 8 XHCI), it is applied for all control endpoints. In order to guarantee that it works across all OSes and controllers, the driver should follow the MSDN guideline.

    Thanks,

    Vivek

    Wednesday, November 12, 2014 1:41 AM
  • Could you please elaborate on "It might happen to work because the limit is not enforced uniformly across different controllers and OSes".  I am using Windows' default driver "USBEHCI.sys 6.1.7601.1821 (Win7 sp1_gd 130903-1532) Microsoft Corporation". So this driver is not enforcing the rule defined in the link above?

    Our application was originally written on Linux, and USB spec defines 64k limit for control transfer, regardless of the speed. We can't modify the application to restrict payload to 4K as the protocol itself is relying on 64k payload. What can we do on the OS side to ensure it will always work?

    Wednesday, November 12, 2014 4:47 PM