linux/sound/firewire/bebob/bebob_stream.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * bebob_stream.c - a part of driver for BeBoB based devices
 *
 * Copyright (c) 2013-2014 Takashi Sakamoto
 */

#include "./bebob.h"

#define READY_TIMEOUT_MS

/*
 * NOTE;
 * For BeBoB streams, Both of input and output CMP connection are important.
 *
 * For most devices, each CMP connection starts to transmit/receive a
 * corresponding stream. But for a few devices, both of CMP connection needs
 * to start transmitting stream. An example is 'M-Audio Firewire 410'.
 */

/* 128 is an arbitrary length but it seems to be enough */
#define FORMAT_MAXIMUM_LENGTH

const unsigned int snd_bebob_rate_table[SND_BEBOB_STRM_FMT_ENTRIES] =;

/*
 * See: Table 51: Extended Stream Format Info ‘Sampling Frequency’
 * in Additional AVC commands (Nov 2003, BridgeCo)
 */
static const unsigned int bridgeco_freq_table[] =;

static int
get_formation_index(unsigned int rate, unsigned int *index)
{}

int
snd_bebob_stream_get_rate(struct snd_bebob *bebob, unsigned int *curr_rate)
{}

int
snd_bebob_stream_set_rate(struct snd_bebob *bebob, unsigned int rate)
{}

int snd_bebob_stream_get_clock_src(struct snd_bebob *bebob,
				   enum snd_bebob_clock_type *src)
{}

static int map_data_channels(struct snd_bebob *bebob, struct amdtp_stream *s)
{}

static int
check_connection_used_by_others(struct snd_bebob *bebob, struct amdtp_stream *s)
{}

static void break_both_connections(struct snd_bebob *bebob)
{}

static int start_stream(struct snd_bebob *bebob, struct amdtp_stream *stream)
{}

static int init_stream(struct snd_bebob *bebob, struct amdtp_stream *stream)
{}

static void destroy_stream(struct snd_bebob *bebob, struct amdtp_stream *stream)
{}

int snd_bebob_stream_init_duplex(struct snd_bebob *bebob)
{}

static int keep_resources(struct snd_bebob *bebob, struct amdtp_stream *stream,
			  unsigned int rate, unsigned int index)
{}

int snd_bebob_stream_reserve_duplex(struct snd_bebob *bebob, unsigned int rate,
				    unsigned int frames_per_period,
				    unsigned int frames_per_buffer)
{}

int snd_bebob_stream_start_duplex(struct snd_bebob *bebob)
{}

void snd_bebob_stream_stop_duplex(struct snd_bebob *bebob)
{}

/*
 * This function should be called before starting streams or after stopping
 * streams.
 */
void snd_bebob_stream_destroy_duplex(struct snd_bebob *bebob)
{}

/*
 * See: Table 50: Extended Stream Format Info Format Hierarchy Level 2’
 * in Additional AVC commands (Nov 2003, BridgeCo)
 * Also 'Clause 12 AM824 sequence adaption layers' in IEC 61883-6:2005
 */
static int
parse_stream_formation(u8 *buf, unsigned int len,
		       struct snd_bebob_stream_formation *formation)
{}

static int fill_stream_formations(struct snd_bebob *bebob, u8 addr[AVC_BRIDGECO_ADDR_BYTES],
				  enum avc_bridgeco_plug_dir plug_dir, unsigned int plug_id,
				  struct snd_bebob_stream_formation *formations)
{}

static int detect_midi_ports(struct snd_bebob *bebob,
			     const struct snd_bebob_stream_formation *formats,
			     u8 addr[AVC_BRIDGECO_ADDR_BYTES], enum avc_bridgeco_plug_dir plug_dir,
			     unsigned int plug_count, unsigned int *midi_ports)
{}

static int
seek_msu_sync_input_plug(struct snd_bebob *bebob)
{}

int snd_bebob_stream_discover(struct snd_bebob *bebob)
{}

void snd_bebob_stream_lock_changed(struct snd_bebob *bebob)
{}

int snd_bebob_stream_lock_try(struct snd_bebob *bebob)
{}

void snd_bebob_stream_lock_release(struct snd_bebob *bebob)
{}