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

Commit 972e2607 authored by ROOL's avatar ROOL 🤖

Improve response USBDriver finalisation

Detail:
  Listen for Service_USB_USBDriverDead then shut down the driver, rather than Service_ModulePostFinal.
  Ensure the returned status is defined if USBDriver_InsertTransfer fails (because USBDriver has gone).
Admin:
  Submission from Colin Granville.

Version 0.34. Tagged as 'DWCDriver-0_34'
parent 3da3b7b4
/* (0.33)
/* (0.34)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.33
#define Module_MajorVersion_CMHG 0.34
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 25 Nov 2017
#define Module_Date_CMHG 27 Jan 2018
#define Module_MajorVersion "0.33"
#define Module_Version 33
#define Module_MajorVersion "0.34"
#define Module_Version 34
#define Module_MinorVersion ""
#define Module_Date "25 Nov 2017"
#define Module_Date "27 Jan 2018"
#define Module_ApplicationDate "25-Nov-17"
#define Module_ApplicationDate "27-Jan-18"
#define Module_ComponentName "DWCDriver"
#define Module_ComponentPath "mixed/RiscOS/Sources/HWSupport/USB/Controllers/DWCDriver"
#define Module_FullVersion "0.33"
#define Module_HelpVersion "0.33 (25 Nov 2017)"
#define Module_LibraryVersionInfo "0:33"
#define Module_FullVersion "0.34"
#define Module_HelpVersion "0.34 (27 Jan 2018)"
#define Module_LibraryVersionInfo "0:34"
......@@ -399,18 +399,13 @@ void module_services(int service_number, _kernel_swi_regs *r, void *pw)
}
}
break;
#if 0 /* Don't shutdown the driver here, wait for ModulePostFinal. This avoids us having to deal with USBDriver calling us to close pipes and cancel transfers after we've shutdown the DWC layer */
case Service_USB_USBDriverDying:
dprintf (("", "Deregistering with USB driver\n"));
/* USBDriver will do the deregistering at this point, since
it's SWIs are not active anymore */
// ehci_detach(&ehci_soft,0);
// ehci_shutdown(&ehci_soft);
case Service_USB_USBDriverDead:
dprintf (("", "USB driver is dead, shutting down\n"));
usb_soft = NULL;
shutdown_driver();
break;
#endif
default:break;
default:
break;
}
break;
case Service_PreReset:
......@@ -422,14 +417,6 @@ void module_services(int service_number, _kernel_swi_regs *r, void *pw)
}
shutdown_driver();
break;
case Service_ModulePostFinal:
if(!strcmp((const char *) r->r[2],"USBDriver"))
{
dprintf(("","Svce postfinal USBDriver\n"));
usb_soft = NULL;
shutdown_driver();
}
break;
case Service_ClaimFIQ:
if(own_fiq_vector)
{
......@@ -532,7 +519,7 @@ int usb_irq_handler(_kernel_swi_regs *r, void *pw)
usbd_status usb_insert_transfer(usbd_xfer_handle xfer)
{
usbd_status status;
usbd_status status = USBD_CANCELLED; /* Should _swix() error */
_swix (USBDriver_InsertTransfer, _IN (0) | _OUT (0), xfer, &status);
return status;
}
......
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