hrev46471 adds 1 changeset to branch 'master' old head: 44b4797910324a19885229acd0ff8caa836f4e47 new head: 334c06ae65a0cafcf647aef9f96d2b9b1f59c66e overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=334c06a+%5E44b4797 ---------------------------------------------------------------------------- 334c06a: usb: enforce wMaxPacketSize on high speed bulk endpoints. * according to the USB 2.0 specification. [ Jérôme Duval <jerome.duval@xxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev46471 Commit: 334c06ae65a0cafcf647aef9f96d2b9b1f59c66e URL: http://cgit.haiku-os.org/haiku/commit/?id=334c06a Author: Jérôme Duval <jerome.duval@xxxxxxxxx> Date: Sun Dec 1 21:01:51 2013 UTC ---------------------------------------------------------------------------- 2 files changed, 23 insertions(+), 1 deletion(-) src/add-ons/kernel/bus_managers/usb/Pipe.cpp | 14 ++++++++++++++ src/add-ons/kernel/bus_managers/usb/usb_private.h | 10 +++++++++- ---------------------------------------------------------------------------- diff --git a/src/add-ons/kernel/bus_managers/usb/Pipe.cpp b/src/add-ons/kernel/bus_managers/usb/Pipe.cpp index b6af871..f317028 100644 --- a/src/add-ons/kernel/bus_managers/usb/Pipe.cpp +++ b/src/add-ons/kernel/bus_managers/usb/Pipe.cpp @@ -165,6 +165,20 @@ BulkPipe::BulkPipe(Object *parent) } +void +BulkPipe::InitCommon(int8 deviceAddress, uint8 endpointAddress, + usb_speed speed, pipeDirection direction, size_t maxPacketSize, + uint8 interval, int8 hubAddress, uint8 hubPort) +{ + // some devices have bogus descriptors + if (speed == USB_SPEED_HIGHSPEED && maxPacketSize != 512) + maxPacketSize = 512; + + Pipe::InitCommon(deviceAddress, endpointAddress, speed, direction, + maxPacketSize, interval, hubAddress, hubPort); +} + + status_t BulkPipe::QueueBulk(void *data, size_t dataLength, usb_callback_func callback, void *callbackCookie) diff --git a/src/add-ons/kernel/bus_managers/usb/usb_private.h b/src/add-ons/kernel/bus_managers/usb/usb_private.h index 4f0ffc6..e3f38a3 100644 --- a/src/add-ons/kernel/bus_managers/usb/usb_private.h +++ b/src/add-ons/kernel/bus_managers/usb/usb_private.h @@ -287,7 +287,7 @@ public: Pipe(Object *parent); virtual ~Pipe(); - void InitCommon(int8 deviceAddress, +virtual void InitCommon(int8 deviceAddress, uint8 endpointAddress, usb_speed speed, pipeDirection direction, @@ -408,6 +408,14 @@ class BulkPipe : public Pipe { public: BulkPipe(Object *parent); +virtual void InitCommon(int8 deviceAddress, + uint8 endpointAddress, + usb_speed speed, + pipeDirection direction, + size_t maxPacketSize, + uint8 interval, + int8 hubAddress, uint8 hubPort); + virtual uint32 Type() const { return USB_OBJECT_PIPE | USB_OBJECT_BULK_PIPE; } virtual const char * TypeName() const { return "bulk pipe"; }