]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ALSA: firewire-lib: add a quirk of packet without valid EOH in CIP format
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Wed, 22 Mar 2017 12:30:27 +0000 (21:30 +0900)
committerTakashi Iwai <tiwai@suse.de>
Tue, 28 Mar 2017 10:34:11 +0000 (12:34 +0200)
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>
sound/firewire/amdtp-stream.c
sound/firewire/amdtp-stream.h

index f9d12f4544836ba3c0566bcffca8e77b1d4bb96c..112ad039ed25154decd0b2a432cb565561958dc4 100644 (file)
@@ -480,8 +480,9 @@ static int handle_in_packet(struct amdtp_stream *s,
         * This module supports 'Two-quadlet CIP header with SYT field'.
         * For convenience, also check FMT field is AM824 or not.
         */
-       if (((cip_header[0] & CIP_EOH_MASK) == CIP_EOH) ||
-           ((cip_header[1] & CIP_EOH_MASK) != CIP_EOH)) {
+       if ((((cip_header[0] & CIP_EOH_MASK) == CIP_EOH) ||
+            ((cip_header[1] & CIP_EOH_MASK) != CIP_EOH)) &&
+           (!(s->flags & CIP_HEADER_WITHOUT_EOH))) {
                dev_info_ratelimited(&s->unit->device,
                                "Invalid CIP header for AMDTP: %08X:%08X\n",
                                cip_header[0], cip_header[1]);
index d2a3163097047a45bdf64a24bb3573f81e485f91..a31dfd849821c1d7bf9b13ed23d40ab68fd1b598 100644 (file)
@@ -29,6 +29,8 @@
  * @CIP_JUMBO_PAYLOAD: Only for in-stream. The number of data blocks in an
  *     packet is larger than IEC 61883-6 defines. Current implementation
  *     allows 5 times as large as IEC 61883-6 defines.
+ * @CIP_HEADER_WITHOUT_EOH: Only for in-stream. CIP Header doesn't include
+ *     valid EOH.
  */
 enum cip_flags {
        CIP_NONBLOCKING         = 0x00,
@@ -39,6 +41,7 @@ enum cip_flags {
        CIP_SKIP_DBC_ZERO_CHECK = 0x10,
        CIP_EMPTY_HAS_WRONG_DBC = 0x20,
        CIP_JUMBO_PAYLOAD       = 0x40,
+       CIP_HEADER_WITHOUT_EOH  = 0x80,
 };
 
 /**