diff options
author | Kristian Høgsberg <krh@redhat.com> | 2007-04-30 15:03:14 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-04-30 17:08:13 -0400 |
commit | abaa5743e340c23922d92c9a5a6753ea3ae71e58 (patch) | |
tree | c90f0b63edbf99ea6f7bc63d6a15e2c8afe6ae9f /drivers/firewire/fw-device-cdev.c | |
parent | 4f2592232ea951e52b2faf1abf519e13856ac6f4 (diff) |
firewire: Future proof the iso ioctls by adding a handle for the iso context.
Currently create context always returns 0 and the other iso
ioctls will expect user space to pass that in for subsequent ioctls.
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.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/firewire/fw-device-cdev.c b/drivers/firewire/fw-device-cdev.c index d2b867f44348..2910db69ec2c 100644 --- a/drivers/firewire/fw-device-cdev.c +++ b/drivers/firewire/fw-device-cdev.c | |||
@@ -80,6 +80,7 @@ struct client { | |||
80 | u64 bus_reset_closure; | 80 | u64 bus_reset_closure; |
81 | 81 | ||
82 | struct fw_iso_context *iso_context; | 82 | struct fw_iso_context *iso_context; |
83 | u64 iso_closure; | ||
83 | struct fw_iso_buffer buffer; | 84 | struct fw_iso_buffer buffer; |
84 | unsigned long vm_start; | 85 | unsigned long vm_start; |
85 | 86 | ||
@@ -626,7 +627,7 @@ iso_callback(struct fw_iso_context *context, u32 cycle, | |||
626 | return; | 627 | return; |
627 | 628 | ||
628 | interrupt->interrupt.type = FW_CDEV_EVENT_ISO_INTERRUPT; | 629 | interrupt->interrupt.type = FW_CDEV_EVENT_ISO_INTERRUPT; |
629 | interrupt->interrupt.closure = 0; | 630 | interrupt->interrupt.closure = client->iso_closure; |
630 | interrupt->interrupt.cycle = cycle; | 631 | interrupt->interrupt.cycle = cycle; |
631 | interrupt->interrupt.header_length = header_length; | 632 | interrupt->interrupt.header_length = header_length; |
632 | memcpy(interrupt->interrupt.header, header, header_length); | 633 | memcpy(interrupt->interrupt.header, header, header_length); |
@@ -659,6 +660,7 @@ static int ioctl_create_iso_context(struct client *client, void *buffer) | |||
659 | return -EINVAL; | 660 | return -EINVAL; |
660 | } | 661 | } |
661 | 662 | ||
663 | client->iso_closure = request->closure; | ||
662 | client->iso_context = fw_iso_context_create(client->device->card, | 664 | client->iso_context = fw_iso_context_create(client->device->card, |
663 | request->type, | 665 | request->type, |
664 | request->channel, | 666 | request->channel, |
@@ -668,6 +670,9 @@ static int ioctl_create_iso_context(struct client *client, void *buffer) | |||
668 | if (IS_ERR(client->iso_context)) | 670 | if (IS_ERR(client->iso_context)) |
669 | return PTR_ERR(client->iso_context); | 671 | return PTR_ERR(client->iso_context); |
670 | 672 | ||
673 | /* We only support one context at this time. */ | ||
674 | request->handle = 0; | ||
675 | |||
671 | return 0; | 676 | return 0; |
672 | } | 677 | } |
673 | 678 | ||
@@ -683,7 +688,7 @@ static int ioctl_queue_iso(struct client *client, void *buffer) | |||
683 | u8 header[256]; | 688 | u8 header[256]; |
684 | } u; | 689 | } u; |
685 | 690 | ||
686 | if (ctx == NULL) | 691 | if (ctx == NULL || request->handle != 0) |
687 | return -EINVAL; | 692 | return -EINVAL; |
688 | 693 | ||
689 | /* If the user passes a non-NULL data pointer, has mmap()'ed | 694 | /* If the user passes a non-NULL data pointer, has mmap()'ed |
@@ -759,6 +764,8 @@ static int ioctl_start_iso(struct client *client, void *buffer) | |||
759 | { | 764 | { |
760 | struct fw_cdev_start_iso *request = buffer; | 765 | struct fw_cdev_start_iso *request = buffer; |
761 | 766 | ||
767 | if (request->handle != 0) | ||
768 | return -EINVAL; | ||
762 | if (client->iso_context->type == FW_ISO_CONTEXT_RECEIVE) { | 769 | if (client->iso_context->type == FW_ISO_CONTEXT_RECEIVE) { |
763 | if (request->tags == 0 || request->tags > 15) | 770 | if (request->tags == 0 || request->tags > 15) |
764 | return -EINVAL; | 771 | return -EINVAL; |
@@ -773,6 +780,11 @@ static int ioctl_start_iso(struct client *client, void *buffer) | |||
773 | 780 | ||
774 | static int ioctl_stop_iso(struct client *client, void *buffer) | 781 | static int ioctl_stop_iso(struct client *client, void *buffer) |
775 | { | 782 | { |
783 | struct fw_cdev_stop_iso *request = buffer; | ||
784 | |||
785 | if (request->handle != 0) | ||
786 | return -EINVAL; | ||
787 | |||
776 | return fw_iso_context_stop(client->iso_context); | 788 | return fw_iso_context_stop(client->iso_context); |
777 | } | 789 | } |
778 | 790 | ||