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