I found a DataToggle Mismatch bug in USBClient.c
I need to know how to replace USBClient.lib in PB

Thanks a lot
Hilbert.

*****************************************
The bug is in the function "ResetBulkEndpoint()"
Since ResetPipe does nothing if Pipe is not halted.
So, DataToggle bit of the Pipe may be Toggle "1"
However, ClearOrSetFeature will reseet DataToggle bit
to "0" at USB device side.
It will cause Data Toggle Mismatch Error.


ResetBulkEndpoint(
.
.
.
)
{
.
.
.
//
// reset this pipe
//
ResetPipe(pUsbFuncs, hPipe, dwFlags);
.
.
.
#if GET_ENDPOINT_STATUS

// GetStatus can take quite some time, and will
sometimes hang EP0 on a bad device.
// Since we can't recover via port reset then do
it blindy.
dwErr = GetStatus( pUsbFuncs,
hUsbDevice,
NotifyRoutine,
NotifyContext,
USB_SEND_TO_ENDPOINT,
bIndex,
&wHalt,
dwTimeout );
#else
// just do it
wHalt = 0x01;
#endif

if ( ERROR_SUCCESS == dwErr && 0x01 == wHalt ) {
DEBUGMSG( ZONE_USBCLIENT, (TEXT("Enpoint:0x%x
wStatus:0x%x\n"), bIndex, wHalt ));

dwErr = ClearOrSetFeature(...); // clear
}
.
.
.
}

Re: How to recreate USBClient.lib by David

David
Wed Nov 12 23:03:51 CST 2003

I believe Microsoft has issued KB doc on this issue. This has been fixed.
What you can do is: Open Build Consol and type
cd public\common\oak\drivers\usb\class\common
build -c
sysgen usbclient

David Liao


"hilbert" <zhenyuzhang@hotmail.com> wrote in message
news:2e4701c3a984$9e1c2e10$3101280a@phx.gbl...
> I found a DataToggle Mismatch bug in USBClient.c
> I need to know how to replace USBClient.lib in PB
>
> Thanks a lot
> Hilbert.
>
> *****************************************
> The bug is in the function "ResetBulkEndpoint()"
> Since ResetPipe does nothing if Pipe is not halted.
> So, DataToggle bit of the Pipe may be Toggle "1"
> However, ClearOrSetFeature will reseet DataToggle bit
> to "0" at USB device side.
> It will cause Data Toggle Mismatch Error.
>
>
> ResetBulkEndpoint(
> .
> .
> .
> )
> {
> .
> .
> .
> //
> // reset this pipe
> //
> ResetPipe(pUsbFuncs, hPipe, dwFlags);
> .
> .
> .
> #if GET_ENDPOINT_STATUS
>
> // GetStatus can take quite some time, and will
> sometimes hang EP0 on a bad device.
> // Since we can't recover via port reset then do
> it blindy.
> dwErr = GetStatus( pUsbFuncs,
> hUsbDevice,
> NotifyRoutine,
> NotifyContext,
> USB_SEND_TO_ENDPOINT,
> bIndex,
> &wHalt,
> dwTimeout );
> #else
> // just do it
> wHalt = 0x01;
> #endif
>
> if ( ERROR_SUCCESS == dwErr && 0x01 == wHalt ) {
> DEBUGMSG( ZONE_USBCLIENT, (TEXT("Enpoint:0x%x
> wStatus:0x%x\n"), bIndex, wHalt ));
>
> dwErr = ClearOrSetFeature(...); // clear
> }
> .
> .
> .
> }
>