Lines Matching refs:urb
47 static bool keep_urb; /* keep urb buffers allocated */
116 struct urb *urb)
118 struct tm6000_dmaqueue *dma_q = urb->context;
144 /* from last urb or packet */
284 struct urb *urb)
286 struct tm6000_dmaqueue *dma_q = urb->context;
367 * Controls the isoc copy of each urb packet
369 static inline int tm6000_isoc_copy(struct urb *urb)
371 struct tm6000_dmaqueue *dma_q = urb->context;
376 if (urb->status < 0) {
377 print_err_status(dev, -1, urb->status);
381 for (i = 0; i < urb->number_of_packets; i++) {
382 status = urb->iso_frame_desc[i].status;
389 len = urb->iso_frame_desc[i].actual_length;
392 p = urb->transfer_buffer + urb->iso_frame_desc[i].offset;
393 if (!urb->iso_frame_desc[i].status) {
395 rc = copy_multiplexed(p, len, urb);
399 copy_streams(p, len, urb);
415 static void tm6000_irq_callback(struct urb *urb)
417 struct tm6000_dmaqueue *dma_q = urb->context;
422 switch (urb->status) {
433 tm6000_err("urb completion error %d.\n", urb->status);
438 tm6000_isoc_copy(urb);
441 /* Reset urb buffers */
442 for (i = 0; i < urb->number_of_packets; i++) {
443 urb->iso_frame_desc[i].status = 0;
444 urb->iso_frame_desc[i].actual_length = 0;
447 urb->status = usb_submit_urb(urb, GFP_ATOMIC);
448 if (urb->status)
449 tm6000_err("urb resubmit failed (error=%i)\n",
450 urb->status);
521 struct urb *urb;
526 urb = dev->isoc_ctl.urb[i];
527 if (urb) {
528 usb_kill_urb(urb);
529 usb_unlink_urb(urb);
530 usb_free_urb(urb);
531 dev->isoc_ctl.urb[i] = NULL;
539 kfree(dev->isoc_ctl.urb);
542 dev->isoc_ctl.urb = NULL;
555 struct urb *urb;
586 dev->isoc_ctl.urb = kmalloc_array(num_bufs, sizeof(void *),
588 if (!dev->isoc_ctl.urb)
595 kfree(dev->isoc_ctl.urb);
605 tm6000_err("cannot allocate memory for urb buffers\n");
609 kfree(dev->isoc_ctl.urb);
616 urb = usb_alloc_urb(max_packets, GFP_KERNEL);
617 if (!urb) {
622 dev->isoc_ctl.urb[i] = urb;
624 urb->transfer_dma = dev->urb_dma[i];
627 usb_fill_bulk_urb(urb, dev->udev, pipe,
630 urb->interval = dev->isoc_in.endp->desc.bInterval;
631 urb->number_of_packets = max_packets;
632 urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP;
635 urb->iso_frame_desc[j].offset = size * j;
636 urb->iso_frame_desc[j].length = size;
655 int rc = usb_submit_urb(dev->isoc_ctl.urb[i], GFP_ATOMIC);
657 tm6000_err("submit of urb %i failed (error=%i)\n", i,
1707 MODULE_PARM_DESC(keep_urb, "Keep urb buffers allocated even when the device is closed by the user");