Revision 6dfcdccb
b/usb-linux.c | ||
---|---|---|
213 | 213 |
return s->endp_table[ep - 1].iso_buffer_used; |
214 | 214 |
} |
215 | 215 |
|
216 |
static void set_max_packet_size(USBHostDevice *s, int ep, uint8_t *descriptor) |
|
217 |
{ |
|
218 |
int raw = descriptor[4] + (descriptor[5] << 8); |
|
219 |
int size, microframes; |
|
220 |
|
|
221 |
size = raw & 0x7ff; |
|
222 |
switch ((raw >> 11) & 3) { |
|
223 |
case 1: microframes = 2; break; |
|
224 |
case 2: microframes = 3; break; |
|
225 |
default: microframes = 1; break; |
|
226 |
} |
|
227 |
DPRINTF("husb: max packet size: 0x%x -> %d x %d\n", |
|
228 |
raw, microframes, size); |
|
229 |
s->endp_table[ep - 1].max_packet_size = size * microframes; |
|
230 |
} |
|
231 |
|
|
216 | 232 |
static int get_max_packet_size(USBHostDevice *s, int ep) |
217 | 233 |
{ |
218 | 234 |
return s->endp_table[ep - 1].max_packet_size; |
... | ... | |
1008 | 1024 |
break; |
1009 | 1025 |
case 0x01: |
1010 | 1026 |
type = USBDEVFS_URB_TYPE_ISO; |
1011 |
s->endp_table[(devep & 0xf) - 1].max_packet_size = |
|
1012 |
descriptors[i + 4] + (descriptors[i + 5] << 8); |
|
1027 |
set_max_packet_size(s, (devep & 0xf), descriptors + i); |
|
1013 | 1028 |
break; |
1014 | 1029 |
case 0x02: |
1015 | 1030 |
type = USBDEVFS_URB_TYPE_BULK; |
Also available in: Unified diff