#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/usb/composite.h>
#include <linux/usb/func_utils.h>
#include "g_zero.h"
struct f_loopback { … };
static inline struct f_loopback *func_to_loop(struct usb_function *f)
{ … }
static struct usb_interface_descriptor loopback_intf = …;
static struct usb_endpoint_descriptor fs_loop_source_desc = …;
static struct usb_endpoint_descriptor fs_loop_sink_desc = …;
static struct usb_descriptor_header *fs_loopback_descs[] = …;
static struct usb_endpoint_descriptor hs_loop_source_desc = …;
static struct usb_endpoint_descriptor hs_loop_sink_desc = …;
static struct usb_descriptor_header *hs_loopback_descs[] = …;
static struct usb_endpoint_descriptor ss_loop_source_desc = …;
static struct usb_ss_ep_comp_descriptor ss_loop_source_comp_desc = …;
static struct usb_endpoint_descriptor ss_loop_sink_desc = …;
static struct usb_ss_ep_comp_descriptor ss_loop_sink_comp_desc = …;
static struct usb_descriptor_header *ss_loopback_descs[] = …;
static struct usb_string strings_loopback[] = …;
static struct usb_gadget_strings stringtab_loop = …;
static struct usb_gadget_strings *loopback_strings[] = …;
static int loopback_bind(struct usb_configuration *c, struct usb_function *f)
{ … }
static void lb_free_func(struct usb_function *f)
{ … }
static void loopback_complete(struct usb_ep *ep, struct usb_request *req)
{ … }
static void disable_loopback(struct f_loopback *loop)
{ … }
static inline struct usb_request *lb_alloc_ep_req(struct usb_ep *ep, int len)
{ … }
static int alloc_requests(struct usb_composite_dev *cdev,
struct f_loopback *loop)
{ … }
static int enable_endpoint(struct usb_composite_dev *cdev,
struct f_loopback *loop, struct usb_ep *ep)
{ … }
static int
enable_loopback(struct usb_composite_dev *cdev, struct f_loopback *loop)
{ … }
static int loopback_set_alt(struct usb_function *f,
unsigned intf, unsigned alt)
{ … }
static void loopback_disable(struct usb_function *f)
{ … }
static struct usb_function *loopback_alloc(struct usb_function_instance *fi)
{ … }
static inline struct f_lb_opts *to_f_lb_opts(struct config_item *item)
{ … }
static void lb_attr_release(struct config_item *item)
{ … }
static struct configfs_item_operations lb_item_ops = …;
static ssize_t f_lb_opts_qlen_show(struct config_item *item, char *page)
{ … }
static ssize_t f_lb_opts_qlen_store(struct config_item *item,
const char *page, size_t len)
{ … }
CONFIGFS_ATTR(…);
static ssize_t f_lb_opts_bulk_buflen_show(struct config_item *item, char *page)
{ … }
static ssize_t f_lb_opts_bulk_buflen_store(struct config_item *item,
const char *page, size_t len)
{ … }
CONFIGFS_ATTR(…);
static struct configfs_attribute *lb_attrs[] = …;
static const struct config_item_type lb_func_type = …;
static void lb_free_instance(struct usb_function_instance *fi)
{ … }
static struct usb_function_instance *loopback_alloc_instance(void)
{ … }
DECLARE_USB_FUNCTION(Loopback, loopback_alloc_instance, loopback_alloc);
int __init lb_modinit(void)
{ … }
void __exit lb_modexit(void)
{ … }
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;