Lines Matching refs:urb
18 static int st5481_isoc_flatten(struct urb *urb);
28 static void usb_next_ctrl_msg(struct urb *urb, in usb_next_ctrl_msg() argument
42 urb->setup_packet = in usb_next_ctrl_msg()
46 ((struct ctrl_msg *)urb->setup_packet)->dr.bRequest, in usb_next_ctrl_msg()
47 ((struct ctrl_msg *)urb->setup_packet)->dr.wValue, in usb_next_ctrl_msg()
48 ((struct ctrl_msg *)urb->setup_packet)->dr.wIndex); in usb_next_ctrl_msg()
51 urb->dev = adapter->usb_dev; in usb_next_ctrl_msg()
53 SUBMIT_URB(urb, GFP_ATOMIC); in usb_next_ctrl_msg()
82 usb_next_ctrl_msg(ctrl->urb, adapter); in usb_ctrl_msg()
128 static void usb_ctrl_complete(struct urb *urb) in usb_ctrl_complete() argument
130 struct st5481_adapter *adapter = urb->context; in usb_ctrl_complete()
134 if (unlikely(urb->status < 0)) { in usb_ctrl_complete()
135 switch (urb->status) { in usb_ctrl_complete()
139 DBG(1, "urb killed status %d", urb->status); in usb_ctrl_complete()
142 WARNING("urb status %d", urb->status); in usb_ctrl_complete()
147 ctrl_msg = (struct ctrl_msg *)urb->setup_packet; in usb_ctrl_complete()
161 usb_next_ctrl_msg(urb, adapter); in usb_ctrl_complete()
175 static void usb_int_complete(struct urb *urb) in usb_int_complete() argument
177 u8 *data = urb->transfer_buffer; in usb_int_complete()
179 struct st5481_adapter *adapter = urb->context; in usb_int_complete()
183 switch (urb->status) { in usb_int_complete()
191 DBG(2, "urb shutting down with status: %d", urb->status); in usb_int_complete()
194 WARNING("nonzero urb status received: %d", urb->status); in usb_int_complete()
201 if (urb->actual_length == 0) { in usb_int_complete()
226 urb->actual_length = 0; in usb_int_complete()
229 status = usb_submit_urb(urb, GFP_ATOMIC); in usb_int_complete()
247 struct urb *urb; in st5481_setup_usb() local
280 urb = usb_alloc_urb(0, GFP_KERNEL); in st5481_setup_usb()
281 if (!urb) { in st5481_setup_usb()
284 ctrl->urb = urb; in st5481_setup_usb()
287 usb_fill_control_urb(urb, dev, in st5481_setup_usb()
295 urb = usb_alloc_urb(0, GFP_KERNEL); in st5481_setup_usb()
296 if (!urb) { in st5481_setup_usb()
299 intr->urb = urb; in st5481_setup_usb()
309 usb_fill_int_urb(urb, dev, in st5481_setup_usb()
317 usb_free_urb(intr->urb); in st5481_setup_usb()
318 intr->urb = NULL; in st5481_setup_usb()
320 usb_free_urb(ctrl->urb); in st5481_setup_usb()
321 ctrl->urb = NULL; in st5481_setup_usb()
338 usb_kill_urb(ctrl->urb); in st5481_release_usb()
339 kfree(ctrl->urb->transfer_buffer); in st5481_release_usb()
340 usb_free_urb(ctrl->urb); in st5481_release_usb()
341 ctrl->urb = NULL; in st5481_release_usb()
343 usb_kill_urb(intr->urb); in st5481_release_usb()
344 kfree(intr->urb->transfer_buffer); in st5481_release_usb()
345 usb_free_urb(intr->urb); in st5481_release_usb()
346 intr->urb = NULL; in st5481_release_usb()
380 SUBMIT_URB(intr->urb, GFP_KERNEL); in st5481_start()
404 fill_isoc_urb(struct urb *urb, struct usb_device *dev, in fill_isoc_urb() argument
411 urb->dev = dev; in fill_isoc_urb()
412 urb->pipe = pipe; in fill_isoc_urb()
413 urb->interval = 1; in fill_isoc_urb()
414 urb->transfer_buffer = buf; in fill_isoc_urb()
415 urb->number_of_packets = num_packets; in fill_isoc_urb()
416 urb->transfer_buffer_length = num_packets * packet_size; in fill_isoc_urb()
417 urb->actual_length = 0; in fill_isoc_urb()
418 urb->complete = complete; in fill_isoc_urb()
419 urb->context = context; in fill_isoc_urb()
420 urb->transfer_flags = URB_ISO_ASAP; in fill_isoc_urb()
422 urb->iso_frame_desc[k].offset = packet_size * k; in fill_isoc_urb()
423 urb->iso_frame_desc[k].length = packet_size; in fill_isoc_urb()
424 urb->iso_frame_desc[k].actual_length = 0; in fill_isoc_urb()
429 st5481_setup_isocpipes(struct urb *urb[2], struct usb_device *dev, in st5481_setup_isocpipes()
439 urb[j] = usb_alloc_urb(num_packets, GFP_KERNEL); in st5481_setup_isocpipes()
440 if (!urb[j]) in st5481_setup_isocpipes()
449 fill_isoc_urb(urb[j], dev, pipe, buf, in st5481_setup_isocpipes()
457 if (urb[j]) { in st5481_setup_isocpipes()
458 kfree(urb[j]->transfer_buffer); in st5481_setup_isocpipes()
459 urb[j]->transfer_buffer = NULL; in st5481_setup_isocpipes()
460 usb_free_urb(urb[j]); in st5481_setup_isocpipes()
461 urb[j] = NULL; in st5481_setup_isocpipes()
467 void st5481_release_isocpipes(struct urb *urb[2]) in st5481_release_isocpipes()
472 usb_kill_urb(urb[j]); in st5481_release_isocpipes()
473 kfree(urb[j]->transfer_buffer); in st5481_release_isocpipes()
474 usb_free_urb(urb[j]); in st5481_release_isocpipes()
475 urb[j] = NULL; in st5481_release_isocpipes()
486 static void usb_in_complete(struct urb *urb) in usb_in_complete() argument
488 struct st5481_in *in = urb->context; in usb_in_complete()
493 if (unlikely(urb->status < 0)) { in usb_in_complete()
494 switch (urb->status) { in usb_in_complete()
498 DBG(1, "urb killed status %d", urb->status); in usb_in_complete()
501 WARNING("urb status %d", urb->status); in usb_in_complete()
506 DBG_ISO_PACKET(0x80, urb); in usb_in_complete()
508 len = st5481_isoc_flatten(urb); in usb_in_complete()
509 ptr = urb->transfer_buffer; in usb_in_complete()
542 urb->dev = in->adapter->usb_dev; in usb_in_complete()
543 urb->actual_length = 0; in usb_in_complete()
545 SUBMIT_URB(urb, GFP_ATOMIC); in usb_in_complete()
560 retval = st5481_setup_isocpipes(in->urb, dev, in st5481_setup_in()
579 st5481_release_isocpipes(in->urb); in st5481_release_in()
586 static int st5481_isoc_flatten(struct urb *urb) in st5481_isoc_flatten() argument
592 if (urb->status < 0) { in st5481_isoc_flatten()
593 return urb->status; in st5481_isoc_flatten()
595 for (pipd = &urb->iso_frame_desc[0], in st5481_isoc_flatten()
596 pend = &urb->iso_frame_desc[urb->number_of_packets], in st5481_isoc_flatten()
597 dst = urb->transfer_buffer; in st5481_isoc_flatten()
607 src = urb->transfer_buffer + pipd->offset; in st5481_isoc_flatten()
620 return (dst - (unsigned char *)urb->transfer_buffer); in st5481_isoc_flatten()
630 in->urb[0]->dev = adapter->usb_dev; in st5481_start_rcv()
631 SUBMIT_URB(in->urb[0], GFP_KERNEL); in st5481_start_rcv()
633 in->urb[1]->dev = adapter->usb_dev; in st5481_start_rcv()
634 SUBMIT_URB(in->urb[1], GFP_KERNEL); in st5481_start_rcv()
644 usb_unlink_urb(in->urb[0]); in st5481_in_mode()
645 usb_unlink_urb(in->urb[1]); in st5481_in_mode()