#include <linux/module.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-event.h>
#include <media/videobuf2-v4l2.h>
#include <media/videobuf2-vmalloc.h>
enum { … };
#define MAX_BULK_BUFS …
#define BULK_BUFFER_SIZE …
static const struct v4l2_frequency_band bands[] = …;
static const struct v4l2_frequency_band bands_rf[] = …;
struct airspy_format { … };
static struct airspy_format formats[] = …;
static const unsigned int NUM_FORMATS = …;
struct airspy_frame_buf { … };
struct airspy { … };
#define airspy_dbg_usb_control_msg(_dev, _r, _t, _v, _i, _b, _l) …
static int airspy_ctrl_msg(struct airspy *s, u8 request, u16 value, u16 index,
u8 *data, u16 size)
{ … }
static struct airspy_frame_buf *airspy_get_next_fill_buf(struct airspy *s)
{ … }
static unsigned int airspy_convert_stream(struct airspy *s,
void *dst, void *src, unsigned int src_len)
{ … }
static void airspy_urb_complete(struct urb *urb)
{ … }
static int airspy_kill_urbs(struct airspy *s)
{ … }
static int airspy_submit_urbs(struct airspy *s)
{ … }
static int airspy_free_stream_bufs(struct airspy *s)
{ … }
static int airspy_alloc_stream_bufs(struct airspy *s)
{ … }
static int airspy_free_urbs(struct airspy *s)
{ … }
static int airspy_alloc_urbs(struct airspy *s)
{ … }
static void airspy_cleanup_queued_bufs(struct airspy *s)
{ … }
static void airspy_disconnect(struct usb_interface *intf)
{ … }
static int airspy_queue_setup(struct vb2_queue *vq,
unsigned int *nbuffers,
unsigned int *nplanes, unsigned int sizes[], struct device *alloc_devs[])
{ … }
static void airspy_buf_queue(struct vb2_buffer *vb)
{ … }
static int airspy_start_streaming(struct vb2_queue *vq, unsigned int count)
{ … }
static void airspy_stop_streaming(struct vb2_queue *vq)
{ … }
static const struct vb2_ops airspy_vb2_ops = …;
static int airspy_querycap(struct file *file, void *fh,
struct v4l2_capability *cap)
{ … }
static int airspy_enum_fmt_sdr_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int airspy_g_fmt_sdr_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int airspy_s_fmt_sdr_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int airspy_try_fmt_sdr_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int airspy_s_tuner(struct file *file, void *priv,
const struct v4l2_tuner *v)
{ … }
static int airspy_g_tuner(struct file *file, void *priv, struct v4l2_tuner *v)
{ … }
static int airspy_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{ … }
static int airspy_s_frequency(struct file *file, void *priv,
const struct v4l2_frequency *f)
{ … }
static int airspy_enum_freq_bands(struct file *file, void *priv,
struct v4l2_frequency_band *band)
{ … }
static const struct v4l2_ioctl_ops airspy_ioctl_ops = …;
static const struct v4l2_file_operations airspy_fops = …;
static const struct video_device airspy_template = …;
static void airspy_video_release(struct v4l2_device *v)
{ … }
static int airspy_set_lna_gain(struct airspy *s)
{ … }
static int airspy_set_mixer_gain(struct airspy *s)
{ … }
static int airspy_set_if_gain(struct airspy *s)
{ … }
static int airspy_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops airspy_ctrl_ops = …;
static int airspy_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
static const struct usb_device_id airspy_id_table[] = …;
MODULE_DEVICE_TABLE(usb, airspy_id_table);
static struct usb_driver airspy_driver = …;
module_usb_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;