mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-06-01 21:36:48 +08:00
Add USB UGEN support for RTEMS
This commit is contained in:
parent
3e7de301c1
commit
a7415b7f2f
@ -804,9 +804,11 @@ usb_fifo_close(struct usb_fifo *f, int fflags)
|
||||
}
|
||||
/* check if a thread wants SIGIO */
|
||||
if (f->async_p != NULL) {
|
||||
#ifndef __rtems__
|
||||
PROC_LOCK(f->async_p);
|
||||
kern_psignal(f->async_p, SIGIO);
|
||||
PROC_UNLOCK(f->async_p);
|
||||
#endif /* __rtems__ */
|
||||
f->async_p = NULL;
|
||||
}
|
||||
/* remove FWRITE and FREAD flags */
|
||||
@ -1025,6 +1027,7 @@ usb_ioctl_f_sub(struct usb_fifo *f, u_long cmd, void *addr,
|
||||
break;
|
||||
|
||||
case FIOASYNC:
|
||||
#ifndef __rtems__
|
||||
if (*(int *)addr) {
|
||||
if (f->async_p != NULL) {
|
||||
error = EBUSY;
|
||||
@ -1034,6 +1037,9 @@ usb_ioctl_f_sub(struct usb_fifo *f, u_long cmd, void *addr,
|
||||
} else {
|
||||
f->async_p = NULL;
|
||||
}
|
||||
#else /* __rtems__ */
|
||||
f->async_p = NULL;
|
||||
#endif /* __rtems__ */
|
||||
break;
|
||||
|
||||
/* XXX this is not the most general solution */
|
||||
@ -1042,10 +1048,12 @@ usb_ioctl_f_sub(struct usb_fifo *f, u_long cmd, void *addr,
|
||||
error = EINVAL;
|
||||
break;
|
||||
}
|
||||
#ifndef __rtems__
|
||||
if (*(int *)addr != USB_PROC_GET_GID(f->async_p)) {
|
||||
error = EPERM;
|
||||
break;
|
||||
}
|
||||
#endif /* __rtems__ */
|
||||
break;
|
||||
default:
|
||||
return (ENOIOCTL);
|
||||
@ -1769,11 +1777,13 @@ usb_fifo_wakeup(struct usb_fifo *f)
|
||||
selwakeup(&f->selinfo);
|
||||
f->flag_isselect = 0;
|
||||
}
|
||||
#ifndef __rtems__
|
||||
if (f->async_p != NULL) {
|
||||
PROC_LOCK(f->async_p);
|
||||
kern_psignal(f->async_p, SIGIO);
|
||||
PROC_UNLOCK(f->async_p);
|
||||
}
|
||||
#endif /* __rtems__ */
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define USB_HAVE_CONDVAR 1
|
||||
|
||||
#define USB_HAVE_UGEN 0
|
||||
#define USB_HAVE_UGEN 1
|
||||
|
||||
#define USB_HAVE_BUSDMA 1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user