diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2014-01-26 17:28:04 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-01-29 12:57:01 -0500 |
commit | 3de7382fc02dbe321772347fb289991db5962494 (patch) | |
tree | 0aace51f8a9076faee90e5b2040e56ff52ca4be4 /src/hw/usb.c | |
parent | 828ef12437094648db4c3747133d8c255fb50c91 (diff) | |
download | seabios-hppa-3de7382fc02dbe321772347fb289991db5962494.zip seabios-hppa-3de7382fc02dbe321772347fb289991db5962494.tar.gz seabios-hppa-3de7382fc02dbe321772347fb289991db5962494.tar.bz2 |
usb: Move default pipe max packet size code from xhci to main code.
Also, the max packet size for super speed devices is 512 bytes (not
256 bytes).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/hw/usb.c')
-rw-r--r-- | src/hw/usb.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/hw/usb.c b/src/hw/usb.c index ff20b6c..7b8a9f5 100644 --- a/src/hw/usb.c +++ b/src/hw/usb.c @@ -261,6 +261,13 @@ set_configuration(struct usb_pipe *pipe, u16 val) * Initialization and enumeration ****************************************************************/ +static const int speed_to_ctlsize[] = { + [ USB_FULLSPEED ] = 8, + [ USB_LOWSPEED ] = 8, + [ USB_HIGHSPEED ] = 64, + [ USB_SUPERSPEED ] = 512, +}; + // Assign an address to a device in the default state on the given // controller. static int @@ -276,7 +283,7 @@ usb_set_address(struct usbdevice_s *usbdev) // Create a pipe for the default address. struct usb_endpoint_descriptor epdesc = { - .wMaxPacketSize = 8, + .wMaxPacketSize = speed_to_ctlsize[usbdev->speed], .bmAttributes = USB_ENDPOINT_XFER_CONTROL, }; usbdev->defpipe = usb_alloc_pipe(usbdev, &epdesc); |