#define pr_fmt(fmt) …
#define GSPCA_VERSION …
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/vmalloc.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/pagemap.h>
#include <linux/io.h>
#include <asm/page.h>
#include <linux/uaccess.h>
#include <linux/ktime.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-event.h>
#include "gspca.h"
#if IS_ENABLED(CONFIG_INPUT)
#include <linux/input.h>
#include <linux/usb/input.h>
#endif
#define DEF_NURBS …
#if DEF_NURBS > MAX_NURBS
#error "DEF_NURBS too big"
#endif
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…);
int gspca_debug;
EXPORT_SYMBOL(…);
static void PDEBUG_MODE(struct gspca_dev *gspca_dev, int debug, char *txt,
__u32 pixfmt, int w, int h)
{ … }
#define GSPCA_MEMORY_NO …
#define GSPCA_MEMORY_READ …
#if IS_ENABLED(CONFIG_INPUT)
static void int_irq(struct urb *urb)
{ … }
static int gspca_input_connect(struct gspca_dev *dev)
{ … }
static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev,
struct usb_endpoint_descriptor *ep)
{ … }
static void gspca_input_create_urb(struct gspca_dev *gspca_dev)
{ … }
static void gspca_input_destroy_urb(struct gspca_dev *gspca_dev)
{ … }
#else
static inline void gspca_input_destroy_urb(struct gspca_dev *gspca_dev)
{
}
static inline void gspca_input_create_urb(struct gspca_dev *gspca_dev)
{
}
static inline int gspca_input_connect(struct gspca_dev *dev)
{
return 0;
}
#endif
static void fill_frame(struct gspca_dev *gspca_dev,
struct urb *urb)
{ … }
static void isoc_irq(struct urb *urb)
{ … }
static void bulk_irq(struct urb *urb)
{ … }
void gspca_frame_add(struct gspca_dev *gspca_dev,
enum gspca_packet_type packet_type,
const u8 *data,
int len)
{ … }
EXPORT_SYMBOL(…);
static void destroy_urbs(struct gspca_dev *gspca_dev)
{ … }
static int gspca_set_alt0(struct gspca_dev *gspca_dev)
{ … }
static struct usb_host_endpoint *alt_xfer(struct usb_host_interface *alt,
int xfer, int xfer_ep)
{ … }
static u32 which_bandwidth(struct gspca_dev *gspca_dev)
{ … }
#define MAX_ALT …
struct ep_tb_s { … };
static int build_isoc_ep_tb(struct gspca_dev *gspca_dev,
struct usb_interface *intf,
struct ep_tb_s *ep_tb)
{ … }
static int create_urbs(struct gspca_dev *gspca_dev,
struct usb_host_endpoint *ep)
{ … }
static void gspca_stream_off(struct gspca_dev *gspca_dev)
{ … }
static int gspca_init_transfer(struct gspca_dev *gspca_dev)
{ … }
static void gspca_set_default_mode(struct gspca_dev *gspca_dev)
{ … }
static int wxh_to_mode(struct gspca_dev *gspca_dev,
int width, int height, u32 pixelformat)
{ … }
static int wxh_to_nearest_mode(struct gspca_dev *gspca_dev,
int width, int height, u32 pixelformat)
{ … }
static int gspca_get_mode(struct gspca_dev *gspca_dev,
int mode,
int pixfmt)
{ … }
#ifdef CONFIG_VIDEO_ADV_DEBUG
static int vidioc_g_chip_info(struct file *file, void *priv,
struct v4l2_dbg_chip_info *chip)
{ … }
static int vidioc_g_register(struct file *file, void *priv,
struct v4l2_dbg_register *reg)
{ … }
static int vidioc_s_register(struct file *file, void *priv,
const struct v4l2_dbg_register *reg)
{ … }
#endif
static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *fmtdesc)
{ … }
static int vidioc_g_fmt_vid_cap(struct file *file, void *_priv,
struct v4l2_format *fmt)
{ … }
static int try_fmt_vid_cap(struct gspca_dev *gspca_dev,
struct v4l2_format *fmt)
{ … }
static int vidioc_try_fmt_vid_cap(struct file *file, void *_priv,
struct v4l2_format *fmt)
{ … }
static int vidioc_s_fmt_vid_cap(struct file *file, void *_priv,
struct v4l2_format *fmt)
{ … }
static int vidioc_enum_framesizes(struct file *file, void *priv,
struct v4l2_frmsizeenum *fsize)
{ … }
static int vidioc_enum_frameintervals(struct file *filp, void *priv,
struct v4l2_frmivalenum *fival)
{ … }
static void gspca_release(struct v4l2_device *v4l2_device)
{ … }
static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{ … }
static int vidioc_enum_input(struct file *file, void *priv,
struct v4l2_input *input)
{ … }
static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)
{ … }
static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
{ … }
static int vidioc_g_jpegcomp(struct file *file, void *priv,
struct v4l2_jpegcompression *jpegcomp)
{ … }
static int vidioc_s_jpegcomp(struct file *file, void *priv,
const struct v4l2_jpegcompression *jpegcomp)
{ … }
static int vidioc_g_parm(struct file *filp, void *priv,
struct v4l2_streamparm *parm)
{ … }
static int vidioc_s_parm(struct file *filp, void *priv,
struct v4l2_streamparm *parm)
{ … }
static int gspca_queue_setup(struct vb2_queue *vq,
unsigned int *nbuffers, unsigned int *nplanes,
unsigned int sizes[], struct device *alloc_devs[])
{ … }
static int gspca_buffer_prepare(struct vb2_buffer *vb)
{ … }
static void gspca_buffer_finish(struct vb2_buffer *vb)
{ … }
static void gspca_buffer_queue(struct vb2_buffer *vb)
{ … }
static void gspca_return_all_buffers(struct gspca_dev *gspca_dev,
enum vb2_buffer_state state)
{ … }
static int gspca_start_streaming(struct vb2_queue *vq, unsigned int count)
{ … }
static void gspca_stop_streaming(struct vb2_queue *vq)
{ … }
static const struct vb2_ops gspca_qops = …;
static const struct v4l2_file_operations dev_fops = …;
static const struct v4l2_ioctl_ops dev_ioctl_ops = …;
static const struct video_device gspca_template = …;
int gspca_dev_probe2(struct usb_interface *intf,
const struct usb_device_id *id,
const struct sd_desc *sd_desc,
int dev_size,
struct module *module)
{ … }
EXPORT_SYMBOL(…);
int gspca_dev_probe(struct usb_interface *intf,
const struct usb_device_id *id,
const struct sd_desc *sd_desc,
int dev_size,
struct module *module)
{ … }
EXPORT_SYMBOL(…);
void gspca_disconnect(struct usb_interface *intf)
{ … }
EXPORT_SYMBOL(…);
#ifdef CONFIG_PM
int gspca_suspend(struct usb_interface *intf, pm_message_t message)
{ … }
EXPORT_SYMBOL(…);
int gspca_resume(struct usb_interface *intf)
{ … }
EXPORT_SYMBOL(…);
#endif
static int __init gspca_init(void)
{ … }
static void __exit gspca_exit(void)
{ … }
module_init(…) …;
module_exit(gspca_exit);
module_param_named(debug, gspca_debug, int, 0644);
MODULE_PARM_DESC(…) …;