aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-cdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/fw-cdev.c')
-rw-r--r--drivers/firewire/fw-cdev.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c
index 88b8fd917f54..c876ac3c50e0 100644
--- a/drivers/firewire/fw-cdev.c
+++ b/drivers/firewire/fw-cdev.c
@@ -1,8 +1,7 @@
1/* -*- c-basic-offset: 8 -*- 1/*
2 * Char device for device raw access
2 * 3 *
3 * fw-device-cdev.c - Char device for device raw access 4 * Copyright (C) 2005-2007 Kristian Hoegsberg <krh@bitplanet.net>
4 *
5 * Copyright (C) 2005-2006 Kristian Hoegsberg <krh@bitplanet.net>
6 * 5 *
7 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -36,9 +35,6 @@
36#include "fw-topology.h" 35#include "fw-topology.h"
37#include "fw-device.h" 36#include "fw-device.h"
38 37
39/* dequeue_event() just kfree()'s the event, so the event has to be
40 * the first field in the struct. */
41
42struct client; 38struct client;
43struct client_resource { 39struct client_resource {
44 struct list_head link; 40 struct list_head link;
@@ -46,6 +42,11 @@ struct client_resource {
46 u32 handle; 42 u32 handle;
47}; 43};
48 44
45/*
46 * dequeue_event() just kfree()'s the event, so the event has to be
47 * the first field in the struct.
48 */
49
49struct event { 50struct event {
50 struct { void *data; size_t size; } v[2]; 51 struct { void *data; size_t size; } v[2];
51 struct list_head link; 52 struct list_head link;
@@ -691,13 +692,15 @@ static int ioctl_queue_iso(struct client *client, void *buffer)
691 if (ctx == NULL || request->handle != 0) 692 if (ctx == NULL || request->handle != 0)
692 return -EINVAL; 693 return -EINVAL;
693 694
694 /* If the user passes a non-NULL data pointer, has mmap()'ed 695 /*
696 * If the user passes a non-NULL data pointer, has mmap()'ed
695 * the iso buffer, and the pointer points inside the buffer, 697 * the iso buffer, and the pointer points inside the buffer,
696 * we setup the payload pointers accordingly. Otherwise we 698 * we setup the payload pointers accordingly. Otherwise we
697 * set them both to 0, which will still let packets with 699 * set them both to 0, which will still let packets with
698 * payload_length == 0 through. In other words, if no packets 700 * payload_length == 0 through. In other words, if no packets
699 * use the indirect payload, the iso buffer need not be mapped 701 * use the indirect payload, the iso buffer need not be mapped
700 * and the request->data pointer is ignored.*/ 702 * and the request->data pointer is ignored.
703 */
701 704
702 payload = (unsigned long)request->data - client->vm_start; 705 payload = (unsigned long)request->data - client->vm_start;
703 buffer_end = client->buffer.page_count << PAGE_SHIFT; 706 buffer_end = client->buffer.page_count << PAGE_SHIFT;
@@ -720,8 +723,10 @@ static int ioctl_queue_iso(struct client *client, void *buffer)
720 if (ctx->type == FW_ISO_CONTEXT_TRANSMIT) { 723 if (ctx->type == FW_ISO_CONTEXT_TRANSMIT) {
721 header_length = u.packet.header_length; 724 header_length = u.packet.header_length;
722 } else { 725 } else {
723 /* We require that header_length is a multiple of 726 /*
724 * the fixed header size, ctx->header_size */ 727 * We require that header_length is a multiple of
728 * the fixed header size, ctx->header_size.
729 */
725 if (ctx->header_size == 0) { 730 if (ctx->header_size == 0) {
726 if (u.packet.header_length > 0) 731 if (u.packet.header_length > 0)
727 return -EINVAL; 732 return -EINVAL;
@@ -908,8 +913,10 @@ static int fw_device_op_release(struct inode *inode, struct file *file)
908 list_for_each_entry_safe(r, next_r, &client->resource_list, link) 913 list_for_each_entry_safe(r, next_r, &client->resource_list, link)
909 r->release(client, r); 914 r->release(client, r);
910 915
911 /* FIXME: We should wait for the async tasklets to stop 916 /*
912 * running before freeing the memory. */ 917 * FIXME: We should wait for the async tasklets to stop
918 * running before freeing the memory.
919 */
913 920
914 list_for_each_entry_safe(e, next_e, &client->event_list, link) 921 list_for_each_entry_safe(e, next_e, &client->event_list, link)
915 kfree(e); 922 kfree(e);