aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2017-03-22 08:30:27 -0400
committerTakashi Iwai <tiwai@suse.de>2017-03-28 06:34:11 -0400
commit2128f78f75a36a34dfef0e127273c2f820c5c904 (patch)
tree29e9adc94f258755927bebdf298fd6da3f8eed3c
parent949613e366ed436a7639722b0ab6ed66a0199ae9 (diff)
ALSA: firewire-lib: add a quirk of packet without valid EOH in CIP format
In IEC 61883-1, when two quadlets CIP header is used, the most significant bit in second CIP header stands. However, packets from units with MOTU protocol version 3 have a quirk without this flag. Current packet streaming layer handles this as protocol error. This commit adds a new enumeration constant for this quirk, to handle MOTU protocol version 3. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/firewire/amdtp-stream.c5
-rw-r--r--sound/firewire/amdtp-stream.h3
2 files changed, 6 insertions, 2 deletions
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c
index f9d12f454483..112ad039ed25 100644
--- a/sound/firewire/amdtp-stream.c
+++ b/sound/firewire/amdtp-stream.c
@@ -480,8 +480,9 @@ static int handle_in_packet(struct amdtp_stream *s,
480 * This module supports 'Two-quadlet CIP header with SYT field'. 480 * This module supports 'Two-quadlet CIP header with SYT field'.
481 * For convenience, also check FMT field is AM824 or not. 481 * For convenience, also check FMT field is AM824 or not.
482 */ 482 */
483 if (((cip_header[0] & CIP_EOH_MASK) == CIP_EOH) || 483 if ((((cip_header[0] & CIP_EOH_MASK) == CIP_EOH) ||
484 ((cip_header[1] & CIP_EOH_MASK) != CIP_EOH)) { 484 ((cip_header[1] & CIP_EOH_MASK) != CIP_EOH)) &&
485 (!(s->flags & CIP_HEADER_WITHOUT_EOH))) {
485 dev_info_ratelimited(&s->unit->device, 486 dev_info_ratelimited(&s->unit->device,
486 "Invalid CIP header for AMDTP: %08X:%08X\n", 487 "Invalid CIP header for AMDTP: %08X:%08X\n",
487 cip_header[0], cip_header[1]); 488 cip_header[0], cip_header[1]);
diff --git a/sound/firewire/amdtp-stream.h b/sound/firewire/amdtp-stream.h
index d2a316309704..a31dfd849821 100644
--- a/sound/firewire/amdtp-stream.h
+++ b/sound/firewire/amdtp-stream.h
@@ -29,6 +29,8 @@
29 * @CIP_JUMBO_PAYLOAD: Only for in-stream. The number of data blocks in an 29 * @CIP_JUMBO_PAYLOAD: Only for in-stream. The number of data blocks in an
30 * packet is larger than IEC 61883-6 defines. Current implementation 30 * packet is larger than IEC 61883-6 defines. Current implementation
31 * allows 5 times as large as IEC 61883-6 defines. 31 * allows 5 times as large as IEC 61883-6 defines.
32 * @CIP_HEADER_WITHOUT_EOH: Only for in-stream. CIP Header doesn't include
33 * valid EOH.
32 */ 34 */
33enum cip_flags { 35enum cip_flags {
34 CIP_NONBLOCKING = 0x00, 36 CIP_NONBLOCKING = 0x00,
@@ -39,6 +41,7 @@ enum cip_flags {
39 CIP_SKIP_DBC_ZERO_CHECK = 0x10, 41 CIP_SKIP_DBC_ZERO_CHECK = 0x10,
40 CIP_EMPTY_HAS_WRONG_DBC = 0x20, 42 CIP_EMPTY_HAS_WRONG_DBC = 0x20,
41 CIP_JUMBO_PAYLOAD = 0x40, 43 CIP_JUMBO_PAYLOAD = 0x40,
44 CIP_HEADER_WITHOUT_EOH = 0x80,
42}; 45};
43 46
44/** 47/**