#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/bitmap.h>
#include <linux/usb.h>
#include <linux/usb/audio.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/rawmidi.h>
#define PREFIX …
#define BUFSIZE …
static const struct usb_device_id id_table[] = …;
static const unsigned char device_cmd_prefix[] = …;
static const unsigned char bcd2000_init_sequence[] = …;
struct bcd2000 { … };
static int index[SNDRV_CARDS] = …;
static char *id[SNDRV_CARDS] = …;
static DEFINE_MUTEX(devices_mutex);
static DECLARE_BITMAP(devices_used, SNDRV_CARDS);
static struct usb_driver bcd2000_driver;
#ifdef CONFIG_SND_DEBUG
static void bcd2000_dump_buffer(const char *prefix, const char *buf, int len)
{ … }
#else
static void bcd2000_dump_buffer(const char *prefix, const char *buf, int len) {}
#endif
static int bcd2000_midi_input_open(struct snd_rawmidi_substream *substream)
{ … }
static int bcd2000_midi_input_close(struct snd_rawmidi_substream *substream)
{ … }
static void bcd2000_midi_input_trigger(struct snd_rawmidi_substream *substream,
int up)
{ … }
static void bcd2000_midi_handle_input(struct bcd2000 *bcd2k,
const unsigned char *buf, unsigned int buf_len)
{ … }
static void bcd2000_midi_send(struct bcd2000 *bcd2k)
{ … }
static int bcd2000_midi_output_open(struct snd_rawmidi_substream *substream)
{ … }
static int bcd2000_midi_output_close(struct snd_rawmidi_substream *substream)
{ … }
static void bcd2000_midi_output_trigger(struct snd_rawmidi_substream *substream,
int up)
{ … }
static void bcd2000_output_complete(struct urb *urb)
{ … }
static void bcd2000_input_complete(struct urb *urb)
{ … }
static const struct snd_rawmidi_ops bcd2000_midi_output = …;
static const struct snd_rawmidi_ops bcd2000_midi_input = …;
static void bcd2000_init_device(struct bcd2000 *bcd2k)
{ … }
static int bcd2000_init_midi(struct bcd2000 *bcd2k)
{ … }
static void bcd2000_free_usb_related_resources(struct bcd2000 *bcd2k,
struct usb_interface *interface)
{ … }
static int bcd2000_probe(struct usb_interface *interface,
const struct usb_device_id *usb_id)
{ … }
static void bcd2000_disconnect(struct usb_interface *interface)
{ … }
static struct usb_driver bcd2000_driver = …;
module_usb_driver(…) …;
MODULE_DEVICE_TABLE(usb, id_table);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;