Skip to content

Commit 1be4f21

Browse files
takaswietiwai
authored andcommitted
ALSA: firewire-lib: fix calculation for size of IR context payload
The quadlets for CIP header is handled as a part of IR context header, thus it doesn't join in IR context payload. However current calculation includes the quadlets in IR context payload. Cc: <[email protected]> Fixes: f11453c ("ALSA: firewire-lib: use 16 bytes IR context header to separate CIP header") Signed-off-by: Takashi Sakamoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 395f41e commit 1be4f21

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

sound/firewire/amdtp-stream.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,23 +1071,22 @@ static int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed,
10711071
s->data_block_counter = 0;
10721072
}
10731073

1074-
/* initialize packet buffer */
1074+
// initialize packet buffer.
1075+
max_ctx_payload_size = amdtp_stream_get_max_payload(s);
10751076
if (s->direction == AMDTP_IN_STREAM) {
10761077
dir = DMA_FROM_DEVICE;
10771078
type = FW_ISO_CONTEXT_RECEIVE;
1078-
if (!(s->flags & CIP_NO_HEADER))
1079+
if (!(s->flags & CIP_NO_HEADER)) {
1080+
max_ctx_payload_size -= 8;
10791081
ctx_header_size = IR_CTX_HEADER_SIZE_CIP;
1080-
else
1082+
} else {
10811083
ctx_header_size = IR_CTX_HEADER_SIZE_NO_CIP;
1082-
1083-
max_ctx_payload_size = amdtp_stream_get_max_payload(s) -
1084-
ctx_header_size;
1084+
}
10851085
} else {
10861086
dir = DMA_TO_DEVICE;
10871087
type = FW_ISO_CONTEXT_TRANSMIT;
10881088
ctx_header_size = 0; // No effect for IT context.
10891089

1090-
max_ctx_payload_size = amdtp_stream_get_max_payload(s);
10911090
if (!(s->flags & CIP_NO_HEADER))
10921091
max_ctx_payload_size -= IT_PKT_HEADER_SIZE_CIP;
10931092
}

0 commit comments

Comments
 (0)