blob: 73a6a9b9026dac24347d9ed9d4e462b35da59b06 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#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
Ben Cheng655a7c02013-10-16 16:09:24 -070027#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
Ben Cheng655a7c02013-10-16 16:09:24 -070031#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
Christopher Ferris8666d042023-09-06 14:55:31 -070034#define FW_CDEV_EVENT_REQUEST3 0x0a
35#define FW_CDEV_EVENT_RESPONSE2 0x0b
36#define FW_CDEV_EVENT_PHY_PACKET_SENT2 0x0c
37#define FW_CDEV_EVENT_PHY_PACKET_RECEIVED2 0x0d
Ben Cheng655a7c02013-10-16 16:09:24 -070038struct fw_cdev_event_common {
Tao Baod7db5942015-01-28 10:07:51 -080039 __u64 closure;
40 __u32 type;
Ben Cheng655a7c02013-10-16 16:09:24 -070041};
42struct fw_cdev_event_bus_reset {
Tao Baod7db5942015-01-28 10:07:51 -080043 __u64 closure;
44 __u32 type;
45 __u32 node_id;
46 __u32 local_node_id;
Tao Baod7db5942015-01-28 10:07:51 -080047 __u32 bm_node_id;
48 __u32 irm_node_id;
49 __u32 root_node_id;
50 __u32 generation;
Ben Cheng655a7c02013-10-16 16:09:24 -070051};
52struct fw_cdev_event_response {
Tao Baod7db5942015-01-28 10:07:51 -080053 __u64 closure;
54 __u32 type;
Tao Baod7db5942015-01-28 10:07:51 -080055 __u32 rcode;
56 __u32 length;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070057 __u32 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -070058};
Christopher Ferris8666d042023-09-06 14:55:31 -070059struct fw_cdev_event_response2 {
60 __u64 closure;
61 __u32 type;
62 __u32 rcode;
63 __u32 length;
64 __u32 request_tstamp;
65 __u32 response_tstamp;
66 __u32 padding;
67 __u32 data[];
68};
Ben Cheng655a7c02013-10-16 16:09:24 -070069struct fw_cdev_event_request {
Tao Baod7db5942015-01-28 10:07:51 -080070 __u64 closure;
71 __u32 type;
72 __u32 tcode;
Tao Baod7db5942015-01-28 10:07:51 -080073 __u64 offset;
74 __u32 handle;
75 __u32 length;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070076 __u32 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -070077};
78struct fw_cdev_event_request2 {
Tao Baod7db5942015-01-28 10:07:51 -080079 __u64 closure;
80 __u32 type;
Tao Baod7db5942015-01-28 10:07:51 -080081 __u32 tcode;
82 __u64 offset;
83 __u32 source_node_id;
84 __u32 destination_node_id;
Tao Baod7db5942015-01-28 10:07:51 -080085 __u32 card;
86 __u32 generation;
87 __u32 handle;
88 __u32 length;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070089 __u32 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -070090};
Christopher Ferris8666d042023-09-06 14:55:31 -070091struct fw_cdev_event_request3 {
92 __u64 closure;
93 __u32 type;
94 __u32 tcode;
95 __u64 offset;
96 __u32 source_node_id;
97 __u32 destination_node_id;
98 __u32 card;
99 __u32 generation;
100 __u32 handle;
101 __u32 length;
102 __u32 tstamp;
103 __u32 padding;
104 __u32 data[];
105};
Ben Cheng655a7c02013-10-16 16:09:24 -0700106struct fw_cdev_event_iso_interrupt {
Tao Baod7db5942015-01-28 10:07:51 -0800107 __u64 closure;
Tao Baod7db5942015-01-28 10:07:51 -0800108 __u32 type;
109 __u32 cycle;
110 __u32 header_length;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700111 __u32 header[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700112};
113struct fw_cdev_event_iso_interrupt_mc {
Tao Baod7db5942015-01-28 10:07:51 -0800114 __u64 closure;
115 __u32 type;
Tao Baod7db5942015-01-28 10:07:51 -0800116 __u32 completed;
Ben Cheng655a7c02013-10-16 16:09:24 -0700117};
118struct fw_cdev_event_iso_resource {
Tao Baod7db5942015-01-28 10:07:51 -0800119 __u64 closure;
Tao Baod7db5942015-01-28 10:07:51 -0800120 __u32 type;
121 __u32 handle;
122 __s32 channel;
123 __s32 bandwidth;
Ben Cheng655a7c02013-10-16 16:09:24 -0700124};
125struct fw_cdev_event_phy_packet {
Tao Baod7db5942015-01-28 10:07:51 -0800126 __u64 closure;
127 __u32 type;
Tao Baod7db5942015-01-28 10:07:51 -0800128 __u32 rcode;
129 __u32 length;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700130 __u32 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700131};
Christopher Ferris8666d042023-09-06 14:55:31 -0700132struct fw_cdev_event_phy_packet2 {
133 __u64 closure;
134 __u32 type;
135 __u32 rcode;
136 __u32 length;
137 __u32 tstamp;
138 __u32 data[];
139};
Ben Cheng655a7c02013-10-16 16:09:24 -0700140union fw_cdev_event {
Tao Baod7db5942015-01-28 10:07:51 -0800141 struct fw_cdev_event_common common;
142 struct fw_cdev_event_bus_reset bus_reset;
143 struct fw_cdev_event_response response;
Tao Baod7db5942015-01-28 10:07:51 -0800144 struct fw_cdev_event_request request;
145 struct fw_cdev_event_request2 request2;
146 struct fw_cdev_event_iso_interrupt iso_interrupt;
147 struct fw_cdev_event_iso_interrupt_mc iso_interrupt_mc;
Tao Baod7db5942015-01-28 10:07:51 -0800148 struct fw_cdev_event_iso_resource iso_resource;
149 struct fw_cdev_event_phy_packet phy_packet;
Christopher Ferris8666d042023-09-06 14:55:31 -0700150 struct fw_cdev_event_request3 request3;
151 struct fw_cdev_event_response2 response2;
152 struct fw_cdev_event_phy_packet2 phy_packet2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700153};
154#define FW_CDEV_IOC_GET_INFO _IOWR('#', 0x00, struct fw_cdev_get_info)
Ben Cheng655a7c02013-10-16 16:09:24 -0700155#define FW_CDEV_IOC_SEND_REQUEST _IOW('#', 0x01, struct fw_cdev_send_request)
156#define FW_CDEV_IOC_ALLOCATE _IOWR('#', 0x02, struct fw_cdev_allocate)
157#define FW_CDEV_IOC_DEALLOCATE _IOW('#', 0x03, struct fw_cdev_deallocate)
158#define FW_CDEV_IOC_SEND_RESPONSE _IOW('#', 0x04, struct fw_cdev_send_response)
Ben Cheng655a7c02013-10-16 16:09:24 -0700159#define FW_CDEV_IOC_INITIATE_BUS_RESET _IOW('#', 0x05, struct fw_cdev_initiate_bus_reset)
160#define FW_CDEV_IOC_ADD_DESCRIPTOR _IOWR('#', 0x06, struct fw_cdev_add_descriptor)
161#define FW_CDEV_IOC_REMOVE_DESCRIPTOR _IOW('#', 0x07, struct fw_cdev_remove_descriptor)
162#define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IOWR('#', 0x08, struct fw_cdev_create_iso_context)
Ben Cheng655a7c02013-10-16 16:09:24 -0700163#define FW_CDEV_IOC_QUEUE_ISO _IOWR('#', 0x09, struct fw_cdev_queue_iso)
164#define FW_CDEV_IOC_START_ISO _IOW('#', 0x0a, struct fw_cdev_start_iso)
165#define FW_CDEV_IOC_STOP_ISO _IOW('#', 0x0b, struct fw_cdev_stop_iso)
166#define FW_CDEV_IOC_GET_CYCLE_TIMER _IOR('#', 0x0c, struct fw_cdev_get_cycle_timer)
Ben Cheng655a7c02013-10-16 16:09:24 -0700167#define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE _IOWR('#', 0x0d, struct fw_cdev_allocate_iso_resource)
168#define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE _IOW('#', 0x0e, struct fw_cdev_deallocate)
169#define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x0f, struct fw_cdev_allocate_iso_resource)
170#define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x10, struct fw_cdev_allocate_iso_resource)
Ben Cheng655a7c02013-10-16 16:09:24 -0700171#define FW_CDEV_IOC_GET_SPEED _IO('#', 0x11)
172#define FW_CDEV_IOC_SEND_BROADCAST_REQUEST _IOW('#', 0x12, struct fw_cdev_send_request)
173#define FW_CDEV_IOC_SEND_STREAM_PACKET _IOW('#', 0x13, struct fw_cdev_send_stream_packet)
174#define FW_CDEV_IOC_GET_CYCLE_TIMER2 _IOWR('#', 0x14, struct fw_cdev_get_cycle_timer2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700175#define FW_CDEV_IOC_SEND_PHY_PACKET _IOWR('#', 0x15, struct fw_cdev_send_phy_packet)
176#define FW_CDEV_IOC_RECEIVE_PHY_PACKETS _IOW('#', 0x16, struct fw_cdev_receive_phy_packets)
177#define FW_CDEV_IOC_SET_ISO_CHANNELS _IOW('#', 0x17, struct fw_cdev_set_iso_channels)
178#define FW_CDEV_IOC_FLUSH_ISO _IOW('#', 0x18, struct fw_cdev_flush_iso)
Ben Cheng655a7c02013-10-16 16:09:24 -0700179struct fw_cdev_get_info {
Tao Baod7db5942015-01-28 10:07:51 -0800180 __u32 version;
181 __u32 rom_length;
182 __u64 rom;
Tao Baod7db5942015-01-28 10:07:51 -0800183 __u64 bus_reset;
184 __u64 bus_reset_closure;
185 __u32 card;
Ben Cheng655a7c02013-10-16 16:09:24 -0700186};
Ben Cheng655a7c02013-10-16 16:09:24 -0700187struct fw_cdev_send_request {
Tao Baod7db5942015-01-28 10:07:51 -0800188 __u32 tcode;
189 __u32 length;
190 __u64 offset;
Tao Baod7db5942015-01-28 10:07:51 -0800191 __u64 closure;
192 __u64 data;
193 __u32 generation;
Ben Cheng655a7c02013-10-16 16:09:24 -0700194};
Ben Cheng655a7c02013-10-16 16:09:24 -0700195struct fw_cdev_send_response {
Tao Baod7db5942015-01-28 10:07:51 -0800196 __u32 rcode;
197 __u32 length;
198 __u64 data;
Tao Baod7db5942015-01-28 10:07:51 -0800199 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700200};
201struct fw_cdev_allocate {
Tao Baod7db5942015-01-28 10:07:51 -0800202 __u64 offset;
Tao Baod7db5942015-01-28 10:07:51 -0800203 __u64 closure;
204 __u32 length;
205 __u32 handle;
206 __u64 region_end;
Ben Cheng655a7c02013-10-16 16:09:24 -0700207};
208struct fw_cdev_deallocate {
Tao Baod7db5942015-01-28 10:07:51 -0800209 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700210};
Ben Cheng655a7c02013-10-16 16:09:24 -0700211#define FW_CDEV_LONG_RESET 0
212#define FW_CDEV_SHORT_RESET 1
213struct fw_cdev_initiate_bus_reset {
Tao Baod7db5942015-01-28 10:07:51 -0800214 __u32 type;
Ben Cheng655a7c02013-10-16 16:09:24 -0700215};
216struct fw_cdev_add_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800217 __u32 immediate;
218 __u32 key;
Tao Baod7db5942015-01-28 10:07:51 -0800219 __u64 data;
220 __u32 length;
221 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700222};
Ben Cheng655a7c02013-10-16 16:09:24 -0700223struct fw_cdev_remove_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800224 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700225};
226#define FW_CDEV_ISO_CONTEXT_TRANSMIT 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700227#define FW_CDEV_ISO_CONTEXT_RECEIVE 1
228#define FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL 2
229struct fw_cdev_create_iso_context {
Tao Baod7db5942015-01-28 10:07:51 -0800230 __u32 type;
Tao Baod7db5942015-01-28 10:07:51 -0800231 __u32 header_size;
232 __u32 channel;
233 __u32 speed;
234 __u64 closure;
Tao Baod7db5942015-01-28 10:07:51 -0800235 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700236};
237struct fw_cdev_set_iso_channels {
Tao Baod7db5942015-01-28 10:07:51 -0800238 __u64 channels;
Tao Baod7db5942015-01-28 10:07:51 -0800239 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700240};
241#define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v)
242#define FW_CDEV_ISO_INTERRUPT (1 << 16)
Ben Cheng655a7c02013-10-16 16:09:24 -0700243#define FW_CDEV_ISO_SKIP (1 << 17)
244#define FW_CDEV_ISO_SYNC (1 << 17)
245#define FW_CDEV_ISO_TAG(v) ((v) << 18)
246#define FW_CDEV_ISO_SY(v) ((v) << 20)
Ben Cheng655a7c02013-10-16 16:09:24 -0700247#define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24)
248struct fw_cdev_iso_packet {
Tao Baod7db5942015-01-28 10:07:51 -0800249 __u32 control;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700250 __u32 header[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700251};
252struct fw_cdev_queue_iso {
Tao Baod7db5942015-01-28 10:07:51 -0800253 __u64 packets;
254 __u64 data;
Tao Baod7db5942015-01-28 10:07:51 -0800255 __u32 size;
256 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700257};
258#define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700259#define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2
260#define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4
261#define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8
262#define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15
Ben Cheng655a7c02013-10-16 16:09:24 -0700263struct fw_cdev_start_iso {
Tao Baod7db5942015-01-28 10:07:51 -0800264 __s32 cycle;
265 __u32 sync;
266 __u32 tags;
Tao Baod7db5942015-01-28 10:07:51 -0800267 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700268};
269struct fw_cdev_stop_iso {
Tao Baod7db5942015-01-28 10:07:51 -0800270 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700271};
272struct fw_cdev_flush_iso {
Tao Baod7db5942015-01-28 10:07:51 -0800273 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700274};
Ben Cheng655a7c02013-10-16 16:09:24 -0700275struct fw_cdev_get_cycle_timer {
Tao Baod7db5942015-01-28 10:07:51 -0800276 __u64 local_time;
277 __u32 cycle_timer;
Ben Cheng655a7c02013-10-16 16:09:24 -0700278};
Ben Cheng655a7c02013-10-16 16:09:24 -0700279struct fw_cdev_get_cycle_timer2 {
Tao Baod7db5942015-01-28 10:07:51 -0800280 __s64 tv_sec;
281 __s32 tv_nsec;
282 __s32 clk_id;
Tao Baod7db5942015-01-28 10:07:51 -0800283 __u32 cycle_timer;
Ben Cheng655a7c02013-10-16 16:09:24 -0700284};
285struct fw_cdev_allocate_iso_resource {
Tao Baod7db5942015-01-28 10:07:51 -0800286 __u64 closure;
Tao Baod7db5942015-01-28 10:07:51 -0800287 __u64 channels;
288 __u32 bandwidth;
289 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700290};
Ben Cheng655a7c02013-10-16 16:09:24 -0700291struct fw_cdev_send_stream_packet {
Tao Baod7db5942015-01-28 10:07:51 -0800292 __u32 length;
293 __u32 tag;
294 __u32 channel;
Tao Baod7db5942015-01-28 10:07:51 -0800295 __u32 sy;
296 __u64 closure;
297 __u64 data;
298 __u32 generation;
Tao Baod7db5942015-01-28 10:07:51 -0800299 __u32 speed;
Ben Cheng655a7c02013-10-16 16:09:24 -0700300};
301struct fw_cdev_send_phy_packet {
Tao Baod7db5942015-01-28 10:07:51 -0800302 __u64 closure;
Tao Baod7db5942015-01-28 10:07:51 -0800303 __u32 data[2];
304 __u32 generation;
Ben Cheng655a7c02013-10-16 16:09:24 -0700305};
306struct fw_cdev_receive_phy_packets {
Tao Baod7db5942015-01-28 10:07:51 -0800307 __u64 closure;
Ben Cheng655a7c02013-10-16 16:09:24 -0700308};
309#define FW_CDEV_VERSION 3
310#endif