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
|
status_t
|
||||||
BulkPipe::QueueBulk(void *data, size_t dataLength, usb_callback_func callback,
|
BulkPipe::QueueBulk(void *data, size_t dataLength, usb_callback_func callback,
|
||||||
void *callbackCookie)
|
void *callbackCookie)
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ public:
|
|||||||
Pipe(Object *parent);
|
Pipe(Object *parent);
|
||||||
virtual ~Pipe();
|
virtual ~Pipe();
|
||||||
|
|
||||||
void InitCommon(int8 deviceAddress,
|
virtual void InitCommon(int8 deviceAddress,
|
||||||
uint8 endpointAddress,
|
uint8 endpointAddress,
|
||||||
usb_speed speed,
|
usb_speed speed,
|
||||||
pipeDirection direction,
|
pipeDirection direction,
|
||||||
@@ -408,6 +408,14 @@ class BulkPipe : public Pipe {
|
|||||||
public:
|
public:
|
||||||
BulkPipe(Object *parent);
|
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
|
virtual uint32 Type() const { return USB_OBJECT_PIPE
|
||||||
| USB_OBJECT_BULK_PIPE; }
|
| USB_OBJECT_BULK_PIPE; }
|
||||||
virtual const char * TypeName() const { return "bulk pipe"; }
|
virtual const char * TypeName() const { return "bulk pipe"; }
|
||||||
|
|||||||
Reference in New Issue
Block a user