Lines Matching defs:ud

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