firewire: Implement sync and tag matching for isochronous receive.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
diff --git a/drivers/firewire/fw-device-cdev.c b/drivers/firewire/fw-device-cdev.c
index 5c87618..33fe576 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -416,6 +416,12 @@
 	if (request.channel > 63)
 		return -EINVAL;
 
+	if (request.sync > 15)
+		return -EINVAL;
+
+	if (request.tags == 0 || request.tags > 15)
+		return -EINVAL;
+
 	if (request.speed > SCODE_3200)
 		return -EINVAL;
 
@@ -424,6 +430,8 @@
 						    request.channel,
 						    request.speed,
 						    request.header_size,
+						    request.sync,
+						    request.tags,
 						    iso_callback, client);
 	if (IS_ERR(client->iso_context))
 		return PTR_ERR(client->iso_context);
@@ -495,7 +503,7 @@
 		if (__copy_from_user
 		    (u.packet.header, p->header, header_length))
 			return -EFAULT;
-		if (u.packet.skip &&
+		if (u.packet.skip && ctx->type == FW_ISO_CONTEXT_TRANSMIT &&
 		    u.packet.header_length + u.packet.payload_length > 0)
 			return -EINVAL;
 		if (payload + u.packet.payload_length > payload_end)