diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/firewire-cdev.h | 78 |
1 files changed, 37 insertions, 41 deletions
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index 4ff09889c5c0..357dbfc2829e 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
@@ -30,10 +30,13 @@ | |||
30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
31 | #include <linux/firewire-constants.h> | 31 | #include <linux/firewire-constants.h> |
32 | 32 | ||
33 | /* available since kernel version 2.6.22 */ | ||
33 | #define FW_CDEV_EVENT_BUS_RESET 0x00 | 34 | #define FW_CDEV_EVENT_BUS_RESET 0x00 |
34 | #define FW_CDEV_EVENT_RESPONSE 0x01 | 35 | #define FW_CDEV_EVENT_RESPONSE 0x01 |
35 | #define FW_CDEV_EVENT_REQUEST 0x02 | 36 | #define FW_CDEV_EVENT_REQUEST 0x02 |
36 | #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 | 37 | #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 |
38 | |||
39 | /* available since kernel version 2.6.30 */ | ||
37 | #define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04 | 40 | #define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04 |
38 | #define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05 | 41 | #define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05 |
39 | 42 | ||
@@ -120,24 +123,11 @@ struct fw_cdev_event_response { | |||
120 | 123 | ||
121 | /** | 124 | /** |
122 | * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2 | 125 | * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2 |
123 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl | ||
124 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST | 126 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST |
125 | * @tcode: See &fw_cdev_event_request2 | ||
126 | * @offset: See &fw_cdev_event_request2 | ||
127 | * @handle: See &fw_cdev_event_request2 | ||
128 | * @length: See &fw_cdev_event_request2 | ||
129 | * @data: See &fw_cdev_event_request2 | ||
130 | * | 127 | * |
131 | * This event is sent instead of &fw_cdev_event_request2 if the kernel or | 128 | * This event is sent instead of &fw_cdev_event_request2 if the kernel or |
132 | * the client implements ABI version <= 3. | 129 | * the client implements ABI version <= 3. &fw_cdev_event_request lacks |
133 | * | 130 | * essential information; use &fw_cdev_event_request2 instead. |
134 | * Unlike &fw_cdev_event_request2, the sender identity cannot be established, | ||
135 | * broadcast write requests cannot be distinguished from unicast writes, and | ||
136 | * @tcode of lock requests is %TCODE_LOCK_REQUEST. | ||
137 | * | ||
138 | * Requests to the FCP_REQUEST or FCP_RESPONSE register are responded to as | ||
139 | * with &fw_cdev_event_request2, except in kernel 2.6.32 and older which send | ||
140 | * the response packet of the client's %FW_CDEV_IOC_SEND_RESPONSE ioctl. | ||
141 | */ | 131 | */ |
142 | struct fw_cdev_event_request { | 132 | struct fw_cdev_event_request { |
143 | __u64 closure; | 133 | __u64 closure; |
@@ -452,29 +442,31 @@ union fw_cdev_event { | |||
452 | * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL, and | 442 | * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL, and |
453 | * %FW_CDEV_IOC_SET_ISO_CHANNELS | 443 | * %FW_CDEV_IOC_SET_ISO_CHANNELS |
454 | */ | 444 | */ |
455 | #define FW_CDEV_VERSION 3 /* Meaningless; don't use this macro. */ | ||
456 | 445 | ||
457 | /** | 446 | /** |
458 | * struct fw_cdev_get_info - General purpose information ioctl | 447 | * struct fw_cdev_get_info - General purpose information ioctl |
459 | * @version: The version field is just a running serial number. Both an | 448 | * @version: The version field is just a running serial number. Both an |
460 | * input parameter (ABI version implemented by the client) and | 449 | * input parameter (ABI version implemented by the client) and |
461 | * output parameter (ABI version implemented by the kernel). | 450 | * output parameter (ABI version implemented by the kernel). |
462 | * A client must not fill in an %FW_CDEV_VERSION defined from an | 451 | * A client shall fill in the ABI @version for which the client |
463 | * included kernel header file but the actual version for which | 452 | * was implemented. This is necessary for forward compatibility. |
464 | * the client was implemented. This is necessary for forward | 453 | * @rom_length: If @rom is non-zero, up to @rom_length bytes of Configuration |
465 | * compatibility. We never break backwards compatibility, but | ||
466 | * may add more structs, events, and ioctls in later revisions. | ||
467 | * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration | ||
468 | * ROM will be copied into that user space address. In either | 454 | * ROM will be copied into that user space address. In either |
469 | * case, @rom_length is updated with the actual length of the | 455 | * case, @rom_length is updated with the actual length of the |
470 | * configuration ROM. | 456 | * Configuration ROM. |
471 | * @rom: If non-zero, address of a buffer to be filled by a copy of the | 457 | * @rom: If non-zero, address of a buffer to be filled by a copy of the |
472 | * device's configuration ROM | 458 | * device's Configuration ROM |
473 | * @bus_reset: If non-zero, address of a buffer to be filled by a | 459 | * @bus_reset: If non-zero, address of a buffer to be filled by a |
474 | * &struct fw_cdev_event_bus_reset with the current state | 460 | * &struct fw_cdev_event_bus_reset with the current state |
475 | * of the bus. This does not cause a bus reset to happen. | 461 | * of the bus. This does not cause a bus reset to happen. |
476 | * @bus_reset_closure: Value of &closure in this and subsequent bus reset events | 462 | * @bus_reset_closure: Value of &closure in this and subsequent bus reset events |
477 | * @card: The index of the card this device belongs to | 463 | * @card: The index of the card this device belongs to |
464 | * | ||
465 | * The %FW_CDEV_IOC_GET_INFO ioctl is usually the very first one which a client | ||
466 | * performs right after it opened a /dev/fw* file. | ||
467 | * | ||
468 | * As a side effect, reception of %FW_CDEV_EVENT_BUS_RESET events to be read(2) | ||
469 | * is started by this ioctl. | ||
478 | */ | 470 | */ |
479 | struct fw_cdev_get_info { | 471 | struct fw_cdev_get_info { |
480 | __u32 version; | 472 | __u32 version; |
@@ -612,7 +604,7 @@ struct fw_cdev_initiate_bus_reset { | |||
612 | * @handle: Handle to the descriptor, written by the kernel | 604 | * @handle: Handle to the descriptor, written by the kernel |
613 | * | 605 | * |
614 | * Add a descriptor block and optionally a preceding immediate key to the local | 606 | * Add a descriptor block and optionally a preceding immediate key to the local |
615 | * node's configuration ROM. | 607 | * node's Configuration ROM. |
616 | * | 608 | * |
617 | * The @key field specifies the upper 8 bits of the descriptor root directory | 609 | * The @key field specifies the upper 8 bits of the descriptor root directory |
618 | * pointer and the @data and @length fields specify the contents. The @key | 610 | * pointer and the @data and @length fields specify the contents. The @key |
@@ -627,9 +619,9 @@ struct fw_cdev_initiate_bus_reset { | |||
627 | * If successful, the kernel adds the descriptor and writes back a @handle to | 619 | * If successful, the kernel adds the descriptor and writes back a @handle to |
628 | * the kernel-side object to be used for later removal of the descriptor block | 620 | * the kernel-side object to be used for later removal of the descriptor block |
629 | * and immediate key. The kernel will also generate a bus reset to signal the | 621 | * and immediate key. The kernel will also generate a bus reset to signal the |
630 | * change of the configuration ROM to other nodes. | 622 | * change of the Configuration ROM to other nodes. |
631 | * | 623 | * |
632 | * This ioctl affects the configuration ROMs of all local nodes. | 624 | * This ioctl affects the Configuration ROMs of all local nodes. |
633 | * The ioctl only succeeds on device files which represent a local node. | 625 | * The ioctl only succeeds on device files which represent a local node. |
634 | */ | 626 | */ |
635 | struct fw_cdev_add_descriptor { | 627 | struct fw_cdev_add_descriptor { |
@@ -641,13 +633,13 @@ struct fw_cdev_add_descriptor { | |||
641 | }; | 633 | }; |
642 | 634 | ||
643 | /** | 635 | /** |
644 | * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM | 636 | * struct fw_cdev_remove_descriptor - Remove contents from the Configuration ROM |
645 | * @handle: Handle to the descriptor, as returned by the kernel when the | 637 | * @handle: Handle to the descriptor, as returned by the kernel when the |
646 | * descriptor was added | 638 | * descriptor was added |
647 | * | 639 | * |
648 | * Remove a descriptor block and accompanying immediate key from the local | 640 | * Remove a descriptor block and accompanying immediate key from the local |
649 | * nodes' configuration ROMs. The kernel will also generate a bus reset to | 641 | * nodes' Configuration ROMs. The kernel will also generate a bus reset to |
650 | * signal the change of the configuration ROM to other nodes. | 642 | * signal the change of the Configuration ROM to other nodes. |
651 | */ | 643 | */ |
652 | struct fw_cdev_remove_descriptor { | 644 | struct fw_cdev_remove_descriptor { |
653 | __u32 handle; | 645 | __u32 handle; |
@@ -863,13 +855,8 @@ struct fw_cdev_stop_iso { | |||
863 | * @local_time: system time, in microseconds since the Epoch | 855 | * @local_time: system time, in microseconds since the Epoch |
864 | * @cycle_timer: Cycle Time register contents | 856 | * @cycle_timer: Cycle Time register contents |
865 | * | 857 | * |
866 | * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer | 858 | * Same as %FW_CDEV_IOC_GET_CYCLE_TIMER2, but fixed to use %CLOCK_REALTIME |
867 | * and also the system clock (%CLOCK_REALTIME). This allows to express the | 859 | * and only with microseconds resolution. |
868 | * receive time of an isochronous packet as a system time. | ||
869 | * | ||
870 | * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and | ||
871 | * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register | ||
872 | * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394. | ||
873 | * | 860 | * |
874 | * In version 1 and 2 of the ABI, this ioctl returned unreliable (non- | 861 | * In version 1 and 2 of the ABI, this ioctl returned unreliable (non- |
875 | * monotonic) @cycle_timer values on certain controllers. | 862 | * monotonic) @cycle_timer values on certain controllers. |
@@ -886,10 +873,17 @@ struct fw_cdev_get_cycle_timer { | |||
886 | * @clk_id: input parameter, clock from which to get the system time | 873 | * @clk_id: input parameter, clock from which to get the system time |
887 | * @cycle_timer: Cycle Time register contents | 874 | * @cycle_timer: Cycle Time register contents |
888 | * | 875 | * |
889 | * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 works like | 876 | * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 ioctl reads the isochronous cycle timer |
890 | * %FW_CDEV_IOC_GET_CYCLE_TIMER but lets you choose a clock like with POSIX' | 877 | * and also the system clock. This allows to correlate reception time of |
891 | * clock_gettime function. Supported @clk_id values are POSIX' %CLOCK_REALTIME | 878 | * isochronous packets with system time. |
892 | * and %CLOCK_MONOTONIC and Linux' %CLOCK_MONOTONIC_RAW. | 879 | * |
880 | * @clk_id lets you choose a clock like with POSIX' clock_gettime function. | ||
881 | * Supported @clk_id values are POSIX' %CLOCK_REALTIME and %CLOCK_MONOTONIC | ||
882 | * and Linux' %CLOCK_MONOTONIC_RAW. | ||
883 | * | ||
884 | * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and | ||
885 | * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register | ||
886 | * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394. | ||
893 | */ | 887 | */ |
894 | struct fw_cdev_get_cycle_timer2 { | 888 | struct fw_cdev_get_cycle_timer2 { |
895 | __s64 tv_sec; | 889 | __s64 tv_sec; |
@@ -1011,4 +1005,6 @@ struct fw_cdev_receive_phy_packets { | |||
1011 | __u64 closure; | 1005 | __u64 closure; |
1012 | }; | 1006 | }; |
1013 | 1007 | ||
1008 | #define FW_CDEV_VERSION 3 /* Meaningless legacy macro; don't use it. */ | ||
1009 | |||
1014 | #endif /* _LINUX_FIREWIRE_CDEV_H */ | 1010 | #endif /* _LINUX_FIREWIRE_CDEV_H */ |