ALSA: firewire-lib: arrange structure for AMDTP stream
In later commit, some members related to AM824 data format will be moved from AMDTP stream structure to data block structure. This commit is a preparation for it. Additionally, current layout of AMDTP stream structure is a bit mess by several extensions. This commit also arranges the layout. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
9ffecb1028
commit
10b2b6dc1a
1 changed files with 37 additions and 33 deletions
|
@ -117,52 +117,56 @@ struct amdtp_stream {
|
||||||
struct fw_unit *unit;
|
struct fw_unit *unit;
|
||||||
enum cip_flags flags;
|
enum cip_flags flags;
|
||||||
enum amdtp_stream_direction direction;
|
enum amdtp_stream_direction direction;
|
||||||
struct fw_iso_context *context;
|
|
||||||
struct mutex mutex;
|
struct mutex mutex;
|
||||||
|
|
||||||
enum cip_sfc sfc;
|
/* For packet processing. */
|
||||||
unsigned int data_block_quadlets;
|
struct fw_iso_context *context;
|
||||||
unsigned int pcm_channels;
|
|
||||||
unsigned int midi_ports;
|
|
||||||
void (*transfer_samples)(struct amdtp_stream *s,
|
|
||||||
struct snd_pcm_substream *pcm,
|
|
||||||
__be32 *buffer, unsigned int frames);
|
|
||||||
u8 pcm_positions[AMDTP_MAX_CHANNELS_FOR_PCM];
|
|
||||||
u8 midi_position;
|
|
||||||
|
|
||||||
unsigned int syt_interval;
|
|
||||||
unsigned int transfer_delay;
|
|
||||||
unsigned int source_node_id_field;
|
|
||||||
struct iso_packets_buffer buffer;
|
struct iso_packets_buffer buffer;
|
||||||
|
|
||||||
struct snd_pcm_substream *pcm;
|
|
||||||
struct tasklet_struct period_tasklet;
|
|
||||||
|
|
||||||
int packet_index;
|
int packet_index;
|
||||||
|
|
||||||
|
/* For CIP headers. */
|
||||||
|
unsigned int source_node_id_field;
|
||||||
|
unsigned int data_block_quadlets;
|
||||||
unsigned int data_block_counter;
|
unsigned int data_block_counter;
|
||||||
|
|
||||||
unsigned int data_block_state;
|
|
||||||
|
|
||||||
unsigned int last_syt_offset;
|
|
||||||
unsigned int syt_offset_state;
|
|
||||||
|
|
||||||
unsigned int pcm_buffer_pointer;
|
|
||||||
unsigned int pcm_period_pointer;
|
|
||||||
bool pointer_flush;
|
|
||||||
bool double_pcm_frames;
|
|
||||||
|
|
||||||
struct snd_rawmidi_substream *midi[AMDTP_MAX_CHANNELS_FOR_MIDI * 8];
|
|
||||||
int midi_fifo_limit;
|
|
||||||
int midi_fifo_used[AMDTP_MAX_CHANNELS_FOR_MIDI * 8];
|
|
||||||
|
|
||||||
/* quirk: fixed interval of dbc between previos/current packets. */
|
/* quirk: fixed interval of dbc between previos/current packets. */
|
||||||
unsigned int tx_dbc_interval;
|
unsigned int tx_dbc_interval;
|
||||||
/* quirk: indicate the value of dbc field in a first packet. */
|
/* quirk: indicate the value of dbc field in a first packet. */
|
||||||
unsigned int tx_first_dbc;
|
unsigned int tx_first_dbc;
|
||||||
|
|
||||||
|
/* Internal flags. */
|
||||||
|
enum cip_sfc sfc;
|
||||||
|
unsigned int syt_interval;
|
||||||
|
unsigned int transfer_delay;
|
||||||
|
unsigned int data_block_state;
|
||||||
|
unsigned int last_syt_offset;
|
||||||
|
unsigned int syt_offset_state;
|
||||||
|
|
||||||
|
/* For a PCM substream processing. */
|
||||||
|
struct snd_pcm_substream *pcm;
|
||||||
|
struct tasklet_struct period_tasklet;
|
||||||
|
unsigned int pcm_buffer_pointer;
|
||||||
|
unsigned int pcm_period_pointer;
|
||||||
|
bool pointer_flush;
|
||||||
|
|
||||||
|
/* To wait for first packet. */
|
||||||
bool callbacked;
|
bool callbacked;
|
||||||
wait_queue_head_t callback_wait;
|
wait_queue_head_t callback_wait;
|
||||||
struct amdtp_stream *sync_slave;
|
struct amdtp_stream *sync_slave;
|
||||||
|
|
||||||
|
/* For AM824 processing. */
|
||||||
|
struct snd_rawmidi_substream *midi[AMDTP_MAX_CHANNELS_FOR_MIDI * 8];
|
||||||
|
int midi_fifo_limit;
|
||||||
|
int midi_fifo_used[AMDTP_MAX_CHANNELS_FOR_MIDI * 8];
|
||||||
|
unsigned int pcm_channels;
|
||||||
|
unsigned int midi_ports;
|
||||||
|
|
||||||
|
u8 pcm_positions[AMDTP_MAX_CHANNELS_FOR_PCM];
|
||||||
|
u8 midi_position;
|
||||||
|
bool double_pcm_frames;
|
||||||
|
|
||||||
|
void (*transfer_samples)(struct amdtp_stream *s,
|
||||||
|
struct snd_pcm_substream *pcm,
|
||||||
|
__be32 *buffer, unsigned int frames);
|
||||||
};
|
};
|
||||||
|
|
||||||
int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
|
int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
|
||||||
|
|
Loading…
Add table
Reference in a new issue