mmlr + stippi:

Hide USB errors better from the upper layers: Only try the "clear feature"
command if the error is B_DEV_STALLED. On other errors, the clear feature
was likely to fail, as it should only be used on stalled devices. Errors
intended to be ignored were thus not ignored because of the "clear feature"
failure.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26555 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-07-22 00:27:01 +00:00
parent f974514476
commit bee04bfed9
2 changed files with 6 additions and 4 deletions
@@ -133,8 +133,9 @@ KeyboardDevice::_InterpretBuffer()
if (IsRemoved())
return B_ERROR;
if (gUSBModule->clear_feature(fInterruptPipe,
USB_FEATURE_ENDPOINT_HALT) != B_OK)
if (fTransferStatus == B_DEV_STALLED
&& gUSBModule->clear_feature(fInterruptPipe,
USB_FEATURE_ENDPOINT_HALT) != B_OK)
return B_ERROR;
return B_OK;
@@ -82,8 +82,9 @@ MouseDevice::_InterpretBuffer()
if (IsRemoved())
return B_ERROR;
if (gUSBModule->clear_feature(fInterruptPipe,
USB_FEATURE_ENDPOINT_HALT) != B_OK)
if (fTransferStatus == B_DEV_STALLED
&& gUSBModule->clear_feature(fInterruptPipe,
USB_FEATURE_ENDPOINT_HALT) != B_OK)
return B_ERROR;
return B_OK;