Lines Matching full:ud

16 	struct usbip_device *ud;  member
22 static void set_event(struct usbip_device *ud, unsigned long event) in set_event() argument
26 spin_lock_irqsave(&ud->lock, flags); in set_event()
27 ud->event |= event; in set_event()
28 spin_unlock_irqrestore(&ud->lock, flags); in set_event()
31 static void unset_event(struct usbip_device *ud, unsigned long event) in unset_event() argument
35 spin_lock_irqsave(&ud->lock, flags); in unset_event()
36 ud->event &= ~event; in unset_event()
37 spin_unlock_irqrestore(&ud->lock, flags); in unset_event()
43 struct usbip_device *ud = NULL; in get_event() local
54 ud = ue->ud; in get_event()
57 return ud; in get_event()
64 struct usbip_device *ud; in event_handler() local
70 while ((ud = get_event()) != NULL) { in event_handler()
71 usbip_dbg_eh("pending event %lx\n", ud->event); in event_handler()
73 mutex_lock(&ud->sysfs_lock); in event_handler()
78 if (ud->event & USBIP_EH_SHUTDOWN) { in event_handler()
79 ud->eh_ops.shutdown(ud); in event_handler()
80 unset_event(ud, USBIP_EH_SHUTDOWN); in event_handler()
84 if (ud->event & USBIP_EH_RESET) { in event_handler()
85 ud->eh_ops.reset(ud); in event_handler()
86 unset_event(ud, USBIP_EH_RESET); in event_handler()
90 if (ud->event & USBIP_EH_UNUSABLE) { in event_handler()
91 ud->eh_ops.unusable(ud); in event_handler()
92 unset_event(ud, USBIP_EH_UNUSABLE); in event_handler()
94 mutex_unlock(&ud->sysfs_lock); in event_handler()
96 wake_up(&ud->eh_waitq); in event_handler()
100 int usbip_start_eh(struct usbip_device *ud) in usbip_start_eh() argument
102 init_waitqueue_head(&ud->eh_waitq); in usbip_start_eh()
103 ud->event = 0; in usbip_start_eh()
108 void usbip_stop_eh(struct usbip_device *ud) in usbip_stop_eh() argument
110 unsigned long pending = ud->event & ~USBIP_EH_BYE; in usbip_stop_eh()
112 if (!(ud->event & USBIP_EH_BYE)) in usbip_stop_eh()
118 wait_event_interruptible(ud->eh_waitq, !(ud->event & ~USBIP_EH_BYE)); in usbip_stop_eh()
144 void usbip_event_add(struct usbip_device *ud, unsigned long event) in usbip_event_add() argument
149 if (ud->event & USBIP_EH_BYE) in usbip_event_add()
152 set_event(ud, event); in usbip_event_add()
157 if (ue->ud == ud) in usbip_event_add()
165 ue->ud = ud; in usbip_event_add()
175 int usbip_event_happened(struct usbip_device *ud) in usbip_event_happened() argument
180 spin_lock_irqsave(&ud->lock, flags); in usbip_event_happened()
181 if (ud->event != 0) in usbip_event_happened()
183 spin_unlock_irqrestore(&ud->lock, flags); in usbip_event_happened()