Commit 98cfb82d authored by Robert Sprowson's avatar Robert Sprowson

Use RTSupport for both stalls and aborts

Implement the 'todo' note to use RTSupport instead of a callback. This means if the OS is stuck somewhere in SVC mode and no callbacks are happening the pipe is aborted, plus the state is held in the xfer struct rather than a single shared variable.

Version 0.18. Tagged as 'XHCIDriver-0_18'
parent d3ebe517
/* (0.17)
/* (0.18)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.17
#define Module_MajorVersion_CMHG 0.18
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 18 Dec 2016
#define Module_Date_CMHG 30 Jun 2017
#define Module_MajorVersion "0.17"
#define Module_Version 17
#define Module_MajorVersion "0.18"
#define Module_Version 18
#define Module_MinorVersion ""
#define Module_Date "18 Dec 2016"
#define Module_Date "30 Jun 2017"
#define Module_ApplicationDate "18-Dec-16"
#define Module_ApplicationDate "30-Jun-17"
#define Module_ComponentName "XHCIDriver"
#define Module_ComponentPath "mixed/RiscOS/Sources/HWSupport/USB/Controllers/XHCIDriver"
#define Module_FullVersion "0.17"
#define Module_HelpVersion "0.17 (18 Dec 2016)"
#define Module_LibraryVersionInfo "0:17"
#define Module_FullVersion "0.18"
#define Module_HelpVersion "0.18 (30 Jun 2017)"
#define Module_LibraryVersionInfo "0:18"
......@@ -247,22 +247,19 @@ void callout_reset(struct callout *c, int i, void (*f)(void *), void *v)
/*
* Emulate usb_init_task/usb_add_task for pipe timeouts
*/
static void (*abort_pipe_fn)(void *);
static _kernel_oserror *glue_abort_pipe_callback(_kernel_swi_regs *r, void *pw, void *arg)
void glue_abort_pipe(struct usb_task *task, void (*fun)(void *), void *arg)
{
abort_pipe_fn(arg);
UNUSED(r);
UNUSED(pw);
return NULL;
}
extern void *g_pw;
static const int pollword = 1;
void glue_abort_pipe(void (*fn)(void *), void *xfer)
{
//TODO! Could rationalise this to use RTSupport too?
abort_pipe_fn = fn;
callx_add_callback(glue_abort_pipe_callback, xfer);
/* Schedule the task at callback after interrupt level */
task->fun = fun;
task->arg = arg;
_swix(RT_Register, _INR(0,7)|_OUT(0),
0, /* Flags */
glue_rt_entry, *((uint32_t **)g_pw)+1, task, &pollword, NULL, NULL,
"XHCIAbortPipe:50",
(int *)&task->next /* Repurpose TAILQ for keeping a handle */);
}
void glue_clear_endpoint_stall(struct usb_task *task, void (*fun)(void *), void *arg)
......
......@@ -3655,7 +3655,7 @@ xhci_timeout(void *addr)
}
#ifdef RISCOS
glue_abort_pipe(xhci_timeout_task, addr);
glue_abort_pipe(&xx->xx_abort_task, xhci_timeout_task, addr);
#else
usb_init_task(&xx->xx_abort_task, xhci_timeout_task, addr,
USB_TASKQ_MPSAFE);
......
......@@ -79,10 +79,10 @@ void cv_signal(kcondvar_t *);
int cv_timedwait(kcondvar_t *, kmutex_t *, int);
/* Abort pipe and clear stall tasks */
void glue_abort_pipe(struct usb_task *, void (*fn)(void *), void *xfer);
void glue_clear_endpoint_stall(struct usb_task *, void (*fn)(void *), void *xfer);
int glue_rt_entry(void *);
int glue_rt_handler(void *);
void glue_abort_pipe(void (*fn)(void *), void *xfer);
/* Little helpers */
int ffs(int);
......
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