linux/drivers/media/usb/airspy/airspy.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * AirSpy SDR driver
 *
 * Copyright (C) 2014 Antti Palosaari <[email protected]>
 */

#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>

/* AirSpy USB API commands (from AirSpy Library) */
enum {};

/*
 *       bEndpointAddress     0x81  EP 1 IN
 *         Transfer Type            Bulk
 *       wMaxPacketSize     0x0200  1x 512 bytes
 */
#define MAX_BULK_BUFS
#define BULK_BUFFER_SIZE

static const struct v4l2_frequency_band bands[] =;

static const struct v4l2_frequency_band bands_rf[] =;

/* stream formats */
struct airspy_format {};

/* format descriptions for capture and preview */
static struct airspy_format formats[] =;

static const unsigned int NUM_FORMATS =;

/* intermediate buffers with raw data from the USB device */
struct airspy_frame_buf {};

struct airspy {};

#define airspy_dbg_usb_control_msg(_dev, _r, _t, _v, _i, _b, _l)

/* execute firmware command */
static int airspy_ctrl_msg(struct airspy *s, u8 request, u16 value, u16 index,
		u8 *data, u16 size)
{}

/* Private functions */
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)
{}

/*
 * This gets called for the bulk stream pipe. This is done in interrupt
 * time, so it has to be fast, not crash, and not stall. Neat.
 */
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)
{}

/* Must be called with vb_queue_lock hold */
static void airspy_cleanup_queued_bufs(struct airspy *s)
{}

/* The user yanked out the cable... */
static void airspy_disconnect(struct usb_interface *intf)
{}

/* Videobuf2 operations */
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)
{}

/* USB device ID list */
static const struct usb_device_id airspy_id_table[] =;
MODULE_DEVICE_TABLE(usb, airspy_id_table);

/* USB subsystem interface */
static struct usb_driver airspy_driver =;

module_usb_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();