summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_generic.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-02-27 17:27:16 +0000
committerthompsa <thompsa@FreeBSD.org>2009-02-27 17:27:16 +0000
commit1f16c7700d04a735aa3df3ed26ab236e680c21ad (patch)
tree799ccaf32ee5b67a3fd075acab472e59c72735d8 /sys/dev/usb/usb_generic.c
parent03a6b7577d94c2fbc97da1c5539e0bcae374f497 (diff)
downloadFreeBSD-src-1f16c7700d04a735aa3df3ed26ab236e680c21ad.zip
FreeBSD-src-1f16c7700d04a735aa3df3ed26ab236e680c21ad.tar.gz
Change USB over to make_dev() for all device nodes, previously it hooked into
the devfs clone handler to open the (invisible) devices on the fly. The /dev entries are layed out as follows, /dev/usbctl = master device /dev/usb/0.1.0.5 = usb device, (<bus>.<dev>.<iface>.<endpoint>) /dev/ugen0.1 -> usb/0.1.0.0 = ugen link to ctrl endpoint This also removes the custom permissions model from USB. Bump __FreeBSD_version to 800066. Submitted by: rink (earlier version)
Diffstat (limited to 'sys/dev/usb/usb_generic.c')
-rw-r--r--sys/dev/usb/usb_generic.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/sys/dev/usb/usb_generic.c b/sys/dev/usb/usb_generic.c
index 75b985c..49b072c 100644
--- a/sys/dev/usb/usb_generic.c
+++ b/sys/dev/usb/usb_generic.c
@@ -149,7 +149,7 @@ ugen_transfer_setup(struct usb2_fifo *f,
}
static int
-ugen_open(struct usb2_fifo *f, int fflags, struct thread *td)
+ugen_open(struct usb2_fifo *f, int fflags)
{
struct usb2_pipe *pipe = f->priv_sc0;
struct usb2_endpoint_descriptor *ed = pipe->edesc;
@@ -183,7 +183,7 @@ ugen_open(struct usb2_fifo *f, int fflags, struct thread *td)
}
static void
-ugen_close(struct usb2_fifo *f, int fflags, struct thread *td)
+ugen_close(struct usb2_fifo *f, int fflags)
{
DPRINTFN(6, "flag=0x%x\n", fflags);
@@ -872,10 +872,6 @@ ugen_check_request(struct usb2_device *udev, struct usb2_device_request *req)
if (pipe == NULL) {
return (EINVAL);
}
- if (usb2_check_thread_perm(udev, curthread, FREAD | FWRITE,
- pipe->iface_index, req->wIndex[0] & UE_ADDR)) {
- return (EPERM);
- }
if ((req->bRequest == UR_CLEAR_FEATURE) &&
(UGETW(req->wValue) == UF_ENDPOINT_HALT)) {
usb2_clear_data_toggle(udev, pipe);
@@ -1367,8 +1363,7 @@ ugen_fifo_in_use(struct usb2_fifo *f, int fflags)
}
static int
-ugen_ioctl(struct usb2_fifo *f, u_long cmd, void *addr, int fflags,
- struct thread *td)
+ugen_ioctl(struct usb2_fifo *f, u_long cmd, void *addr, int fflags)
{
struct usb2_config usb2_config[1];
struct usb2_device_request req;
@@ -1458,11 +1453,6 @@ ugen_ioctl(struct usb2_fifo *f, u_long cmd, void *addr, int fflags,
}
iface_index = pipe->iface_index;
- error = usb2_check_thread_perm(f->udev, curthread, fflags,
- iface_index, u.popen->ep_no);
- if (error) {
- break;
- }
bzero(usb2_config, sizeof(usb2_config));
usb2_config[0].type = ed->bmAttributes & UE_XFERTYPE;
@@ -1948,8 +1938,7 @@ ugen_iface_ioctl(struct usb2_fifo *f, u_long cmd, void *addr, int fflags)
}
static int
-ugen_ioctl_post(struct usb2_fifo *f, u_long cmd, void *addr, int fflags,
- struct thread *td)
+ugen_ioctl_post(struct usb2_fifo *f, u_long cmd, void *addr, int fflags)
{
union {
struct usb2_interface_descriptor *idesc;
OpenPOWER on IntegriCloud