From 8f30f14eddead18aff27f3666390b5c63925895c Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sun, 18 Jan 2009 01:13:17 +0000 Subject: [PATCH] Fix pretty severe error in the convenience functions Pipe::SetFeature(), Pipe::ClearFeature() and Pipe::GetStatus(). These requests take the endpoint address in the logical form, including the direction bit. This caused all those requests to fail for all input pipes, most prominently visible in mass storage where a mass storage reset could never be done completely and would cause many devices to be unable to recover from errors. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28929 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/bus_managers/usb/Pipe.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/bus_managers/usb/Pipe.cpp b/src/add-ons/kernel/bus_managers/usb/Pipe.cpp index c4bafe2348..fe5e9f30a8 100644 --- a/src/add-ons/kernel/bus_managers/usb/Pipe.cpp +++ b/src/add-ons/kernel/bus_managers/usb/Pipe.cpp @@ -73,7 +73,8 @@ Pipe::SetFeature(uint16 selector) USB_REQTYPE_STANDARD | USB_REQTYPE_ENDPOINT_OUT, USB_REQUEST_SET_FEATURE, selector, - fEndpointAddress, + fEndpointAddress | (fDirection == In ? USB_ENDPOINT_ADDR_DIR_IN + : USB_ENDPOINT_ADDR_DIR_OUT), 0, NULL, 0, @@ -92,7 +93,8 @@ Pipe::ClearFeature(uint16 selector) USB_REQTYPE_STANDARD | USB_REQTYPE_ENDPOINT_OUT, USB_REQUEST_CLEAR_FEATURE, selector, - fEndpointAddress, + fEndpointAddress | (fDirection == In ? USB_ENDPOINT_ADDR_DIR_IN + : USB_ENDPOINT_ADDR_DIR_OUT), 0, NULL, 0, @@ -107,7 +109,8 @@ Pipe::GetStatus(uint16 *status) USB_REQTYPE_STANDARD | USB_REQTYPE_ENDPOINT_IN, USB_REQUEST_GET_STATUS, 0, - fEndpointAddress, + fEndpointAddress | (fDirection == In ? USB_ENDPOINT_ADDR_DIR_IN + : USB_ENDPOINT_ADDR_DIR_OUT), 2, (void *)status, 2,