Lines Matching full:loop
150 [0].s = "loop input to output",
169 struct f_loopback *loop = func_to_loop(f); in loopback_bind() local
187 loop->in_ep = usb_ep_autoconfig(cdev->gadget, &fs_loop_source_desc); in loopback_bind()
188 if (!loop->in_ep) { in loopback_bind()
195 loop->out_ep = usb_ep_autoconfig(cdev->gadget, &fs_loop_sink_desc); in loopback_bind()
196 if (!loop->out_ep) in loopback_bind()
217 f->name, loop->in_ep->name, loop->out_ep->name); in loopback_bind()
237 struct f_loopback *loop = ep->driver_data; in loopback_complete() local
238 struct usb_composite_dev *cdev = loop->function.config->cdev; in loopback_complete()
243 if (ep == loop->out_ep) { in loopback_complete()
252 ep = loop->in_ep; in loopback_complete()
260 ep = loop->out_ep; in loopback_complete()
268 ERROR(cdev, "Unable to loop back buffer to %s: %d\n", in loopback_complete()
275 ERROR(cdev, "%s loop complete --> %d, %d/%d\n", ep->name, in loopback_complete()
288 usb_ep_free_request(ep == loop->in_ep ? in loopback_complete()
289 loop->out_ep : loop->in_ep, in loopback_complete()
296 static void disable_loopback(struct f_loopback *loop) in disable_loopback() argument
300 cdev = loop->function.config->cdev; in disable_loopback()
301 disable_endpoints(cdev, loop->in_ep, loop->out_ep, NULL, NULL); in disable_loopback()
302 VDBG(cdev, "%s disabled\n", loop->function.name); in disable_loopback()
311 struct f_loopback *loop) in alloc_requests() argument
323 for (i = 0; i < loop->qlen && result == 0; i++) { in alloc_requests()
326 in_req = usb_ep_alloc_request(loop->in_ep, GFP_ATOMIC); in alloc_requests()
330 out_req = lb_alloc_ep_req(loop->out_ep, loop->buflen); in alloc_requests()
342 result = usb_ep_queue(loop->out_ep, out_req, GFP_ATOMIC); in alloc_requests()
345 loop->out_ep->name, result); in alloc_requests()
353 free_ep_req(loop->out_ep, out_req); in alloc_requests()
355 usb_ep_free_request(loop->in_ep, in_req); in alloc_requests()
361 struct f_loopback *loop, struct usb_ep *ep) in enable_endpoint() argument
365 result = config_ep_by_speed(cdev->gadget, &(loop->function), ep); in enable_endpoint()
372 ep->driver_data = loop; in enable_endpoint()
380 enable_loopback(struct usb_composite_dev *cdev, struct f_loopback *loop) in enable_loopback() argument
384 result = enable_endpoint(cdev, loop, loop->in_ep); in enable_loopback()
388 result = enable_endpoint(cdev, loop, loop->out_ep); in enable_loopback()
392 result = alloc_requests(cdev, loop); in enable_loopback()
396 DBG(cdev, "%s enabled\n", loop->function.name); in enable_loopback()
400 usb_ep_disable(loop->out_ep); in enable_loopback()
402 usb_ep_disable(loop->in_ep); in enable_loopback()
410 struct f_loopback *loop = func_to_loop(f); in loopback_set_alt() local
414 disable_loopback(loop); in loopback_set_alt()
415 return enable_loopback(cdev, loop); in loopback_set_alt()
420 struct f_loopback *loop = func_to_loop(f); in loopback_disable() local
422 disable_loopback(loop); in loopback_disable()
427 struct f_loopback *loop; in loopback_alloc() local
430 loop = kzalloc(sizeof *loop, GFP_KERNEL); in loopback_alloc()
431 if (!loop) in loopback_alloc()
440 loop->buflen = lb_opts->bulk_buflen; in loopback_alloc()
441 loop->qlen = lb_opts->qlen; in loopback_alloc()
442 if (!loop->qlen) in loopback_alloc()
443 loop->qlen = 32; in loopback_alloc()
445 loop->function.name = "loopback"; in loopback_alloc()
446 loop->function.bind = loopback_bind; in loopback_alloc()
447 loop->function.set_alt = loopback_set_alt; in loopback_alloc()
448 loop->function.disable = loopback_disable; in loopback_alloc()
449 loop->function.strings = loopback_strings; in loopback_alloc()
451 loop->function.free_func = lb_free_func; in loopback_alloc()
453 return &loop->function; in loopback_alloc()