#include <linux/device.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/string.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/usb/g_uvc.h>
#include <linux/usb/video.h>
#include <linux/vmalloc.h>
#include <linux/wait.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-event.h>
#include "uvc.h"
#include "uvc_configfs.h"
#include "uvc_v4l2.h"
#include "uvc_video.h"
unsigned int uvc_gadget_trace_param;
module_param_named(trace, uvc_gadget_trace_param, uint, 0644);
MODULE_PARM_DESC(…) …;
static struct usb_string uvc_en_us_strings[] = …;
static struct usb_gadget_strings uvc_stringtab = …;
static struct usb_gadget_strings *uvc_function_strings[] = …;
#define UVC_INTF_VIDEO_CONTROL …
#define UVC_INTF_VIDEO_STREAMING …
#define UVC_STATUS_MAX_PACKET_SIZE …
static struct usb_interface_assoc_descriptor uvc_iad = …;
static struct usb_interface_descriptor uvc_control_intf = …;
static struct usb_endpoint_descriptor uvc_interrupt_ep = …;
static struct usb_ss_ep_comp_descriptor uvc_ss_interrupt_comp = …;
static struct uvc_control_endpoint_descriptor uvc_interrupt_cs_ep = …;
static struct usb_interface_descriptor uvc_streaming_intf_alt0 = …;
static struct usb_interface_descriptor uvc_streaming_intf_alt1 = …;
static struct usb_endpoint_descriptor uvc_fs_streaming_ep = …;
static struct usb_endpoint_descriptor uvc_hs_streaming_ep = …;
static struct usb_endpoint_descriptor uvc_ss_streaming_ep = …;
static struct usb_ss_ep_comp_descriptor uvc_ss_streaming_comp = …;
static const struct usb_descriptor_header * const uvc_fs_streaming[] = …;
static const struct usb_descriptor_header * const uvc_hs_streaming[] = …;
static const struct usb_descriptor_header * const uvc_ss_streaming[] = …;
static void
uvc_function_ep0_complete(struct usb_ep *ep, struct usb_request *req)
{ … }
static int
uvc_function_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
{ … }
void uvc_function_setup_continue(struct uvc_device *uvc, int disable_ep)
{ … }
static int
uvc_function_get_alt(struct usb_function *f, unsigned interface)
{ … }
static int
uvc_function_set_alt(struct usb_function *f, unsigned interface, unsigned alt)
{ … }
static void
uvc_function_disable(struct usb_function *f)
{ … }
void
uvc_function_connect(struct uvc_device *uvc)
{ … }
void
uvc_function_disconnect(struct uvc_device *uvc)
{ … }
static ssize_t function_name_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(function_name);
static int
uvc_register_video(struct uvc_device *uvc)
{ … }
#define UVC_COPY_DESCRIPTOR(mem, dst, desc) …
#define UVC_COPY_DESCRIPTORS(mem, dst, src) …
#define UVC_COPY_XU_DESCRIPTOR(mem, dst, desc) …
static struct usb_descriptor_header **
uvc_copy_descriptors(struct uvc_device *uvc, enum usb_device_speed speed)
{ … }
static int
uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
{ … }
static void uvc_free_inst(struct usb_function_instance *f)
{ … }
static struct usb_function_instance *uvc_alloc_inst(void)
{ … }
static void uvc_free(struct usb_function *f)
{ … }
static void uvc_function_unbind(struct usb_configuration *c,
struct usb_function *f)
{ … }
static struct usb_function *uvc_alloc(struct usb_function_instance *fi)
{ … }
DECLARE_USB_FUNCTION_INIT(uvc, uvc_alloc_inst, uvc_alloc);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;