Lines Matching refs:udc

23 int get_gadget_descs(struct vudc *udc)  in get_gadget_descs()  argument
26 struct vep *ep0 = to_vep(udc->gadget.ep0); in get_gadget_descs()
27 struct usb_device_descriptor *ddesc = &udc->dev_desc; in get_gadget_descs()
31 if (!udc->driver || !udc->pullup) in get_gadget_descs()
40 spin_unlock(&udc->lock); in get_gadget_descs()
41 ret = udc->driver->setup(&(udc->gadget), &req); in get_gadget_descs()
42 spin_lock(&udc->lock); in get_gadget_descs()
56 udc->desc_cached = 1; in get_gadget_descs()
74 struct vudc *udc = (struct vudc *)dev_get_drvdata(dev); in dev_desc_read() local
75 char *desc_ptr = (char *) &udc->dev_desc; in dev_desc_read()
79 spin_lock_irqsave(&udc->lock, flags); in dev_desc_read()
80 if (!udc->desc_cached) { in dev_desc_read()
88 spin_unlock_irqrestore(&udc->lock, flags); in dev_desc_read()
97 struct vudc *udc = (struct vudc *) dev_get_drvdata(dev); in usbip_sockfd_store() local
111 if (!udc) { in usbip_sockfd_store()
115 mutex_lock(&udc->ud.sysfs_lock); in usbip_sockfd_store()
116 spin_lock_irqsave(&udc->lock, flags); in usbip_sockfd_store()
118 if (!udc->driver || !udc->pullup) { in usbip_sockfd_store()
125 if (udc->connected) { in usbip_sockfd_store()
131 spin_lock(&udc->ud.lock); in usbip_sockfd_store()
133 if (udc->ud.status != SDEV_ST_AVAILABLE) { in usbip_sockfd_store()
153 spin_unlock(&udc->ud.lock); in usbip_sockfd_store()
154 spin_unlock_irqrestore(&udc->lock, flags); in usbip_sockfd_store()
156 tcp_rx = kthread_create(&v_rx_loop, &udc->ud, "vudc_rx"); in usbip_sockfd_store()
159 mutex_unlock(&udc->ud.sysfs_lock); in usbip_sockfd_store()
162 tcp_tx = kthread_create(&v_tx_loop, &udc->ud, "vudc_tx"); in usbip_sockfd_store()
166 mutex_unlock(&udc->ud.sysfs_lock); in usbip_sockfd_store()
175 spin_lock_irqsave(&udc->lock, flags); in usbip_sockfd_store()
176 spin_lock(&udc->ud.lock); in usbip_sockfd_store()
178 udc->ud.tcp_socket = socket; in usbip_sockfd_store()
179 udc->ud.tcp_rx = tcp_rx; in usbip_sockfd_store()
180 udc->ud.tcp_tx = tcp_tx; in usbip_sockfd_store()
181 udc->ud.status = SDEV_ST_USED; in usbip_sockfd_store()
183 spin_unlock(&udc->ud.lock); in usbip_sockfd_store()
185 ktime_get_ts64(&udc->start_time); in usbip_sockfd_store()
186 v_start_timer(udc); in usbip_sockfd_store()
187 udc->connected = 1; in usbip_sockfd_store()
189 spin_unlock_irqrestore(&udc->lock, flags); in usbip_sockfd_store()
191 wake_up_process(udc->ud.tcp_rx); in usbip_sockfd_store()
192 wake_up_process(udc->ud.tcp_tx); in usbip_sockfd_store()
194 mutex_unlock(&udc->ud.sysfs_lock); in usbip_sockfd_store()
198 if (!udc->connected) { in usbip_sockfd_store()
204 spin_lock(&udc->ud.lock); in usbip_sockfd_store()
205 if (udc->ud.status != SDEV_ST_USED) { in usbip_sockfd_store()
209 spin_unlock(&udc->ud.lock); in usbip_sockfd_store()
211 usbip_event_add(&udc->ud, VUDC_EVENT_DOWN); in usbip_sockfd_store()
214 spin_unlock_irqrestore(&udc->lock, flags); in usbip_sockfd_store()
215 mutex_unlock(&udc->ud.sysfs_lock); in usbip_sockfd_store()
222 spin_unlock(&udc->ud.lock); in usbip_sockfd_store()
224 spin_unlock_irqrestore(&udc->lock, flags); in usbip_sockfd_store()
225 mutex_unlock(&udc->ud.sysfs_lock); in usbip_sockfd_store()
234 struct vudc *udc = (struct vudc *) dev_get_drvdata(dev); in usbip_status_show() local
237 if (!udc) { in usbip_status_show()
241 spin_lock_irq(&udc->ud.lock); in usbip_status_show()
242 status = udc->ud.status; in usbip_status_show()
243 spin_unlock_irq(&udc->ud.lock); in usbip_status_show()