Lines Matching refs:desc
116 struct wdm_device *desc; in wdm_find_device() local
119 list_for_each_entry(desc, &wdm_device_list, device_list) in wdm_find_device()
120 if (desc->intf == intf) in wdm_find_device()
122 desc = NULL; in wdm_find_device()
126 return desc; in wdm_find_device()
131 struct wdm_device *desc; in wdm_find_device_by_minor() local
134 list_for_each_entry(desc, &wdm_device_list, device_list) in wdm_find_device_by_minor()
135 if (desc->intf->minor == minor) in wdm_find_device_by_minor()
137 desc = NULL; in wdm_find_device_by_minor()
141 return desc; in wdm_find_device_by_minor()
147 struct wdm_device *desc; in wdm_out_callback() local
150 desc = urb->context; in wdm_out_callback()
151 spin_lock_irqsave(&desc->iuspin, flags); in wdm_out_callback()
152 desc->werr = urb->status; in wdm_out_callback()
153 spin_unlock_irqrestore(&desc->iuspin, flags); in wdm_out_callback()
154 kfree(desc->outbuf); in wdm_out_callback()
155 desc->outbuf = NULL; in wdm_out_callback()
156 clear_bit(WDM_IN_USE, &desc->flags); in wdm_out_callback()
157 wake_up_all(&desc->wait); in wdm_out_callback()
163 struct wdm_device *desc = urb->context; in wdm_in_callback() local
167 spin_lock_irqsave(&desc->iuspin, flags); in wdm_in_callback()
168 clear_bit(WDM_RESPONDING, &desc->flags); in wdm_in_callback()
173 dev_dbg(&desc->intf->dev, in wdm_in_callback()
177 dev_dbg(&desc->intf->dev, in wdm_in_callback()
181 dev_dbg(&desc->intf->dev, in wdm_in_callback()
185 dev_err(&desc->intf->dev, in wdm_in_callback()
189 dev_err(&desc->intf->dev, in wdm_in_callback()
201 if (desc->rerr == 0 && status != -EPIPE) in wdm_in_callback()
202 desc->rerr = status; in wdm_in_callback()
204 if (length + desc->length > desc->wMaxCommand) { in wdm_in_callback()
206 set_bit(WDM_OVERFLOW, &desc->flags); in wdm_in_callback()
209 if (!test_bit(WDM_OVERFLOW, &desc->flags)) { in wdm_in_callback()
210 memmove(desc->ubuf + desc->length, desc->inbuf, length); in wdm_in_callback()
211 desc->length += length; in wdm_in_callback()
212 desc->reslength = length; in wdm_in_callback()
217 if (desc->rerr) { in wdm_in_callback()
224 schedule_work(&desc->service_outs_intr); in wdm_in_callback()
226 set_bit(WDM_READ, &desc->flags); in wdm_in_callback()
227 wake_up(&desc->wait); in wdm_in_callback()
229 spin_unlock_irqrestore(&desc->iuspin, flags); in wdm_in_callback()
238 struct wdm_device *desc; in wdm_int_callback() local
241 desc = urb->context; in wdm_int_callback()
242 dr = (struct usb_cdc_notification *)desc->sbuf; in wdm_int_callback()
251 set_bit(WDM_INT_STALL, &desc->flags); in wdm_int_callback()
252 dev_err(&desc->intf->dev, "Stall on int endpoint\n"); in wdm_int_callback()
255 dev_err(&desc->intf->dev, in wdm_int_callback()
262 dev_err(&desc->intf->dev, "wdm_int_callback - %d bytes\n", in wdm_int_callback()
269 dev_dbg(&desc->intf->dev, in wdm_int_callback()
276 dev_dbg(&desc->intf->dev, in wdm_int_callback()
281 dev_dbg(&desc->intf->dev, "SPEED_CHANGE received (len %u)\n", in wdm_int_callback()
285 clear_bit(WDM_POLL_RUNNING, &desc->flags); in wdm_int_callback()
286 dev_err(&desc->intf->dev, in wdm_int_callback()
294 spin_lock_irqsave(&desc->iuspin, flags); in wdm_int_callback()
295 responding = test_and_set_bit(WDM_RESPONDING, &desc->flags); in wdm_int_callback()
296 if (!desc->resp_count++ && !responding in wdm_int_callback()
297 && !test_bit(WDM_DISCONNECTING, &desc->flags) in wdm_int_callback()
298 && !test_bit(WDM_SUSPENDING, &desc->flags)) { in wdm_int_callback()
299 rv = usb_submit_urb(desc->response, GFP_ATOMIC); in wdm_int_callback()
300 dev_dbg(&desc->intf->dev, "submit response URB %d\n", rv); in wdm_int_callback()
302 spin_unlock_irqrestore(&desc->iuspin, flags); in wdm_int_callback()
304 clear_bit(WDM_RESPONDING, &desc->flags); in wdm_int_callback()
309 rv = schedule_work(&desc->rxwork); in wdm_int_callback()
311 dev_err(&desc->intf->dev, in wdm_int_callback()
318 dev_err(&desc->intf->dev, in wdm_int_callback()
324 static void poison_urbs(struct wdm_device *desc) in poison_urbs() argument
327 usb_poison_urb(desc->command); in poison_urbs()
328 usb_poison_urb(desc->validity); in poison_urbs()
329 usb_poison_urb(desc->response); in poison_urbs()
332 static void unpoison_urbs(struct wdm_device *desc) in unpoison_urbs() argument
338 usb_unpoison_urb(desc->response); in unpoison_urbs()
339 usb_unpoison_urb(desc->validity); in unpoison_urbs()
340 usb_unpoison_urb(desc->command); in unpoison_urbs()
343 static void free_urbs(struct wdm_device *desc) in free_urbs() argument
345 usb_free_urb(desc->validity); in free_urbs()
346 usb_free_urb(desc->response); in free_urbs()
347 usb_free_urb(desc->command); in free_urbs()
350 static void cleanup(struct wdm_device *desc) in cleanup() argument
352 kfree(desc->sbuf); in cleanup()
353 kfree(desc->inbuf); in cleanup()
354 kfree(desc->orq); in cleanup()
355 kfree(desc->irq); in cleanup()
356 kfree(desc->ubuf); in cleanup()
357 free_urbs(desc); in cleanup()
358 kfree(desc); in cleanup()
366 struct wdm_device *desc = file->private_data; in wdm_write() local
369 if (count > desc->wMaxCommand) in wdm_write()
370 count = desc->wMaxCommand; in wdm_write()
372 spin_lock_irq(&desc->iuspin); in wdm_write()
373 we = desc->werr; in wdm_write()
374 desc->werr = 0; in wdm_write()
375 spin_unlock_irq(&desc->iuspin); in wdm_write()
384 r = mutex_lock_interruptible(&desc->wlock); in wdm_write()
389 if (test_bit(WDM_DISCONNECTING, &desc->flags)) { in wdm_write()
394 r = usb_autopm_get_interface(desc->intf); in wdm_write()
401 r = wait_event_interruptible(desc->wait, !test_bit(WDM_IN_USE, in wdm_write()
402 &desc->flags)); in wdm_write()
404 if (test_bit(WDM_IN_USE, &desc->flags)) in wdm_write()
407 if (test_bit(WDM_RESETTING, &desc->flags)) in wdm_write()
410 if (test_bit(WDM_DISCONNECTING, &desc->flags)) in wdm_write()
418 req = desc->orq; in wdm_write()
420 desc->command, in wdm_write()
421 interface_to_usbdev(desc->intf), in wdm_write()
423 usb_sndctrlpipe(interface_to_usbdev(desc->intf), 0), in wdm_write()
428 desc in wdm_write()
435 req->wIndex = desc->inum; /* already converted */ in wdm_write()
437 set_bit(WDM_IN_USE, &desc->flags); in wdm_write()
438 desc->outbuf = buf; in wdm_write()
440 rv = usb_submit_urb(desc->command, GFP_KERNEL); in wdm_write()
442 desc->outbuf = NULL; in wdm_write()
443 clear_bit(WDM_IN_USE, &desc->flags); in wdm_write()
444 wake_up_all(&desc->wait); /* for wdm_wait_for_response() */ in wdm_write()
445 dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv); in wdm_write()
449 dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d\n", in wdm_write()
453 usb_autopm_put_interface(desc->intf); in wdm_write()
454 mutex_unlock(&desc->wlock); in wdm_write()
458 usb_autopm_put_interface(desc->intf); in wdm_write()
460 mutex_unlock(&desc->wlock); in wdm_write()
471 static int service_outstanding_interrupt(struct wdm_device *desc) in service_outstanding_interrupt() argument
476 if (!desc->resp_count || !--desc->resp_count) in service_outstanding_interrupt()
479 if (test_bit(WDM_DISCONNECTING, &desc->flags)) { in service_outstanding_interrupt()
483 if (test_bit(WDM_RESETTING, &desc->flags)) { in service_outstanding_interrupt()
488 set_bit(WDM_RESPONDING, &desc->flags); in service_outstanding_interrupt()
489 spin_unlock_irq(&desc->iuspin); in service_outstanding_interrupt()
490 rv = usb_submit_urb(desc->response, GFP_KERNEL); in service_outstanding_interrupt()
491 spin_lock_irq(&desc->iuspin); in service_outstanding_interrupt()
493 if (!test_bit(WDM_DISCONNECTING, &desc->flags)) in service_outstanding_interrupt()
494 dev_err(&desc->intf->dev, in service_outstanding_interrupt()
498 clear_bit(WDM_RESPONDING, &desc->flags); in service_outstanding_interrupt()
499 desc->resp_count = 0; in service_outstanding_interrupt()
510 struct wdm_device *desc = file->private_data; in wdm_read() local
513 rv = mutex_lock_interruptible(&desc->rlock); /*concurrent reads */ in wdm_read()
517 cntr = READ_ONCE(desc->length); in wdm_read()
519 desc->read = 0; in wdm_read()
521 if (test_bit(WDM_DISCONNECTING, &desc->flags)) { in wdm_read()
525 if (test_bit(WDM_OVERFLOW, &desc->flags)) { in wdm_read()
526 clear_bit(WDM_OVERFLOW, &desc->flags); in wdm_read()
532 if (!test_bit(WDM_READ, &desc->flags)) { in wdm_read()
538 rv = wait_event_interruptible(desc->wait, in wdm_read()
539 test_bit(WDM_READ, &desc->flags)); in wdm_read()
543 if (test_bit(WDM_DISCONNECTING, &desc->flags)) { in wdm_read()
547 if (test_bit(WDM_RESETTING, &desc->flags)) { in wdm_read()
551 usb_mark_last_busy(interface_to_usbdev(desc->intf)); in wdm_read()
557 spin_lock_irq(&desc->iuspin); in wdm_read()
559 if (desc->rerr) { /* read completed, error happened */ in wdm_read()
560 rv = usb_translate_errors(desc->rerr); in wdm_read()
561 desc->rerr = 0; in wdm_read()
562 spin_unlock_irq(&desc->iuspin); in wdm_read()
569 if (!test_bit(WDM_READ, &desc->flags)) { /* lost race */ in wdm_read()
570 spin_unlock_irq(&desc->iuspin); in wdm_read()
574 if (!desc->reslength) { /* zero length read */ in wdm_read()
575 dev_dbg(&desc->intf->dev, "zero length - clearing WDM_READ\n"); in wdm_read()
576 clear_bit(WDM_READ, &desc->flags); in wdm_read()
577 rv = service_outstanding_interrupt(desc); in wdm_read()
578 spin_unlock_irq(&desc->iuspin); in wdm_read()
583 cntr = desc->length; in wdm_read()
584 spin_unlock_irq(&desc->iuspin); in wdm_read()
589 rv = copy_to_user(buffer, desc->ubuf, cntr); in wdm_read()
595 spin_lock_irq(&desc->iuspin); in wdm_read()
597 for (i = 0; i < desc->length - cntr; i++) in wdm_read()
598 desc->ubuf[i] = desc->ubuf[i + cntr]; in wdm_read()
600 desc->length -= cntr; in wdm_read()
602 if (!desc->length) { in wdm_read()
603 clear_bit(WDM_READ, &desc->flags); in wdm_read()
604 service_outstanding_interrupt(desc); in wdm_read()
606 spin_unlock_irq(&desc->iuspin); in wdm_read()
610 mutex_unlock(&desc->rlock); in wdm_read()
616 struct wdm_device *desc = file->private_data; in wdm_wait_for_response() local
623 rv = wait_event_interruptible_timeout(desc->wait, in wdm_wait_for_response()
624 !test_bit(WDM_IN_USE, &desc->flags) || in wdm_wait_for_response()
625 test_bit(WDM_DISCONNECTING, &desc->flags), in wdm_wait_for_response()
632 if (test_bit(WDM_DISCONNECTING, &desc->flags)) in wdm_wait_for_response()
639 spin_lock_irq(&desc->iuspin); in wdm_wait_for_response()
640 rv = desc->werr; in wdm_wait_for_response()
641 desc->werr = 0; in wdm_wait_for_response()
642 spin_unlock_irq(&desc->iuspin); in wdm_wait_for_response()
670 struct wdm_device *desc = file->private_data; in wdm_poll() local
674 spin_lock_irqsave(&desc->iuspin, flags); in wdm_poll()
675 if (test_bit(WDM_DISCONNECTING, &desc->flags)) { in wdm_poll()
677 spin_unlock_irqrestore(&desc->iuspin, flags); in wdm_poll()
680 if (test_bit(WDM_READ, &desc->flags)) in wdm_poll()
682 if (desc->rerr || desc->werr) in wdm_poll()
684 if (!test_bit(WDM_IN_USE, &desc->flags)) in wdm_poll()
686 spin_unlock_irqrestore(&desc->iuspin, flags); in wdm_poll()
688 poll_wait(file, &desc->wait, wait); in wdm_poll()
699 struct wdm_device *desc; in wdm_open() local
702 desc = wdm_find_device_by_minor(minor); in wdm_open()
703 if (!desc) in wdm_open()
706 intf = desc->intf; in wdm_open()
707 if (test_bit(WDM_DISCONNECTING, &desc->flags)) in wdm_open()
709 file->private_data = desc; in wdm_open()
711 rv = usb_autopm_get_interface(desc->intf); in wdm_open()
713 dev_err(&desc->intf->dev, "Error autopm - %d\n", rv); in wdm_open()
718 mutex_lock(&desc->wlock); in wdm_open()
719 if (!desc->count++) { in wdm_open()
720 desc->werr = 0; in wdm_open()
721 desc->rerr = 0; in wdm_open()
722 rv = usb_submit_urb(desc->validity, GFP_KERNEL); in wdm_open()
724 desc->count--; in wdm_open()
725 dev_err(&desc->intf->dev, in wdm_open()
732 mutex_unlock(&desc->wlock); in wdm_open()
733 if (desc->count == 1) in wdm_open()
734 desc->manage_power(intf, 1); in wdm_open()
735 usb_autopm_put_interface(desc->intf); in wdm_open()
743 struct wdm_device *desc = file->private_data; in wdm_release() local
748 mutex_lock(&desc->wlock); in wdm_release()
749 desc->count--; in wdm_release()
750 mutex_unlock(&desc->wlock); in wdm_release()
752 if (!desc->count) { in wdm_release()
753 if (!test_bit(WDM_DISCONNECTING, &desc->flags)) { in wdm_release()
754 dev_dbg(&desc->intf->dev, "wdm_release: cleanup\n"); in wdm_release()
755 poison_urbs(desc); in wdm_release()
756 spin_lock_irq(&desc->iuspin); in wdm_release()
757 desc->resp_count = 0; in wdm_release()
758 clear_bit(WDM_RESPONDING, &desc->flags); in wdm_release()
759 spin_unlock_irq(&desc->iuspin); in wdm_release()
760 desc->manage_power(desc->intf, 0); in wdm_release()
761 unpoison_urbs(desc); in wdm_release()
765 cleanup(desc); in wdm_release()
774 struct wdm_device *desc = file->private_data; in wdm_ioctl() local
779 if (copy_to_user((void __user *)arg, &desc->wMaxCommand, sizeof(desc->wMaxCommand))) in wdm_ioctl()
811 struct wdm_device *desc = container_of(work, struct wdm_device, rxwork); in wdm_rxwork() local
816 spin_lock_irqsave(&desc->iuspin, flags); in wdm_rxwork()
817 if (test_bit(WDM_DISCONNECTING, &desc->flags)) { in wdm_rxwork()
818 spin_unlock_irqrestore(&desc->iuspin, flags); in wdm_rxwork()
820 responding = test_and_set_bit(WDM_RESPONDING, &desc->flags); in wdm_rxwork()
821 spin_unlock_irqrestore(&desc->iuspin, flags); in wdm_rxwork()
823 rv = usb_submit_urb(desc->response, GFP_KERNEL); in wdm_rxwork()
825 spin_lock_irqsave(&desc->iuspin, flags); in wdm_rxwork()
826 clear_bit(WDM_RESPONDING, &desc->flags); in wdm_rxwork()
827 if (!test_bit(WDM_DISCONNECTING, &desc->flags)) in wdm_rxwork()
828 schedule_work(&desc->rxwork); in wdm_rxwork()
829 spin_unlock_irqrestore(&desc->iuspin, flags); in wdm_rxwork()
836 struct wdm_device *desc; in service_interrupt_work() local
838 desc = container_of(work, struct wdm_device, service_outs_intr); in service_interrupt_work()
840 spin_lock_irq(&desc->iuspin); in service_interrupt_work()
841 service_outstanding_interrupt(desc); in service_interrupt_work()
842 if (!desc->resp_count) { in service_interrupt_work()
843 set_bit(WDM_READ, &desc->flags); in service_interrupt_work()
844 wake_up(&desc->wait); in service_interrupt_work()
846 spin_unlock_irq(&desc->iuspin); in service_interrupt_work()
855 struct wdm_device *desc; in wdm_create() local
857 desc = kzalloc(sizeof(struct wdm_device), GFP_KERNEL); in wdm_create()
858 if (!desc) in wdm_create()
860 INIT_LIST_HEAD(&desc->device_list); in wdm_create()
861 mutex_init(&desc->rlock); in wdm_create()
862 mutex_init(&desc->wlock); in wdm_create()
863 spin_lock_init(&desc->iuspin); in wdm_create()
864 init_waitqueue_head(&desc->wait); in wdm_create()
865 desc->wMaxCommand = bufsize; in wdm_create()
867 desc->inum = cpu_to_le16((u16)intf->cur_altsetting->desc.bInterfaceNumber); in wdm_create()
868 desc->intf = intf; in wdm_create()
869 INIT_WORK(&desc->rxwork, wdm_rxwork); in wdm_create()
870 INIT_WORK(&desc->service_outs_intr, service_interrupt_work); in wdm_create()
876 desc->wMaxPacketSize = usb_endpoint_maxp(ep); in wdm_create()
878 desc->orq = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL); in wdm_create()
879 if (!desc->orq) in wdm_create()
881 desc->irq = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL); in wdm_create()
882 if (!desc->irq) in wdm_create()
885 desc->validity = usb_alloc_urb(0, GFP_KERNEL); in wdm_create()
886 if (!desc->validity) in wdm_create()
889 desc->response = usb_alloc_urb(0, GFP_KERNEL); in wdm_create()
890 if (!desc->response) in wdm_create()
893 desc->command = usb_alloc_urb(0, GFP_KERNEL); in wdm_create()
894 if (!desc->command) in wdm_create()
897 desc->ubuf = kmalloc(desc->wMaxCommand, GFP_KERNEL); in wdm_create()
898 if (!desc->ubuf) in wdm_create()
901 desc->sbuf = kmalloc(desc->wMaxPacketSize, GFP_KERNEL); in wdm_create()
902 if (!desc->sbuf) in wdm_create()
905 desc->inbuf = kmalloc(desc->wMaxCommand, GFP_KERNEL); in wdm_create()
906 if (!desc->inbuf) in wdm_create()
910 desc->validity, in wdm_create()
913 desc->sbuf, in wdm_create()
914 desc->wMaxPacketSize, in wdm_create()
916 desc, in wdm_create()
920 desc->irq->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE); in wdm_create()
921 desc->irq->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE; in wdm_create()
922 desc->irq->wValue = 0; in wdm_create()
923 desc->irq->wIndex = desc->inum; /* already converted */ in wdm_create()
924 desc->irq->wLength = cpu_to_le16(desc->wMaxCommand); in wdm_create()
927 desc->response, in wdm_create()
930 usb_rcvctrlpipe(interface_to_usbdev(desc->intf), 0), in wdm_create()
931 (unsigned char *)desc->irq, in wdm_create()
932 desc->inbuf, in wdm_create()
933 desc->wMaxCommand, in wdm_create()
935 desc in wdm_create()
938 desc->manage_power = manage_power; in wdm_create()
941 list_add(&desc->device_list, &wdm_device_list); in wdm_create()
953 list_del(&desc->device_list); in wdm_create()
955 cleanup(desc); in wdm_create()
989 if (iface->desc.bNumEndpoints != 1) in wdm_probe()
991 ep = &iface->endpoint[0].desc; in wdm_probe()
1038 struct wdm_device *desc; in wdm_disconnect() local
1042 desc = wdm_find_device(intf); in wdm_disconnect()
1046 spin_lock_irqsave(&desc->iuspin, flags); in wdm_disconnect()
1047 set_bit(WDM_DISCONNECTING, &desc->flags); in wdm_disconnect()
1048 set_bit(WDM_READ, &desc->flags); in wdm_disconnect()
1049 spin_unlock_irqrestore(&desc->iuspin, flags); in wdm_disconnect()
1050 wake_up_all(&desc->wait); in wdm_disconnect()
1051 mutex_lock(&desc->rlock); in wdm_disconnect()
1052 mutex_lock(&desc->wlock); in wdm_disconnect()
1053 poison_urbs(desc); in wdm_disconnect()
1054 cancel_work_sync(&desc->rxwork); in wdm_disconnect()
1055 cancel_work_sync(&desc->service_outs_intr); in wdm_disconnect()
1056 mutex_unlock(&desc->wlock); in wdm_disconnect()
1057 mutex_unlock(&desc->rlock); in wdm_disconnect()
1061 list_del(&desc->device_list); in wdm_disconnect()
1064 if (!desc->count) in wdm_disconnect()
1065 cleanup(desc); in wdm_disconnect()
1067 dev_dbg(&intf->dev, "%d open files - postponing cleanup\n", desc->count); in wdm_disconnect()
1074 struct wdm_device *desc = wdm_find_device(intf); in wdm_suspend() local
1077 dev_dbg(&desc->intf->dev, "wdm%d_suspend\n", intf->minor); in wdm_suspend()
1081 mutex_lock(&desc->rlock); in wdm_suspend()
1082 mutex_lock(&desc->wlock); in wdm_suspend()
1084 spin_lock_irq(&desc->iuspin); in wdm_suspend()
1087 (test_bit(WDM_IN_USE, &desc->flags) in wdm_suspend()
1088 || test_bit(WDM_RESPONDING, &desc->flags))) { in wdm_suspend()
1089 spin_unlock_irq(&desc->iuspin); in wdm_suspend()
1093 set_bit(WDM_SUSPENDING, &desc->flags); in wdm_suspend()
1094 spin_unlock_irq(&desc->iuspin); in wdm_suspend()
1096 poison_urbs(desc); in wdm_suspend()
1097 cancel_work_sync(&desc->rxwork); in wdm_suspend()
1098 cancel_work_sync(&desc->service_outs_intr); in wdm_suspend()
1099 unpoison_urbs(desc); in wdm_suspend()
1102 mutex_unlock(&desc->wlock); in wdm_suspend()
1103 mutex_unlock(&desc->rlock); in wdm_suspend()
1110 static int recover_from_urb_loss(struct wdm_device *desc) in recover_from_urb_loss() argument
1114 if (desc->count) { in recover_from_urb_loss()
1115 rv = usb_submit_urb(desc->validity, GFP_NOIO); in recover_from_urb_loss()
1117 dev_err(&desc->intf->dev, in recover_from_urb_loss()
1126 struct wdm_device *desc = wdm_find_device(intf); in wdm_resume() local
1129 dev_dbg(&desc->intf->dev, "wdm%d_resume\n", intf->minor); in wdm_resume()
1131 clear_bit(WDM_SUSPENDING, &desc->flags); in wdm_resume()
1132 rv = recover_from_urb_loss(desc); in wdm_resume()
1140 struct wdm_device *desc = wdm_find_device(intf); in wdm_pre_reset() local
1148 spin_lock_irq(&desc->iuspin); in wdm_pre_reset()
1149 set_bit(WDM_RESETTING, &desc->flags); /* inform read/write */ in wdm_pre_reset()
1150 set_bit(WDM_READ, &desc->flags); /* unblock read */ in wdm_pre_reset()
1151 clear_bit(WDM_IN_USE, &desc->flags); /* unblock write */ in wdm_pre_reset()
1152 desc->rerr = -EINTR; in wdm_pre_reset()
1153 spin_unlock_irq(&desc->iuspin); in wdm_pre_reset()
1154 wake_up_all(&desc->wait); in wdm_pre_reset()
1155 mutex_lock(&desc->rlock); in wdm_pre_reset()
1156 mutex_lock(&desc->wlock); in wdm_pre_reset()
1157 poison_urbs(desc); in wdm_pre_reset()
1158 cancel_work_sync(&desc->rxwork); in wdm_pre_reset()
1159 cancel_work_sync(&desc->service_outs_intr); in wdm_pre_reset()
1165 struct wdm_device *desc = wdm_find_device(intf); in wdm_post_reset() local
1168 unpoison_urbs(desc); in wdm_post_reset()
1169 clear_bit(WDM_OVERFLOW, &desc->flags); in wdm_post_reset()
1170 clear_bit(WDM_RESETTING, &desc->flags); in wdm_post_reset()
1171 rv = recover_from_urb_loss(desc); in wdm_post_reset()
1172 mutex_unlock(&desc->wlock); in wdm_post_reset()
1173 mutex_unlock(&desc->rlock); in wdm_post_reset()