firewire: Move sync and tag parameters to start_iso ioctl.
Setting these at create_context time or start_iso time doesn't matter
much, but raw1394 sets them at start_iso time so that will be easier to
emulate this way.
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 be6bfcf..175ea04 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -546,12 +546,6 @@
switch (request.type) {
case FW_ISO_CONTEXT_RECEIVE:
- if (request.sync > 15)
- return -EINVAL;
-
- if (request.tags == 0 || request.tags > 15)
- return -EINVAL;
-
if (request.header_size < 4 || (request.header_size & 3))
return -EINVAL;
@@ -567,13 +561,10 @@
return -EINVAL;
}
-
client->iso_context = fw_iso_context_create(client->device->card,
request.type,
request.channel,
request.speed,
- request.sync,
- request.tags,
request.header_size,
iso_callback, client);
if (IS_ERR(client->iso_context))
@@ -678,7 +669,16 @@
if (copy_from_user(&request, arg, sizeof request))
return -EFAULT;
- return fw_iso_context_start(client->iso_context, request.cycle);
+ if (client->iso_context->type == FW_ISO_CONTEXT_RECEIVE) {
+ if (request.tags == 0 || request.tags > 15)
+ return -EINVAL;
+
+ if (request.sync > 15)
+ return -EINVAL;
+ }
+
+ return fw_iso_context_start(client->iso_context,
+ request.cycle, request.sync, request.tags);
}
static int ioctl_stop_iso(struct client *client, void __user *arg)