GitLab has been upgraded to 13.3.6. If you encounter any issues mail code@riscosopen.org

Commit 3da3b7b4 authored by ROOL's avatar ROOL 🤖

Fix to device descriptor interval handling

Detail:
  For high speed interrupt endpoints, and full/high speed isochronous, the bInterval value is held in log2 form. Take this into account.
  Correct the built in root hub device descriptor similarly - 255 is not valid for a HSHUBSTT (USB 2.0 errata 07-Dec-2000 corrected the mistake on page 412 of the USB 2.0 spec).
Admin:
  Based on a submission from Colin Granville, with edits.

Version 0.33. Tagged as 'DWCDriver-0_33'
parent 8ee45d86
/* (0.32)
/* (0.33)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.32
#define Module_MajorVersion_CMHG 0.33
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 19 Sep 2017
#define Module_Date_CMHG 25 Nov 2017
#define Module_MajorVersion "0.32"
#define Module_Version 32
#define Module_MajorVersion "0.33"
#define Module_Version 33
#define Module_MinorVersion ""
#define Module_Date "19 Sep 2017"
#define Module_Date "25 Nov 2017"
#define Module_ApplicationDate "19-Sep-17"
#define Module_ApplicationDate "25-Nov-17"
#define Module_ComponentName "DWCDriver"
#define Module_ComponentPath "mixed/RiscOS/Sources/HWSupport/USB/Controllers/DWCDriver"
#define Module_FullVersion "0.32"
#define Module_HelpVersion "0.32 (19 Sep 2017)"
#define Module_LibraryVersionInfo "0:32"
#define Module_FullVersion "0.33"
#define Module_HelpVersion "0.33 (25 Nov 2017)"
#define Module_LibraryVersionInfo "0:33"
......@@ -122,8 +122,15 @@ usbd_status softc_device_start(usbd_xfer_handle xfer)
DPRINTF(("xfer len %08x buf %08x -> %08x\n",ex->xfer.length,buf,dma_addr));
/* Set urb parameters for this xfer */
uint32_t interval = ed->bInterval;
if (UE_GET_XFERTYPE(ed->bmAttributes) == UE_ISOCHRONOUS ||
(UE_GET_XFERTYPE(ed->bmAttributes) == UE_INTERRUPT && xfer->pipe->device->speed == USB_SPEED_HIGH))
{
interval = min(interval - 1, 15); /* USB 2.0, Table 9-13 */
interval = 1 << interval;
}
dwc_otg_hcd_urb_set_params(epipe->urb,ex,buf,dma_addr,ex->xfer.length,epipe->request,epipe->dma_req,flags,ed->bInterval);
dwc_otg_hcd_urb_set_params(epipe->urb,ex,buf,dma_addr,ex->xfer.length,epipe->request,epipe->dma_req,flags,interval);
/* DWCTODO - Set isoc desc params */
......
......@@ -115,7 +115,7 @@ static const usb_endpoint_descriptor_t softc_endpd = {
UE_DIR_IN | DWC_SOFTC_INTR_ENDPT,
UE_INTERRUPT,
{8, 0}, /* max packet */
255
12
};
static int softc_str(usb_string_descriptor_t* p, int l, char *s)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment