aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2009-01-04 10:23:29 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-03-24 15:56:44 -0400
commit1ec3c0269d7196118cc7c403654ca5f19ef4d584 (patch)
tree087bdf8db274f29f92762adf0ed6cef1bae2ce5d /include
parentb1bda4cdc2037447bd66753bf5ccab66d91b0b59 (diff)
firewire: cdev: add ioctls for manual iso resource management
This adds ioctls for allocation and deallocation of a channel or/and bandwidth without auto-reallocation and without auto-deallocation. The benefit of these ioctls is that libraw1394-style isochronous resource management can be implemented without write access to the IRM's character device file. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/firewire-cdev.h42
1 files changed, 32 insertions, 10 deletions
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index 25b96dd0574f..08ca838a727b 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -151,7 +151,7 @@ struct fw_cdev_event_iso_interrupt {
151/** 151/**
152 * struct fw_cdev_event_iso_resource - Iso resources were allocated or freed 152 * struct fw_cdev_event_iso_resource - Iso resources were allocated or freed
153 * @closure: See &fw_cdev_event_common; 153 * @closure: See &fw_cdev_event_common;
154 * set by %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE ioctl 154 * set by %FW_CDEV_IOC_(DE)ALLOCATE_ISO_RESOURCE(_ONCE) ioctl
155 * @type: %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or 155 * @type: %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or
156 * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 156 * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED
157 * @handle: Reference by which an allocated resource can be deallocated 157 * @handle: Reference by which an allocated resource can be deallocated
@@ -164,12 +164,12 @@ struct fw_cdev_event_iso_interrupt {
164 * resource was allocated at the IRM. The client has to check @channel and 164 * resource was allocated at the IRM. The client has to check @channel and
165 * @bandwidth for whether the allocation actually succeeded. 165 * @bandwidth for whether the allocation actually succeeded.
166 * 166 *
167 * @channel is <0 if no channel was allocated.
168 * @bandwidth is 0 if no bandwidth was allocated.
169 *
170 * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event is sent after an isochronous 167 * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event is sent after an isochronous
171 * resource was deallocated at the IRM. It is also sent when automatic 168 * resource was deallocated at the IRM. It is also sent when automatic
172 * reallocation after a bus reset failed. 169 * reallocation after a bus reset failed.
170 *
171 * @channel is <0 if no channel was (de)allocated or if reallocation failed.
172 * @bandwidth is 0 if no bandwidth was (de)allocated or if reallocation failed.
173 */ 173 */
174struct fw_cdev_event_iso_resource { 174struct fw_cdev_event_iso_resource {
175 __u64 closure; 175 __u64 closure;
@@ -225,8 +225,10 @@ union fw_cdev_event {
225#define FW_CDEV_IOC_GET_CYCLE_TIMER _IOR('#', 0x0c, struct fw_cdev_get_cycle_timer) 225#define FW_CDEV_IOC_GET_CYCLE_TIMER _IOR('#', 0x0c, struct fw_cdev_get_cycle_timer)
226 226
227/* available since kernel version 2.6.30 */ 227/* available since kernel version 2.6.30 */
228#define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE _IOWR('#', 0x0d, struct fw_cdev_allocate_iso_resource) 228#define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE _IOWR('#', 0x0d, struct fw_cdev_allocate_iso_resource)
229#define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE _IOW('#', 0x0e, struct fw_cdev_deallocate) 229#define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE _IOW('#', 0x0e, struct fw_cdev_deallocate)
230#define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x0f, struct fw_cdev_allocate_iso_resource)
231#define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x10, struct fw_cdev_allocate_iso_resource)
230 232
231/* FW_CDEV_VERSION History 233/* FW_CDEV_VERSION History
232 * 234 *
@@ -523,11 +525,12 @@ struct fw_cdev_get_cycle_timer {
523}; 525};
524 526
525/** 527/**
526 * struct fw_cdev_allocate_iso_resource - Allocate a channel or bandwidth 528 * struct fw_cdev_allocate_iso_resource - (De)allocate a channel or bandwidth
527 * @closure: Passed back to userspace in correponding iso resource events 529 * @closure: Passed back to userspace in correponding iso resource events
528 * @channels: Isochronous channels of which one is to be allocated 530 * @channels: Isochronous channels of which one is to be (de)allocated
529 * @bandwidth: Isochronous bandwidth units to be allocated 531 * @bandwidth: Isochronous bandwidth units to be (de)allocated
530 * @handle: Handle to the allocation, written by the kernel 532 * @handle: Handle to the allocation, written by the kernel (only valid in
533 * case of %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE ioctls)
531 * 534 *
532 * The %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE ioctl initiates allocation of an 535 * The %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE ioctl initiates allocation of an
533 * isochronous channel and/or of isochronous bandwidth at the isochronous 536 * isochronous channel and/or of isochronous bandwidth at the isochronous
@@ -539,6 +542,25 @@ struct fw_cdev_get_cycle_timer {
539 * will be sent. The kernel will also automatically deallocate the resources 542 * will be sent. The kernel will also automatically deallocate the resources
540 * when the file descriptor is closed. 543 * when the file descriptor is closed.
541 * 544 *
545 * The %FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE ioctl can be used to initiate
546 * deallocation of resources which were allocated as described above.
547 * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event concludes this operation.
548 *
549 * The %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE ioctl is a variant of allocation
550 * without automatic re- or deallocation.
551 * An %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED event concludes this operation,
552 * indicating success or failure in its data.
553 *
554 * The %FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE ioctl works like
555 * %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE except that resources are freed
556 * instead of allocated. At most one channel may be specified in this ioctl.
557 * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event concludes this operation.
558 *
559 * To summarize, %FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE allocates iso resources
560 * for the lifetime of the fd or handle.
561 * In contrast, %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE allocates iso resources
562 * for the duration of a bus generation.
563 *
542 * @channels is a host-endian bitfield with the most significant bit 564 * @channels is a host-endian bitfield with the most significant bit
543 * representing channel 0 and the least significant bit representing channel 63: 565 * representing channel 0 and the least significant bit representing channel 63:
544 * 1ULL << (63 - c) 566 * 1ULL << (63 - c)