usb: enforce wMaxPacketSize on high speed bulk endpoints.
* according to the USB 2.0 specification.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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"; }
|
||||
|
||||
Reference in New Issue
Block a user