Lines Matching refs:uurb
1583 find_memory_area(struct usb_dev_state *ps, const struct usbdevfs_urb *uurb) in find_memory_area() argument
1587 unsigned long uurb_start = (unsigned long)uurb->buffer; in find_memory_area()
1593 if (uurb->buffer_length > iter->vm_start + iter->size - in find_memory_area()
1607 static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb, in proc_do_submiturb() argument
1629 if (uurb->type == USBDEVFS_URB_TYPE_ISO) in proc_do_submiturb()
1632 if (uurb->flags & ~mask) in proc_do_submiturb()
1635 if ((unsigned int)uurb->buffer_length >= USBFS_XFER_MAX) in proc_do_submiturb()
1637 if (uurb->buffer_length > 0 && !uurb->buffer) in proc_do_submiturb()
1639 if (!(uurb->type == USBDEVFS_URB_TYPE_CONTROL && in proc_do_submiturb()
1640 (uurb->endpoint & ~USB_ENDPOINT_DIR_MASK) == 0)) { in proc_do_submiturb()
1641 ifnum = findintfep(ps->dev, uurb->endpoint); in proc_do_submiturb()
1648 ep = ep_to_host_endpoint(ps->dev, uurb->endpoint); in proc_do_submiturb()
1651 is_in = (uurb->endpoint & USB_ENDPOINT_DIR_MASK) != 0; in proc_do_submiturb()
1654 switch (uurb->type) { in proc_do_submiturb()
1659 if (uurb->buffer_length < 8) in proc_do_submiturb()
1664 if (copy_from_user(dr, uurb->buffer, 8)) { in proc_do_submiturb()
1668 if (uurb->buffer_length < (le16_to_cpu(dr->wLength) + 8)) { in proc_do_submiturb()
1676 uurb->buffer_length = le16_to_cpu(dr->wLength); in proc_do_submiturb()
1677 uurb->buffer += 8; in proc_do_submiturb()
1678 if ((dr->bRequestType & USB_DIR_IN) && uurb->buffer_length) { in proc_do_submiturb()
1680 uurb->endpoint |= USB_DIR_IN; in proc_do_submiturb()
1683 uurb->endpoint &= ~USB_DIR_IN; in proc_do_submiturb()
1708 uurb->type = USBDEVFS_URB_TYPE_INTERRUPT; in proc_do_submiturb()
1711 num_sgs = DIV_ROUND_UP(uurb->buffer_length, USB_SG_SIZE); in proc_do_submiturb()
1715 stream_id = uurb->stream_id; in proc_do_submiturb()
1730 if (uurb->number_of_packets < 1 || in proc_do_submiturb()
1731 uurb->number_of_packets > 128) in proc_do_submiturb()
1735 number_of_packets = uurb->number_of_packets; in proc_do_submiturb()
1756 uurb->buffer_length = totlen; in proc_do_submiturb()
1763 if (uurb->buffer_length > 0 && in proc_do_submiturb()
1764 !access_ok(uurb->buffer, uurb->buffer_length)) { in proc_do_submiturb()
1774 as->usbm = find_memory_area(ps, uurb); in proc_do_submiturb()
1788 (as->usbm ? 0 : uurb->buffer_length) + in proc_do_submiturb()
1806 totlen = uurb->buffer_length; in proc_do_submiturb()
1817 if (copy_from_user(buf, uurb->buffer, u)) { in proc_do_submiturb()
1821 uurb->buffer += u; in proc_do_submiturb()
1825 } else if (uurb->buffer_length > 0) { in proc_do_submiturb()
1827 unsigned long uurb_start = (unsigned long)uurb->buffer; in proc_do_submiturb()
1832 as->urb->transfer_buffer = kmalloc(uurb->buffer_length, in proc_do_submiturb()
1840 uurb->buffer, in proc_do_submiturb()
1841 uurb->buffer_length)) { in proc_do_submiturb()
1845 } else if (uurb->type == USBDEVFS_URB_TYPE_ISO) { in proc_do_submiturb()
1853 uurb->buffer_length); in proc_do_submiturb()
1858 as->urb->pipe = (uurb->type << 30) | in proc_do_submiturb()
1859 __create_pipe(ps->dev, uurb->endpoint & 0xf) | in proc_do_submiturb()
1860 (uurb->endpoint & USB_DIR_IN); in proc_do_submiturb()
1867 if (uurb->flags & USBDEVFS_URB_ISO_ASAP) in proc_do_submiturb()
1869 if (allow_short && uurb->flags & USBDEVFS_URB_SHORT_NOT_OK) in proc_do_submiturb()
1871 if (allow_zero && uurb->flags & USBDEVFS_URB_ZERO_PACKET) in proc_do_submiturb()
1873 if (uurb->flags & USBDEVFS_URB_NO_INTERRUPT) in proc_do_submiturb()
1877 if (!allow_short && uurb->flags & USBDEVFS_URB_SHORT_NOT_OK) in proc_do_submiturb()
1879 if (!allow_zero && uurb->flags & USBDEVFS_URB_ZERO_PACKET) in proc_do_submiturb()
1882 as->urb->transfer_buffer_length = uurb->buffer_length; in proc_do_submiturb()
1885 as->urb->start_frame = uurb->start_frame; in proc_do_submiturb()
1890 if (uurb->type == USBDEVFS_URB_TYPE_ISO || in proc_do_submiturb()
1912 unsigned long uurb_start = (unsigned long)uurb->buffer; in proc_do_submiturb()
1917 } else if (is_in && uurb->buffer_length > 0) in proc_do_submiturb()
1918 as->userbuffer = uurb->buffer; in proc_do_submiturb()
1919 as->signr = uurb->signr; in proc_do_submiturb()
1945 if (uurb->flags & USBDEVFS_URB_BULK_CONTINUATION) in proc_do_submiturb()
1982 struct usbdevfs_urb uurb; in proc_submiturb() local
1985 if (copy_from_user(&uurb, arg, sizeof(uurb))) in proc_submiturb()
1991 return proc_do_submiturb(ps, &uurb, in proc_submiturb()
2166 struct usbdevfs_urb32 __user *uurb) in get_urb32() argument
2169 if (copy_from_user(&urb32, uurb, sizeof(*uurb))) in get_urb32()
2188 struct usbdevfs_urb uurb; in proc_submiturb_compat() local
2191 if (get_urb32(&uurb, (struct usbdevfs_urb32 __user *)arg)) in proc_submiturb_compat()
2197 return proc_do_submiturb(ps, &uurb, in proc_submiturb_compat()