Commit df9160b9 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai

ALSA: firewire-lib: obsolete macro for header of IT context

The header size parameter of 1394 OHCI IT context has no effect.
Besides the header size of queued packet is different from context
header.

This commit cleans codes relevant to these two headers.
Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent fce9b013
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
#define QUEUE_LENGTH 48 #define QUEUE_LENGTH 48
#define IR_HEADER_SIZE 8 // For header and timestamp. #define IR_HEADER_SIZE 8 // For header and timestamp.
#define OUT_PACKET_HEADER_SIZE 0
#define HEADER_TSTAMP_MASK 0x0000ffff #define HEADER_TSTAMP_MASK 0x0000ffff
static void pcm_period_tasklet(unsigned long data); static void pcm_period_tasklet(unsigned long data);
...@@ -428,8 +427,7 @@ static void pcm_period_tasklet(unsigned long data) ...@@ -428,8 +427,7 @@ static void pcm_period_tasklet(unsigned long data)
snd_pcm_period_elapsed(pcm); snd_pcm_period_elapsed(pcm);
} }
static int queue_packet(struct amdtp_stream *s, unsigned int header_length, static int queue_packet(struct amdtp_stream *s, unsigned int payload_length)
unsigned int payload_length)
{ {
struct fw_iso_packet p = {0}; struct fw_iso_packet p = {0};
int err = 0; int err = 0;
...@@ -439,7 +437,15 @@ static int queue_packet(struct amdtp_stream *s, unsigned int header_length, ...@@ -439,7 +437,15 @@ static int queue_packet(struct amdtp_stream *s, unsigned int header_length,
p.interrupt = IS_ALIGNED(s->packet_index + 1, INTERRUPT_INTERVAL); p.interrupt = IS_ALIGNED(s->packet_index + 1, INTERRUPT_INTERVAL);
p.tag = s->tag; p.tag = s->tag;
p.header_length = header_length;
if (s->direction == AMDTP_IN_STREAM) {
// Queue one packet for IR context.
p.header_length = s->ctx_data.tx.ctx_header_size;
} else {
// No header for this packet.
p.header_length = 0;
}
if (payload_length > 0) if (payload_length > 0)
p.payload_length = payload_length; p.payload_length = payload_length;
else else
...@@ -460,13 +466,12 @@ static int queue_packet(struct amdtp_stream *s, unsigned int header_length, ...@@ -460,13 +466,12 @@ static int queue_packet(struct amdtp_stream *s, unsigned int header_length,
static inline int queue_out_packet(struct amdtp_stream *s, static inline int queue_out_packet(struct amdtp_stream *s,
unsigned int payload_length) unsigned int payload_length)
{ {
return queue_packet(s, OUT_PACKET_HEADER_SIZE, payload_length); return queue_packet(s, payload_length);
} }
static inline int queue_in_packet(struct amdtp_stream *s) static inline int queue_in_packet(struct amdtp_stream *s)
{ {
return queue_packet(s, s->ctx_data.tx.ctx_header_size, return queue_packet(s, s->ctx_data.tx.max_payload_length);
s->ctx_data.tx.max_payload_length);
} }
static int handle_out_packet(struct amdtp_stream *s, static int handle_out_packet(struct amdtp_stream *s,
...@@ -888,7 +893,7 @@ int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed) ...@@ -888,7 +893,7 @@ int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed)
} else { } else {
dir = DMA_TO_DEVICE; dir = DMA_TO_DEVICE;
type = FW_ISO_CONTEXT_TRANSMIT; type = FW_ISO_CONTEXT_TRANSMIT;
ctx_header_size = OUT_PACKET_HEADER_SIZE; ctx_header_size = 0; // No effect for IT context.
} }
err = iso_packets_buffer_init(&s->buffer, s->unit, QUEUE_LENGTH, err = iso_packets_buffer_init(&s->buffer, s->unit, QUEUE_LENGTH,
amdtp_stream_get_max_payload(s), dir); amdtp_stream_get_max_payload(s), dir);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment