diff options
Diffstat (limited to 'include/linux/firewire-cdev.h')
-rw-r--r-- | include/linux/firewire-cdev.h | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index 1f716d9f714..40b11013408 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 |
@@ -380,7 +387,7 @@ struct fw_cdev_initiate_bus_reset { | |||
380 | * @immediate: If non-zero, immediate key to insert before pointer | 387 | * @immediate: If non-zero, immediate key to insert before pointer |
381 | * @key: Upper 8 bits of root directory pointer | 388 | * @key: Upper 8 bits of root directory pointer |
382 | * @data: Userspace pointer to contents of descriptor block | 389 | * @data: Userspace pointer to contents of descriptor block |
383 | * @length: Length of descriptor block data, in bytes | 390 | * @length: Length of descriptor block data, in quadlets |
384 | * @handle: Handle to the descriptor, written by the kernel | 391 | * @handle: Handle to the descriptor, written by the kernel |
385 | * | 392 | * |
386 | * 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 |
@@ -394,6 +401,8 @@ struct fw_cdev_initiate_bus_reset { | |||
394 | * 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 |
395 | * inserted before the root directory pointer. | 402 | * inserted before the root directory pointer. |
396 | * | 403 | * |
404 | * @immediate, @key, and @data array elements are CPU-endian quadlets. | ||
405 | * | ||
397 | * 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 |
398 | * 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 |
399 | * immediate key. | 408 | * immediate key. |
@@ -542,14 +551,18 @@ struct fw_cdev_stop_iso { | |||
542 | /** | 551 | /** |
543 | * struct fw_cdev_get_cycle_timer - read cycle timer register | 552 | * struct fw_cdev_get_cycle_timer - read cycle timer register |
544 | * @local_time: system time, in microseconds since the Epoch | 553 | * @local_time: system time, in microseconds since the Epoch |
545 | * @cycle_timer: isochronous cycle timer, as per OHCI 1.1 clause 5.13 | 554 | * @cycle_timer: Cycle Time register contents |
546 | * | 555 | * |
547 | * 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 |
548 | * 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 |
549 | * isochronous packet as a system time with microsecond accuracy. | 558 | * receive time of an isochronous packet as a system time. |
550 | * | 559 | * |
551 | * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and | 560 | * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and |
552 | * 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. | ||
553 | */ | 566 | */ |
554 | struct fw_cdev_get_cycle_timer { | 567 | struct fw_cdev_get_cycle_timer { |
555 | __u64 local_time; | 568 | __u64 local_time; |
@@ -557,6 +570,25 @@ struct fw_cdev_get_cycle_timer { | |||
557 | }; | 570 | }; |
558 | 571 | ||
559 | /** | 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 | */ | ||
584 | struct fw_cdev_get_cycle_timer2 { | ||
585 | __s64 tv_sec; | ||
586 | __s32 tv_nsec; | ||
587 | __s32 clk_id; | ||
588 | __u32 cycle_timer; | ||
589 | }; | ||
590 | |||
591 | /** | ||
560 | * 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 |
561 | * @closure: Passed back to userspace in correponding iso resource events | 593 | * @closure: Passed back to userspace in correponding iso resource events |
562 | * @channels: Isochronous channels of which one is to be (de)allocated | 594 | * @channels: Isochronous channels of which one is to be (de)allocated |