Lines Matching refs:udc
58 static int handle_control_request(struct vudc *udc, struct urb *urb, in handle_control_request() argument
73 udc->address = w_value; in handle_control_request()
84 udc->gadget.b_hnp_enable = 1; in handle_control_request()
87 udc->gadget.a_hnp_support = 1; in handle_control_request()
90 udc->gadget.a_alt_hnp_support = 1; in handle_control_request()
96 udc->devstatus |= (1 << w_value); in handle_control_request()
101 ep2 = vudc_find_endpoint(udc, w_index); in handle_control_request()
102 if (!ep2 || ep2->ep.name == udc->ep[0].ep.name) { in handle_control_request()
129 udc->devstatus &= ~(1 << w_value); in handle_control_request()
134 ep2 = vudc_find_endpoint(udc, w_index); in handle_control_request()
158 ep2 = vudc_find_endpoint(udc, w_index); in handle_control_request()
166 buf[0] = (u8)udc->devstatus; in handle_control_request()
183 static int transfer(struct vudc *udc, in transfer() argument
283 spin_unlock(&udc->lock); in transfer()
285 spin_lock(&udc->lock); in transfer()
304 struct vudc *udc = from_timer(udc, t, tr_timer.timer); in v_timer() local
305 struct transfer_timer *timer = &udc->tr_timer; in v_timer()
313 spin_lock_irqsave(&udc->lock, flags); in v_timer()
315 total = get_frame_limit(udc->gadget.speed); in v_timer()
318 spin_unlock_irqrestore(&udc->lock, flags); in v_timer()
331 udc->ep[0].already_seen = 0; in v_timer()
332 list_for_each_entry(_ep, &udc->gadget.ep_list, ep_list) { in v_timer()
338 list_for_each_entry_safe(urb_p, tmp, &udc->urb_queue, urb_entry) { in v_timer()
359 if (ep == &udc->ep[0] && urb_p->new) { in v_timer()
368 if (ep == &udc->ep[0] && ep->setup_stage) { in v_timer()
373 ret = handle_control_request(udc, urb, in v_timer()
377 spin_unlock(&udc->lock); in v_timer()
378 ret = udc->driver->setup(&udc->gadget, in v_timer()
381 spin_lock(&udc->lock); in v_timer()
410 total -= transfer(udc, urb, ep, limit); in v_timer()
419 spin_lock(&udc->lock_tx); in v_timer()
422 v_enqueue_ret_submit(udc, urb_p); in v_timer()
424 v_enqueue_ret_unlink(udc, urb_p->seqnum, in v_timer()
428 wake_up(&udc->tx_waitq); in v_timer()
429 spin_unlock(&udc->lock_tx); in v_timer()
435 if (list_empty(&udc->urb_queue)) in v_timer()
441 spin_unlock_irqrestore(&udc->lock, flags); in v_timer()
446 void v_init_timer(struct vudc *udc) in v_init_timer() argument
448 struct transfer_timer *t = &udc->tr_timer; in v_init_timer()
454 void v_start_timer(struct vudc *udc) in v_start_timer() argument
456 struct transfer_timer *t = &udc->tr_timer; in v_start_timer()
458 dev_dbg(&udc->pdev->dev, "timer start"); in v_start_timer()
463 return v_kick_timer(udc, jiffies); in v_start_timer()
467 t->frame_limit = get_frame_limit(udc->gadget.speed); in v_start_timer()
468 return v_kick_timer(udc, jiffies); in v_start_timer()
472 void v_kick_timer(struct vudc *udc, unsigned long time) in v_kick_timer() argument
474 struct transfer_timer *t = &udc->tr_timer; in v_kick_timer()
476 dev_dbg(&udc->pdev->dev, "timer kick"); in v_kick_timer()
489 void v_stop_timer(struct vudc *udc) in v_stop_timer() argument
491 struct transfer_timer *t = &udc->tr_timer; in v_stop_timer()
494 dev_dbg(&udc->pdev->dev, "timer stop"); in v_stop_timer()