summaryrefslogtreecommitdiff
path: root/drivers/firewire/fw-device-cdev.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-03-14 17:34:53 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-15 18:21:36 +0100
commitc70dc788fd8d3870b41231b6a53a64afb98cfd13 (patch)
tree60a70261eb3e6c812fd6c07ac48a863de73ba0be /drivers/firewire/fw-device-cdev.c
parentd60d7f1d5ce83d1be8d79256f711d6a645b7a2fa (diff)
downloadlwn-c70dc788fd8d3870b41231b6a53a64afb98cfd13.tar.gz
lwn-c70dc788fd8d3870b41231b6a53a64afb98cfd13.zip
firewire: Fix dualbuffer iso receive mode and drop buffer fill mode.
The dualbuffer DMA setup did not account for the iso trailer word and thus didn't work correctly. With this fixed we can drop the dual buffer fallback mode. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-device-cdev.c')
-rw-r--r--drivers/firewire/fw-device-cdev.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/firewire/fw-device-cdev.c b/drivers/firewire/fw-device-cdev.c
index 7b0efccf78f1..be6bfcfb9065 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -541,20 +541,32 @@ static int ioctl_create_iso_context(struct client *client, void __user *arg)
if (copy_from_user(&request, arg, sizeof request))
return -EFAULT;
- if (request.type > FW_ISO_CONTEXT_RECEIVE)
- return -EINVAL;
-
if (request.channel > 63)
return -EINVAL;
- if (request.sync > 15)
- return -EINVAL;
+ 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.tags == 0 || request.tags > 15)
+ return -EINVAL;
+
+ if (request.header_size < 4 || (request.header_size & 3))
+ return -EINVAL;
- if (request.speed > SCODE_3200)
+ break;
+
+ case FW_ISO_CONTEXT_TRANSMIT:
+ if (request.speed > SCODE_3200)
+ return -EINVAL;
+
+ break;
+
+ default:
return -EINVAL;
+ }
+
client->iso_context = fw_iso_context_create(client->device->card,
request.type,