blob: 92957bcb3942832b0a0d66c1c5e2ace2631126f3 [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
34struct fw_cdev_event_common {
Tao Baod7db5942015-01-28 10:07:51 -080035 __u64 closure;
36 __u32 type;
Ben Cheng655a7c02013-10-16 16:09:24 -070037};
38struct fw_cdev_event_bus_reset {
Tao Baod7db5942015-01-28 10:07:51 -080039 __u64 closure;
40 __u32 type;
41 __u32 node_id;
42 __u32 local_node_id;
Tao Baod7db5942015-01-28 10:07:51 -080043 __u32 bm_node_id;
44 __u32 irm_node_id;
45 __u32 root_node_id;
46 __u32 generation;
Ben Cheng655a7c02013-10-16 16:09:24 -070047};
48struct fw_cdev_event_response {
Tao Baod7db5942015-01-28 10:07:51 -080049 __u64 closure;
50 __u32 type;
Tao Baod7db5942015-01-28 10:07:51 -080051 __u32 rcode;
52 __u32 length;
53 __u32 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070054};
Ben Cheng655a7c02013-10-16 16:09:24 -070055struct fw_cdev_event_request {
Tao Baod7db5942015-01-28 10:07:51 -080056 __u64 closure;
57 __u32 type;
58 __u32 tcode;
Tao Baod7db5942015-01-28 10:07:51 -080059 __u64 offset;
60 __u32 handle;
61 __u32 length;
62 __u32 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070063};
64struct fw_cdev_event_request2 {
Tao Baod7db5942015-01-28 10:07:51 -080065 __u64 closure;
66 __u32 type;
Tao Baod7db5942015-01-28 10:07:51 -080067 __u32 tcode;
68 __u64 offset;
69 __u32 source_node_id;
70 __u32 destination_node_id;
Tao Baod7db5942015-01-28 10:07:51 -080071 __u32 card;
72 __u32 generation;
73 __u32 handle;
74 __u32 length;
Tao Baod7db5942015-01-28 10:07:51 -080075 __u32 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070076};
77struct fw_cdev_event_iso_interrupt {
Tao Baod7db5942015-01-28 10:07:51 -080078 __u64 closure;
Tao Baod7db5942015-01-28 10:07:51 -080079 __u32 type;
80 __u32 cycle;
81 __u32 header_length;
82 __u32 header[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070083};
84struct fw_cdev_event_iso_interrupt_mc {
Tao Baod7db5942015-01-28 10:07:51 -080085 __u64 closure;
86 __u32 type;
Tao Baod7db5942015-01-28 10:07:51 -080087 __u32 completed;
Ben Cheng655a7c02013-10-16 16:09:24 -070088};
89struct fw_cdev_event_iso_resource {
Tao Baod7db5942015-01-28 10:07:51 -080090 __u64 closure;
Tao Baod7db5942015-01-28 10:07:51 -080091 __u32 type;
92 __u32 handle;
93 __s32 channel;
94 __s32 bandwidth;
Ben Cheng655a7c02013-10-16 16:09:24 -070095};
96struct fw_cdev_event_phy_packet {
Tao Baod7db5942015-01-28 10:07:51 -080097 __u64 closure;
98 __u32 type;
Tao Baod7db5942015-01-28 10:07:51 -080099 __u32 rcode;
100 __u32 length;
101 __u32 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700102};
Ben Cheng655a7c02013-10-16 16:09:24 -0700103union fw_cdev_event {
Tao Baod7db5942015-01-28 10:07:51 -0800104 struct fw_cdev_event_common common;
105 struct fw_cdev_event_bus_reset bus_reset;
106 struct fw_cdev_event_response response;
Tao Baod7db5942015-01-28 10:07:51 -0800107 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;
Tao Baod7db5942015-01-28 10:07:51 -0800111 struct fw_cdev_event_iso_resource iso_resource;
112 struct fw_cdev_event_phy_packet phy_packet;
Ben Cheng655a7c02013-10-16 16:09:24 -0700113};
114#define FW_CDEV_IOC_GET_INFO _IOWR('#', 0x00, struct fw_cdev_get_info)
Ben Cheng655a7c02013-10-16 16:09:24 -0700115#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)
Ben Cheng655a7c02013-10-16 16:09:24 -0700119#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)
Ben Cheng655a7c02013-10-16 16:09:24 -0700123#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)
Ben Cheng655a7c02013-10-16 16:09:24 -0700127#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)
Ben Cheng655a7c02013-10-16 16:09:24 -0700131#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)
Ben Cheng655a7c02013-10-16 16:09:24 -0700135#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)
Ben Cheng655a7c02013-10-16 16:09:24 -0700139struct fw_cdev_get_info {
Tao Baod7db5942015-01-28 10:07:51 -0800140 __u32 version;
141 __u32 rom_length;
142 __u64 rom;
Tao Baod7db5942015-01-28 10:07:51 -0800143 __u64 bus_reset;
144 __u64 bus_reset_closure;
145 __u32 card;
Ben Cheng655a7c02013-10-16 16:09:24 -0700146};
Ben Cheng655a7c02013-10-16 16:09:24 -0700147struct fw_cdev_send_request {
Tao Baod7db5942015-01-28 10:07:51 -0800148 __u32 tcode;
149 __u32 length;
150 __u64 offset;
Tao Baod7db5942015-01-28 10:07:51 -0800151 __u64 closure;
152 __u64 data;
153 __u32 generation;
Ben Cheng655a7c02013-10-16 16:09:24 -0700154};
Ben Cheng655a7c02013-10-16 16:09:24 -0700155struct fw_cdev_send_response {
Tao Baod7db5942015-01-28 10:07:51 -0800156 __u32 rcode;
157 __u32 length;
158 __u64 data;
Tao Baod7db5942015-01-28 10:07:51 -0800159 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700160};
161struct fw_cdev_allocate {
Tao Baod7db5942015-01-28 10:07:51 -0800162 __u64 offset;
Tao Baod7db5942015-01-28 10:07:51 -0800163 __u64 closure;
164 __u32 length;
165 __u32 handle;
166 __u64 region_end;
Ben Cheng655a7c02013-10-16 16:09:24 -0700167};
168struct fw_cdev_deallocate {
Tao Baod7db5942015-01-28 10:07:51 -0800169 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700170};
Ben Cheng655a7c02013-10-16 16:09:24 -0700171#define FW_CDEV_LONG_RESET 0
172#define FW_CDEV_SHORT_RESET 1
173struct fw_cdev_initiate_bus_reset {
Tao Baod7db5942015-01-28 10:07:51 -0800174 __u32 type;
Ben Cheng655a7c02013-10-16 16:09:24 -0700175};
176struct fw_cdev_add_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800177 __u32 immediate;
178 __u32 key;
Tao Baod7db5942015-01-28 10:07:51 -0800179 __u64 data;
180 __u32 length;
181 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700182};
Ben Cheng655a7c02013-10-16 16:09:24 -0700183struct fw_cdev_remove_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800184 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700185};
186#define FW_CDEV_ISO_CONTEXT_TRANSMIT 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700187#define FW_CDEV_ISO_CONTEXT_RECEIVE 1
188#define FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL 2
189struct fw_cdev_create_iso_context {
Tao Baod7db5942015-01-28 10:07:51 -0800190 __u32 type;
Tao Baod7db5942015-01-28 10:07:51 -0800191 __u32 header_size;
192 __u32 channel;
193 __u32 speed;
194 __u64 closure;
Tao Baod7db5942015-01-28 10:07:51 -0800195 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700196};
197struct fw_cdev_set_iso_channels {
Tao Baod7db5942015-01-28 10:07:51 -0800198 __u64 channels;
Tao Baod7db5942015-01-28 10:07:51 -0800199 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700200};
201#define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v)
202#define FW_CDEV_ISO_INTERRUPT (1 << 16)
Ben Cheng655a7c02013-10-16 16:09:24 -0700203#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)
Ben Cheng655a7c02013-10-16 16:09:24 -0700207#define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24)
208struct fw_cdev_iso_packet {
Tao Baod7db5942015-01-28 10:07:51 -0800209 __u32 control;
210 __u32 header[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700211};
212struct fw_cdev_queue_iso {
Tao Baod7db5942015-01-28 10:07:51 -0800213 __u64 packets;
214 __u64 data;
Tao Baod7db5942015-01-28 10:07:51 -0800215 __u32 size;
216 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700217};
218#define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700219#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
Ben Cheng655a7c02013-10-16 16:09:24 -0700223struct fw_cdev_start_iso {
Tao Baod7db5942015-01-28 10:07:51 -0800224 __s32 cycle;
225 __u32 sync;
226 __u32 tags;
Tao Baod7db5942015-01-28 10:07:51 -0800227 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700228};
229struct fw_cdev_stop_iso {
Tao Baod7db5942015-01-28 10:07:51 -0800230 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700231};
232struct fw_cdev_flush_iso {
Tao Baod7db5942015-01-28 10:07:51 -0800233 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700234};
Ben Cheng655a7c02013-10-16 16:09:24 -0700235struct fw_cdev_get_cycle_timer {
Tao Baod7db5942015-01-28 10:07:51 -0800236 __u64 local_time;
237 __u32 cycle_timer;
Ben Cheng655a7c02013-10-16 16:09:24 -0700238};
Ben Cheng655a7c02013-10-16 16:09:24 -0700239struct fw_cdev_get_cycle_timer2 {
Tao Baod7db5942015-01-28 10:07:51 -0800240 __s64 tv_sec;
241 __s32 tv_nsec;
242 __s32 clk_id;
Tao Baod7db5942015-01-28 10:07:51 -0800243 __u32 cycle_timer;
Ben Cheng655a7c02013-10-16 16:09:24 -0700244};
245struct fw_cdev_allocate_iso_resource {
Tao Baod7db5942015-01-28 10:07:51 -0800246 __u64 closure;
Tao Baod7db5942015-01-28 10:07:51 -0800247 __u64 channels;
248 __u32 bandwidth;
249 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700250};
Ben Cheng655a7c02013-10-16 16:09:24 -0700251struct fw_cdev_send_stream_packet {
Tao Baod7db5942015-01-28 10:07:51 -0800252 __u32 length;
253 __u32 tag;
254 __u32 channel;
Tao Baod7db5942015-01-28 10:07:51 -0800255 __u32 sy;
256 __u64 closure;
257 __u64 data;
258 __u32 generation;
Tao Baod7db5942015-01-28 10:07:51 -0800259 __u32 speed;
Ben Cheng655a7c02013-10-16 16:09:24 -0700260};
261struct fw_cdev_send_phy_packet {
Tao Baod7db5942015-01-28 10:07:51 -0800262 __u64 closure;
Tao Baod7db5942015-01-28 10:07:51 -0800263 __u32 data[2];
264 __u32 generation;
Ben Cheng655a7c02013-10-16 16:09:24 -0700265};
266struct fw_cdev_receive_phy_packets {
Tao Baod7db5942015-01-28 10:07:51 -0800267 __u64 closure;
Ben Cheng655a7c02013-10-16 16:09:24 -0700268};
269#define FW_CDEV_VERSION 3
270#endif