#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>
static bool hackrf_enable_rf_gain_ctrl;
module_param_named(enable_rf_gain_ctrl, hackrf_enable_rf_gain_ctrl, bool, 0644);
MODULE_PARM_DESC(…) …;
enum { … };
#define MAX_BULK_BUFS …
#define BULK_BUFFER_SIZE …
static const struct v4l2_frequency_band bands_adc_dac[] = …;
static const struct v4l2_frequency_band bands_rx_tx[] = …;
struct hackrf_format { … };
static struct hackrf_format formats[] = …;
static const unsigned int NUM_FORMATS = …;
struct hackrf_buffer { … };
struct hackrf_dev { … };
#define hackrf_dbg_usb_control_msg(_dev, _r, _t, _v, _i, _b, _l) …
static int hackrf_ctrl_msg(struct hackrf_dev *dev, u8 request, u16 value,
u16 index, u8 *data, u16 size)
{ … }
static int hackrf_set_params(struct hackrf_dev *dev)
{ … }
static struct hackrf_buffer *hackrf_get_next_buffer(struct hackrf_dev *dev,
struct list_head *buffer_list)
{ … }
static void hackrf_copy_stream(struct hackrf_dev *dev, void *dst, void *src,
unsigned int src_len)
{ … }
static void hackrf_urb_complete_in(struct urb *urb)
{ … }
static void hackrf_urb_complete_out(struct urb *urb)
{ … }
static int hackrf_kill_urbs(struct hackrf_dev *dev)
{ … }
static int hackrf_submit_urbs(struct hackrf_dev *dev)
{ … }
static int hackrf_free_stream_bufs(struct hackrf_dev *dev)
{ … }
static int hackrf_alloc_stream_bufs(struct hackrf_dev *dev)
{ … }
static int hackrf_free_urbs(struct hackrf_dev *dev)
{ … }
static int hackrf_alloc_urbs(struct hackrf_dev *dev, bool rcv)
{ … }
static void hackrf_disconnect(struct usb_interface *intf)
{ … }
static void hackrf_return_all_buffers(struct vb2_queue *vq,
enum vb2_buffer_state state)
{ … }
static int hackrf_queue_setup(struct vb2_queue *vq,
unsigned int *nbuffers,
unsigned int *nplanes, unsigned int sizes[], struct device *alloc_devs[])
{ … }
static void hackrf_buf_queue(struct vb2_buffer *vb)
{ … }
static int hackrf_start_streaming(struct vb2_queue *vq, unsigned int count)
{ … }
static void hackrf_stop_streaming(struct vb2_queue *vq)
{ … }
static const struct vb2_ops hackrf_vb2_ops = …;
static int hackrf_querycap(struct file *file, void *fh,
struct v4l2_capability *cap)
{ … }
static int hackrf_s_fmt_sdr(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int hackrf_g_fmt_sdr(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int hackrf_try_fmt_sdr(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int hackrf_enum_fmt_sdr(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int hackrf_s_tuner(struct file *file, void *priv,
const struct v4l2_tuner *v)
{ … }
static int hackrf_g_tuner(struct file *file, void *priv, struct v4l2_tuner *v)
{ … }
static int hackrf_s_modulator(struct file *file, void *fh,
const struct v4l2_modulator *a)
{ … }
static int hackrf_g_modulator(struct file *file, void *fh,
struct v4l2_modulator *a)
{ … }
static int hackrf_s_frequency(struct file *file, void *priv,
const struct v4l2_frequency *f)
{ … }
static int hackrf_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{ … }
static int hackrf_enum_freq_bands(struct file *file, void *priv,
struct v4l2_frequency_band *band)
{ … }
static const struct v4l2_ioctl_ops hackrf_ioctl_ops = …;
static const struct v4l2_file_operations hackrf_fops = …;
static const struct video_device hackrf_template = …;
static void hackrf_video_release(struct v4l2_device *v)
{ … }
static int hackrf_s_ctrl_rx(struct v4l2_ctrl *ctrl)
{ … }
static int hackrf_s_ctrl_tx(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops hackrf_ctrl_ops_rx = …;
static const struct v4l2_ctrl_ops hackrf_ctrl_ops_tx = …;
static int hackrf_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
static const struct usb_device_id hackrf_id_table[] = …;
MODULE_DEVICE_TABLE(usb, hackrf_id_table);
static struct usb_driver hackrf_driver = …;
module_usb_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;