summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Kirspel <kevin-kirspel@idexx.com>2017-05-17 08:40:29 -0400
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-05-19 07:24:30 +0200
commita7415b7f2fd3ca218459a8edd96e4e6e231f8746 (patch)
tree72d691d428e8b222011cf6fe06bccb3f4281a793
parentAdd FREEBSD USB input device files (diff)
downloadrtems-libbsd-a7415b7f2fd3ca218459a8edd96e4e6e231f8746.tar.bz2
Add USB UGEN support for RTEMS
-rw-r--r--freebsd/sys/dev/usb/usb_dev.c10
-rw-r--r--rtemsbsd/include/rtems/bsd/local/opt_usb.h2
2 files changed, 11 insertions, 1 deletions
diff --git a/freebsd/sys/dev/usb/usb_dev.c b/freebsd/sys/dev/usb/usb_dev.c
index fe249c20..da96a991 100644
--- a/freebsd/sys/dev/usb/usb_dev.c
+++ b/freebsd/sys/dev/usb/usb_dev.c
@@ -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
diff --git a/rtemsbsd/include/rtems/bsd/local/opt_usb.h b/rtemsbsd/include/rtems/bsd/local/opt_usb.h
index 7eb61487..2b7227bd 100644
--- a/rtemsbsd/include/rtems/bsd/local/opt_usb.h
+++ b/rtemsbsd/include/rtems/bsd/local/opt_usb.h
@@ -1,6 +1,6 @@
#define USB_HAVE_CONDVAR 1
-#define USB_HAVE_UGEN 0
+#define USB_HAVE_UGEN 1
#define USB_HAVE_BUSDMA 1