aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/firewire-cdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/firewire-cdev.h')
-rw-r--r--include/linux/firewire-cdev.h47
1 files changed, 41 insertions, 6 deletions
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index c6b3ca3af6df..40b11013408e 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -248,13 +248,20 @@ union fw_cdev_event {
248#define FW_CDEV_IOC_SEND_BROADCAST_REQUEST _IOW('#', 0x12, struct fw_cdev_send_request) 248#define FW_CDEV_IOC_SEND_BROADCAST_REQUEST _IOW('#', 0x12, struct fw_cdev_send_request)
249#define FW_CDEV_IOC_SEND_STREAM_PACKET _IOW('#', 0x13, struct fw_cdev_send_stream_packet) 249#define FW_CDEV_IOC_SEND_STREAM_PACKET _IOW('#', 0x13, struct fw_cdev_send_stream_packet)
250 250
251/* available since kernel version 2.6.34 */
252#define FW_CDEV_IOC_GET_CYCLE_TIMER2 _IOWR('#', 0x14, struct fw_cdev_get_cycle_timer2)
253
251/* 254/*
252 * FW_CDEV_VERSION History 255 * FW_CDEV_VERSION History
253 * 1 (2.6.22) - initial version 256 * 1 (2.6.22) - initial version
254 * 2 (2.6.30) - changed &fw_cdev_event_iso_interrupt.header if 257 * 2 (2.6.30) - changed &fw_cdev_event_iso_interrupt.header if
255 * &fw_cdev_create_iso_context.header_size is 8 or more 258 * &fw_cdev_create_iso_context.header_size is 8 or more
259 * (2.6.32) - added time stamp to xmit &fw_cdev_event_iso_interrupt
260 * (2.6.33) - IR has always packet-per-buffer semantics now, not one of
261 * dual-buffer or packet-per-buffer depending on hardware
262 * 3 (2.6.34) - made &fw_cdev_get_cycle_timer reliable
256 */ 263 */
257#define FW_CDEV_VERSION 2 264#define FW_CDEV_VERSION 3
258 265
259/** 266/**
260 * struct fw_cdev_get_info - General purpose information ioctl 267 * struct fw_cdev_get_info - General purpose information ioctl
@@ -340,6 +347,9 @@ struct fw_cdev_send_response {
340 * The @closure field is passed back to userspace in the response event. 347 * The @closure field is passed back to userspace in the response event.
341 * The @handle field is an out parameter, returning a handle to the allocated 348 * The @handle field is an out parameter, returning a handle to the allocated
342 * range to be used for later deallocation of the range. 349 * range to be used for later deallocation of the range.
350 *
351 * The address range is allocated on all local nodes. The address allocation
352 * is exclusive except for the FCP command and response registers.
343 */ 353 */
344struct fw_cdev_allocate { 354struct fw_cdev_allocate {
345 __u64 offset; 355 __u64 offset;
@@ -377,7 +387,7 @@ struct fw_cdev_initiate_bus_reset {
377 * @immediate: If non-zero, immediate key to insert before pointer 387 * @immediate: If non-zero, immediate key to insert before pointer
378 * @key: Upper 8 bits of root directory pointer 388 * @key: Upper 8 bits of root directory pointer
379 * @data: Userspace pointer to contents of descriptor block 389 * @data: Userspace pointer to contents of descriptor block
380 * @length: Length of descriptor block data, in bytes 390 * @length: Length of descriptor block data, in quadlets
381 * @handle: Handle to the descriptor, written by the kernel 391 * @handle: Handle to the descriptor, written by the kernel
382 * 392 *
383 * Add a descriptor block and optionally a preceding immediate key to the local 393 * Add a descriptor block and optionally a preceding immediate key to the local
@@ -391,6 +401,8 @@ struct fw_cdev_initiate_bus_reset {
391 * If not 0, the @immediate field specifies an immediate key which will be 401 * If not 0, the @immediate field specifies an immediate key which will be
392 * inserted before the root directory pointer. 402 * inserted before the root directory pointer.
393 * 403 *
404 * @immediate, @key, and @data array elements are CPU-endian quadlets.
405 *
394 * If successful, the kernel adds the descriptor and writes back a handle to the 406 * If successful, the kernel adds the descriptor and writes back a handle to the
395 * kernel-side object to be used for later removal of the descriptor block and 407 * kernel-side object to be used for later removal of the descriptor block and
396 * immediate key. 408 * immediate key.
@@ -539,14 +551,18 @@ struct fw_cdev_stop_iso {
539/** 551/**
540 * struct fw_cdev_get_cycle_timer - read cycle timer register 552 * struct fw_cdev_get_cycle_timer - read cycle timer register
541 * @local_time: system time, in microseconds since the Epoch 553 * @local_time: system time, in microseconds since the Epoch
542 * @cycle_timer: isochronous cycle timer, as per OHCI 1.1 clause 5.13 554 * @cycle_timer: Cycle Time register contents
543 * 555 *
544 * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer 556 * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer
545 * and also the system clock. This allows to express the receive time of an 557 * and also the system clock (%CLOCK_REALTIME). This allows to express the
546 * isochronous packet as a system time with microsecond accuracy. 558 * receive time of an isochronous packet as a system time.
547 * 559 *
548 * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and 560 * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and
549 * 12 bits cycleOffset, in host byte order. 561 * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register
562 * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394.
563 *
564 * In version 1 and 2 of the ABI, this ioctl returned unreliable (non-
565 * monotonic) @cycle_timer values on certain controllers.
550 */ 566 */
551struct fw_cdev_get_cycle_timer { 567struct fw_cdev_get_cycle_timer {
552 __u64 local_time; 568 __u64 local_time;
@@ -554,6 +570,25 @@ struct fw_cdev_get_cycle_timer {
554}; 570};
555 571
556/** 572/**
573 * struct fw_cdev_get_cycle_timer2 - read cycle timer register
574 * @tv_sec: system time, seconds
575 * @tv_nsec: system time, sub-seconds part in nanoseconds
576 * @clk_id: input parameter, clock from which to get the system time
577 * @cycle_timer: Cycle Time register contents
578 *
579 * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 works like
580 * %FW_CDEV_IOC_GET_CYCLE_TIMER but lets you choose a clock like with POSIX'
581 * clock_gettime function. Supported @clk_id values are POSIX' %CLOCK_REALTIME
582 * and %CLOCK_MONOTONIC and Linux' %CLOCK_MONOTONIC_RAW.
583 */
584struct fw_cdev_get_cycle_timer2 {
585 __s64 tv_sec;
586 __s32 tv_nsec;
587 __s32 clk_id;
588 __u32 cycle_timer;
589};
590
591/**
557 * struct fw_cdev_allocate_iso_resource - (De)allocate a channel or bandwidth 592 * struct fw_cdev_allocate_iso_resource - (De)allocate a channel or bandwidth
558 * @closure: Passed back to userspace in correponding iso resource events 593 * @closure: Passed back to userspace in correponding iso resource events
559 * @channels: Isochronous channels of which one is to be (de)allocated 594 * @channels: Isochronous channels of which one is to be (de)allocated