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