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()
215 f->name, loop->in_ep->name, loop->out_ep->name); in loopback_bind()
235 struct f_loopback *loop = ep->driver_data; in loopback_complete() local
236 struct usb_composite_dev *cdev = loop->function.config->cdev; in loopback_complete()
241 if (ep == loop->out_ep) { in loopback_complete()
250 ep = loop->in_ep; in loopback_complete()
258 ep = loop->out_ep; in loopback_complete()
266 ERROR(cdev, "Unable to loop back buffer to %s: %d\n", in loopback_complete()
273 ERROR(cdev, "%s loop complete --> %d, %d/%d\n", ep->name, in loopback_complete()
286 usb_ep_free_request(ep == loop->in_ep ? in loopback_complete()
287 loop->out_ep : loop->in_ep, in loopback_complete()
294 static void disable_loopback(struct f_loopback *loop) in disable_loopback() argument
298 cdev = loop->function.config->cdev; in disable_loopback()
299 disable_endpoints(cdev, loop->in_ep, loop->out_ep, NULL, NULL); in disable_loopback()
300 VDBG(cdev, "%s disabled\n", loop->function.name); in disable_loopback()
309 struct f_loopback *loop) in alloc_requests() argument
321 for (i = 0; i < loop->qlen && result == 0; i++) { in alloc_requests()
324 in_req = usb_ep_alloc_request(loop->in_ep, GFP_ATOMIC); in alloc_requests()
328 out_req = lb_alloc_ep_req(loop->out_ep, loop->buflen); in alloc_requests()
340 result = usb_ep_queue(loop->out_ep, out_req, GFP_ATOMIC); in alloc_requests()
343 loop->out_ep->name, result); in alloc_requests()
351 free_ep_req(loop->out_ep, out_req); in alloc_requests()
353 usb_ep_free_request(loop->in_ep, in_req); in alloc_requests()
359 struct f_loopback *loop, struct usb_ep *ep) in enable_endpoint() argument
363 result = config_ep_by_speed(cdev->gadget, &(loop->function), ep); in enable_endpoint()
370 ep->driver_data = loop; in enable_endpoint()
378 enable_loopback(struct usb_composite_dev *cdev, struct f_loopback *loop) in enable_loopback() argument
382 result = enable_endpoint(cdev, loop, loop->in_ep); in enable_loopback()
386 result = enable_endpoint(cdev, loop, loop->out_ep); in enable_loopback()
390 result = alloc_requests(cdev, loop); in enable_loopback()
394 DBG(cdev, "%s enabled\n", loop->function.name); in enable_loopback()
398 usb_ep_disable(loop->out_ep); in enable_loopback()
400 usb_ep_disable(loop->in_ep); in enable_loopback()
408 struct f_loopback *loop = func_to_loop(f); in loopback_set_alt() local
412 disable_loopback(loop); in loopback_set_alt()
413 return enable_loopback(cdev, loop); in loopback_set_alt()
418 struct f_loopback *loop = func_to_loop(f); in loopback_disable() local
420 disable_loopback(loop); in loopback_disable()
425 struct f_loopback *loop; in loopback_alloc() local
428 loop = kzalloc(sizeof *loop, GFP_KERNEL); in loopback_alloc()
429 if (!loop) in loopback_alloc()
438 loop->buflen = lb_opts->bulk_buflen; in loopback_alloc()
439 loop->qlen = lb_opts->qlen; in loopback_alloc()
440 if (!loop->qlen) in loopback_alloc()
441 loop->qlen = 32; in loopback_alloc()
443 loop->function.name = "loopback"; in loopback_alloc()
444 loop->function.bind = loopback_bind; in loopback_alloc()
445 loop->function.set_alt = loopback_set_alt; in loopback_alloc()
446 loop->function.disable = loopback_disable; in loopback_alloc()
447 loop->function.strings = loopback_strings; in loopback_alloc()
449 loop->function.free_func = lb_free_func; in loopback_alloc()
451 return &loop->function; in loopback_alloc()