When using DriverStudio 2.5, our device driver generated from driver wizard has some problems in reading USB configuration. The configuration data which is read from our device is wrong.
In the line 1487 of KUsb.cpp, Remark the code "pPipeInfo->PipeFlags |= USBD_PF_CHANGE_MAX_PACKET; "
After We take that method,The configuration data which is read from our device is correct.
Is it a bug or not ?
I also have received some responses from our customers regarding USB transfer size. More facts show that it is likely to be a bug in Microsoft DDK document.
DDK topic: Selecting the USB Device Configuration
"USBD_CreateConfigurationRequestEx initializes Pipes.MaximumTransferSize to the default maximum transfer size for a single URB read/write request. The driver can specify a different maximum transfer size in the Pipes.MaximumTransferSize, if it also specifies the USBD_PF_CHANGE_MAX_PACKET flag in Pipes.PipeFlags."
We add this flag in DriverWorks framework in DriverWorks 2.5 and 2.6. However, many reports show this flag does not actually change MaximumTransferSize. It looks odd to us that TransferSize use PacketSize flag. Remember that USB transfer size and packet size are totally two different thing. Please see USB spec for more information.
Here is what we propose to change in DriverWorks 2.5 and 2.6:
Remove this line in KUsbLowerDevice::Configure(..) in DriverWorks framework:
pPipeInfo->PipeFlags |= USBD_PF_CHANGE_MAX_PACKET;
Recompile DriverWorks library, add MaxTransferSize parameters back to your driver.
This should make your USB driver work again.
Also, if you have more information about this flag and how it affects your driver behavior, please feel free to send me your finding to Nashua.Support@Compuware.com
We will remove this flag in next version of DriverWorks, 2.7.