mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-16 04:46:27 +08:00
Add USB UGEN support for RTEMS
This commit is contained in:

committed by
Sebastian Huber

parent
3e7de301c1
commit
a7415b7f2f
@@ -804,9 +804,11 @@ usb_fifo_close(struct usb_fifo *f, int fflags)
|
|||||||
}
|
}
|
||||||
/* check if a thread wants SIGIO */
|
/* check if a thread wants SIGIO */
|
||||||
if (f->async_p != NULL) {
|
if (f->async_p != NULL) {
|
||||||
|
#ifndef __rtems__
|
||||||
PROC_LOCK(f->async_p);
|
PROC_LOCK(f->async_p);
|
||||||
kern_psignal(f->async_p, SIGIO);
|
kern_psignal(f->async_p, SIGIO);
|
||||||
PROC_UNLOCK(f->async_p);
|
PROC_UNLOCK(f->async_p);
|
||||||
|
#endif /* __rtems__ */
|
||||||
f->async_p = NULL;
|
f->async_p = NULL;
|
||||||
}
|
}
|
||||||
/* remove FWRITE and FREAD flags */
|
/* remove FWRITE and FREAD flags */
|
||||||
@@ -1025,6 +1027,7 @@ usb_ioctl_f_sub(struct usb_fifo *f, u_long cmd, void *addr,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case FIOASYNC:
|
case FIOASYNC:
|
||||||
|
#ifndef __rtems__
|
||||||
if (*(int *)addr) {
|
if (*(int *)addr) {
|
||||||
if (f->async_p != NULL) {
|
if (f->async_p != NULL) {
|
||||||
error = EBUSY;
|
error = EBUSY;
|
||||||
@@ -1034,6 +1037,9 @@ usb_ioctl_f_sub(struct usb_fifo *f, u_long cmd, void *addr,
|
|||||||
} else {
|
} else {
|
||||||
f->async_p = NULL;
|
f->async_p = NULL;
|
||||||
}
|
}
|
||||||
|
#else /* __rtems__ */
|
||||||
|
f->async_p = NULL;
|
||||||
|
#endif /* __rtems__ */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* XXX this is not the most general solution */
|
/* 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;
|
error = EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifndef __rtems__
|
||||||
if (*(int *)addr != USB_PROC_GET_GID(f->async_p)) {
|
if (*(int *)addr != USB_PROC_GET_GID(f->async_p)) {
|
||||||
error = EPERM;
|
error = EPERM;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return (ENOIOCTL);
|
return (ENOIOCTL);
|
||||||
@@ -1769,11 +1777,13 @@ usb_fifo_wakeup(struct usb_fifo *f)
|
|||||||
selwakeup(&f->selinfo);
|
selwakeup(&f->selinfo);
|
||||||
f->flag_isselect = 0;
|
f->flag_isselect = 0;
|
||||||
}
|
}
|
||||||
|
#ifndef __rtems__
|
||||||
if (f->async_p != NULL) {
|
if (f->async_p != NULL) {
|
||||||
PROC_LOCK(f->async_p);
|
PROC_LOCK(f->async_p);
|
||||||
kern_psignal(f->async_p, SIGIO);
|
kern_psignal(f->async_p, SIGIO);
|
||||||
PROC_UNLOCK(f->async_p);
|
PROC_UNLOCK(f->async_p);
|
||||||
}
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#define USB_HAVE_CONDVAR 1
|
#define USB_HAVE_CONDVAR 1
|
||||||
|
|
||||||
#define USB_HAVE_UGEN 0
|
#define USB_HAVE_UGEN 1
|
||||||
|
|
||||||
#define USB_HAVE_BUSDMA 1
|
#define USB_HAVE_BUSDMA 1
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user