1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _LINUX_FIREWIRE_CDEV_H
20 #define _LINUX_FIREWIRE_CDEV_H
21 #include <linux/ioctl.h>
22 #include <linux/types.h>
23 #include <linux/firewire-constants.h>
24 #define FW_CDEV_EVENT_BUS_RESET 0x00
25 #define FW_CDEV_EVENT_RESPONSE 0x01
26 #define FW_CDEV_EVENT_REQUEST 0x02
27 #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03
28 #define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04
29 #define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05
30 #define FW_CDEV_EVENT_REQUEST2 0x06
31 #define FW_CDEV_EVENT_PHY_PACKET_SENT 0x07
32 #define FW_CDEV_EVENT_PHY_PACKET_RECEIVED 0x08
33 #define FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL 0x09
34 struct fw_cdev_event_common {
35   __u64 closure;
36   __u32 type;
37 };
38 struct fw_cdev_event_bus_reset {
39   __u64 closure;
40   __u32 type;
41   __u32 node_id;
42   __u32 local_node_id;
43   __u32 bm_node_id;
44   __u32 irm_node_id;
45   __u32 root_node_id;
46   __u32 generation;
47 };
48 struct fw_cdev_event_response {
49   __u64 closure;
50   __u32 type;
51   __u32 rcode;
52   __u32 length;
53   __u32 data[0];
54 };
55 struct fw_cdev_event_request {
56   __u64 closure;
57   __u32 type;
58   __u32 tcode;
59   __u64 offset;
60   __u32 handle;
61   __u32 length;
62   __u32 data[0];
63 };
64 struct fw_cdev_event_request2 {
65   __u64 closure;
66   __u32 type;
67   __u32 tcode;
68   __u64 offset;
69   __u32 source_node_id;
70   __u32 destination_node_id;
71   __u32 card;
72   __u32 generation;
73   __u32 handle;
74   __u32 length;
75   __u32 data[0];
76 };
77 struct fw_cdev_event_iso_interrupt {
78   __u64 closure;
79   __u32 type;
80   __u32 cycle;
81   __u32 header_length;
82   __u32 header[0];
83 };
84 struct fw_cdev_event_iso_interrupt_mc {
85   __u64 closure;
86   __u32 type;
87   __u32 completed;
88 };
89 struct fw_cdev_event_iso_resource {
90   __u64 closure;
91   __u32 type;
92   __u32 handle;
93   __s32 channel;
94   __s32 bandwidth;
95 };
96 struct fw_cdev_event_phy_packet {
97   __u64 closure;
98   __u32 type;
99   __u32 rcode;
100   __u32 length;
101   __u32 data[0];
102 };
103 union fw_cdev_event {
104   struct fw_cdev_event_common common;
105   struct fw_cdev_event_bus_reset bus_reset;
106   struct fw_cdev_event_response response;
107   struct fw_cdev_event_request request;
108   struct fw_cdev_event_request2 request2;
109   struct fw_cdev_event_iso_interrupt iso_interrupt;
110   struct fw_cdev_event_iso_interrupt_mc iso_interrupt_mc;
111   struct fw_cdev_event_iso_resource iso_resource;
112   struct fw_cdev_event_phy_packet phy_packet;
113 };
114 #define FW_CDEV_IOC_GET_INFO _IOWR('#', 0x00, struct fw_cdev_get_info)
115 #define FW_CDEV_IOC_SEND_REQUEST _IOW('#', 0x01, struct fw_cdev_send_request)
116 #define FW_CDEV_IOC_ALLOCATE _IOWR('#', 0x02, struct fw_cdev_allocate)
117 #define FW_CDEV_IOC_DEALLOCATE _IOW('#', 0x03, struct fw_cdev_deallocate)
118 #define FW_CDEV_IOC_SEND_RESPONSE _IOW('#', 0x04, struct fw_cdev_send_response)
119 #define FW_CDEV_IOC_INITIATE_BUS_RESET _IOW('#', 0x05, struct fw_cdev_initiate_bus_reset)
120 #define FW_CDEV_IOC_ADD_DESCRIPTOR _IOWR('#', 0x06, struct fw_cdev_add_descriptor)
121 #define FW_CDEV_IOC_REMOVE_DESCRIPTOR _IOW('#', 0x07, struct fw_cdev_remove_descriptor)
122 #define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IOWR('#', 0x08, struct fw_cdev_create_iso_context)
123 #define FW_CDEV_IOC_QUEUE_ISO _IOWR('#', 0x09, struct fw_cdev_queue_iso)
124 #define FW_CDEV_IOC_START_ISO _IOW('#', 0x0a, struct fw_cdev_start_iso)
125 #define FW_CDEV_IOC_STOP_ISO _IOW('#', 0x0b, struct fw_cdev_stop_iso)
126 #define FW_CDEV_IOC_GET_CYCLE_TIMER _IOR('#', 0x0c, struct fw_cdev_get_cycle_timer)
127 #define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE _IOWR('#', 0x0d, struct fw_cdev_allocate_iso_resource)
128 #define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE _IOW('#', 0x0e, struct fw_cdev_deallocate)
129 #define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x0f, struct fw_cdev_allocate_iso_resource)
130 #define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x10, struct fw_cdev_allocate_iso_resource)
131 #define FW_CDEV_IOC_GET_SPEED _IO('#', 0x11)
132 #define FW_CDEV_IOC_SEND_BROADCAST_REQUEST _IOW('#', 0x12, struct fw_cdev_send_request)
133 #define FW_CDEV_IOC_SEND_STREAM_PACKET _IOW('#', 0x13, struct fw_cdev_send_stream_packet)
134 #define FW_CDEV_IOC_GET_CYCLE_TIMER2 _IOWR('#', 0x14, struct fw_cdev_get_cycle_timer2)
135 #define FW_CDEV_IOC_SEND_PHY_PACKET _IOWR('#', 0x15, struct fw_cdev_send_phy_packet)
136 #define FW_CDEV_IOC_RECEIVE_PHY_PACKETS _IOW('#', 0x16, struct fw_cdev_receive_phy_packets)
137 #define FW_CDEV_IOC_SET_ISO_CHANNELS _IOW('#', 0x17, struct fw_cdev_set_iso_channels)
138 #define FW_CDEV_IOC_FLUSH_ISO _IOW('#', 0x18, struct fw_cdev_flush_iso)
139 struct fw_cdev_get_info {
140   __u32 version;
141   __u32 rom_length;
142   __u64 rom;
143   __u64 bus_reset;
144   __u64 bus_reset_closure;
145   __u32 card;
146 };
147 struct fw_cdev_send_request {
148   __u32 tcode;
149   __u32 length;
150   __u64 offset;
151   __u64 closure;
152   __u64 data;
153   __u32 generation;
154 };
155 struct fw_cdev_send_response {
156   __u32 rcode;
157   __u32 length;
158   __u64 data;
159   __u32 handle;
160 };
161 struct fw_cdev_allocate {
162   __u64 offset;
163   __u64 closure;
164   __u32 length;
165   __u32 handle;
166   __u64 region_end;
167 };
168 struct fw_cdev_deallocate {
169   __u32 handle;
170 };
171 #define FW_CDEV_LONG_RESET 0
172 #define FW_CDEV_SHORT_RESET 1
173 struct fw_cdev_initiate_bus_reset {
174   __u32 type;
175 };
176 struct fw_cdev_add_descriptor {
177   __u32 immediate;
178   __u32 key;
179   __u64 data;
180   __u32 length;
181   __u32 handle;
182 };
183 struct fw_cdev_remove_descriptor {
184   __u32 handle;
185 };
186 #define FW_CDEV_ISO_CONTEXT_TRANSMIT 0
187 #define FW_CDEV_ISO_CONTEXT_RECEIVE 1
188 #define FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL 2
189 struct fw_cdev_create_iso_context {
190   __u32 type;
191   __u32 header_size;
192   __u32 channel;
193   __u32 speed;
194   __u64 closure;
195   __u32 handle;
196 };
197 struct fw_cdev_set_iso_channels {
198   __u64 channels;
199   __u32 handle;
200 };
201 #define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v)
202 #define FW_CDEV_ISO_INTERRUPT (1 << 16)
203 #define FW_CDEV_ISO_SKIP (1 << 17)
204 #define FW_CDEV_ISO_SYNC (1 << 17)
205 #define FW_CDEV_ISO_TAG(v) ((v) << 18)
206 #define FW_CDEV_ISO_SY(v) ((v) << 20)
207 #define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24)
208 struct fw_cdev_iso_packet {
209   __u32 control;
210   __u32 header[0];
211 };
212 struct fw_cdev_queue_iso {
213   __u64 packets;
214   __u64 data;
215   __u32 size;
216   __u32 handle;
217 };
218 #define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1
219 #define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2
220 #define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4
221 #define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8
222 #define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15
223 struct fw_cdev_start_iso {
224   __s32 cycle;
225   __u32 sync;
226   __u32 tags;
227   __u32 handle;
228 };
229 struct fw_cdev_stop_iso {
230   __u32 handle;
231 };
232 struct fw_cdev_flush_iso {
233   __u32 handle;
234 };
235 struct fw_cdev_get_cycle_timer {
236   __u64 local_time;
237   __u32 cycle_timer;
238 };
239 struct fw_cdev_get_cycle_timer2 {
240   __s64 tv_sec;
241   __s32 tv_nsec;
242   __s32 clk_id;
243   __u32 cycle_timer;
244 };
245 struct fw_cdev_allocate_iso_resource {
246   __u64 closure;
247   __u64 channels;
248   __u32 bandwidth;
249   __u32 handle;
250 };
251 struct fw_cdev_send_stream_packet {
252   __u32 length;
253   __u32 tag;
254   __u32 channel;
255   __u32 sy;
256   __u64 closure;
257   __u64 data;
258   __u32 generation;
259   __u32 speed;
260 };
261 struct fw_cdev_send_phy_packet {
262   __u64 closure;
263   __u32 data[2];
264   __u32 generation;
265 };
266 struct fw_cdev_receive_phy_packets {
267   __u64 closure;
268 };
269 #define FW_CDEV_VERSION 3
270 #endif
271