Kristian Høgsberg | 4c5a443 | 2007-05-07 20:33:37 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Char device interface. |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2005-2006 Kristian Hoegsberg <krh@bitplanet.net> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software Foundation, |
| 18 | * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 19 | */ |
| 20 | |
Kristian Høgsberg | 4c5a443 | 2007-05-07 20:33:37 -0400 | [diff] [blame] | 21 | #ifndef _LINUX_FIREWIRE_CDEV_H |
| 22 | #define _LINUX_FIREWIRE_CDEV_H |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 23 | |
Kristian Høgsberg | 04dfb8d | 2007-05-07 20:33:36 -0400 | [diff] [blame] | 24 | #include <linux/ioctl.h> |
| 25 | #include <linux/types.h> |
Kristian Høgsberg | 4c5a443 | 2007-05-07 20:33:37 -0400 | [diff] [blame] | 26 | #include <linux/firewire-constants.h> |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 27 | |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 28 | #define FW_CDEV_EVENT_BUS_RESET 0x00 |
| 29 | #define FW_CDEV_EVENT_RESPONSE 0x01 |
| 30 | #define FW_CDEV_EVENT_REQUEST 0x02 |
| 31 | #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 |
| 32 | #define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04 |
| 33 | #define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05 |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 34 | |
Stefan Richter | e205597 | 2010-06-20 22:53:55 +0200 | [diff] [blame] | 35 | /* available since kernel version 2.6.36 */ |
| 36 | #define FW_CDEV_EVENT_REQUEST2 0x06 |
Stefan Richter | 850bb6f | 2010-07-16 22:25:14 +0200 | [diff] [blame^] | 37 | #define FW_CDEV_EVENT_PHY_PACKET_SENT 0x07 |
Stefan Richter | e205597 | 2010-06-20 22:53:55 +0200 | [diff] [blame] | 38 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 39 | /** |
| 40 | * struct fw_cdev_event_common - Common part of all fw_cdev_event_ types |
| 41 | * @closure: For arbitrary use by userspace |
| 42 | * @type: Discriminates the fw_cdev_event_ types |
| 43 | * |
| 44 | * This struct may be used to access generic members of all fw_cdev_event_ |
| 45 | * types regardless of the specific type. |
| 46 | * |
| 47 | * Data passed in the @closure field for a request will be returned in the |
| 48 | * corresponding event. It is big enough to hold a pointer on all platforms. |
| 49 | * The ioctl used to set @closure depends on the @type of event. |
| 50 | */ |
Kristian Høgsberg | da8ecff | 2007-03-27 01:43:39 -0400 | [diff] [blame] | 51 | struct fw_cdev_event_common { |
| 52 | __u64 closure; |
| 53 | __u32 type; |
| 54 | }; |
| 55 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 56 | /** |
| 57 | * struct fw_cdev_event_bus_reset - Sent when a bus reset occurred |
| 58 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_GET_INFO ioctl |
| 59 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_BUS_RESET |
| 60 | * @node_id: New node ID of this node |
| 61 | * @local_node_id: Node ID of the local node, i.e. of the controller |
| 62 | * @bm_node_id: Node ID of the bus manager |
| 63 | * @irm_node_id: Node ID of the iso resource manager |
| 64 | * @root_node_id: Node ID of the root node |
| 65 | * @generation: New bus generation |
| 66 | * |
| 67 | * This event is sent when the bus the device belongs to goes through a bus |
| 68 | * reset. It provides information about the new bus configuration, such as |
| 69 | * new node ID for this device, new root ID, and others. |
Stefan Richter | 250b2b6 | 2010-06-21 23:24:35 +0200 | [diff] [blame] | 70 | * |
| 71 | * If @bm_node_id is 0xffff right after bus reset it can be reread by an |
| 72 | * %FW_CDEV_IOC_GET_INFO ioctl after bus manager selection was finished. |
| 73 | * Kernels with ABI version < 4 do not set @bm_node_id. |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 74 | */ |
Kristian Høgsberg | 97bd9ef | 2007-03-07 12:12:41 -0500 | [diff] [blame] | 75 | struct fw_cdev_event_bus_reset { |
Kristian Høgsberg | da8ecff | 2007-03-27 01:43:39 -0400 | [diff] [blame] | 76 | __u64 closure; |
Kristian Høgsberg | 97bd9ef | 2007-03-07 12:12:41 -0500 | [diff] [blame] | 77 | __u32 type; |
| 78 | __u32 node_id; |
| 79 | __u32 local_node_id; |
| 80 | __u32 bm_node_id; |
| 81 | __u32 irm_node_id; |
| 82 | __u32 root_node_id; |
| 83 | __u32 generation; |
| 84 | }; |
| 85 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 86 | /** |
| 87 | * struct fw_cdev_event_response - Sent when a response packet was received |
Stefan Richter | d505e6e | 2010-07-17 21:36:02 +0200 | [diff] [blame] | 88 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_SEND_REQUEST |
| 89 | * or %FW_CDEV_IOC_SEND_BROADCAST_REQUEST |
| 90 | * or %FW_CDEV_IOC_SEND_STREAM_PACKET ioctl |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 91 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_RESPONSE |
| 92 | * @rcode: Response code returned by the remote node |
| 93 | * @length: Data length, i.e. the response's payload size in bytes |
| 94 | * @data: Payload data, if any |
| 95 | * |
| 96 | * This event is sent when the stack receives a response to an outgoing request |
| 97 | * sent by %FW_CDEV_IOC_SEND_REQUEST ioctl. The payload data for responses |
| 98 | * carrying data (read and lock responses) follows immediately and can be |
| 99 | * accessed through the @data field. |
Stefan Richter | d505e6e | 2010-07-17 21:36:02 +0200 | [diff] [blame] | 100 | * |
| 101 | * The event is also generated after conclusions of transactions that do not |
| 102 | * involve response packets. This includes unified write transactions, |
| 103 | * broadcast write transactions, and transmission of asynchronous stream |
| 104 | * packets. @rcode indicates success or failure of such transmissions. |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 105 | */ |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 106 | struct fw_cdev_event_response { |
Kristian Høgsberg | da8ecff | 2007-03-27 01:43:39 -0400 | [diff] [blame] | 107 | __u64 closure; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 108 | __u32 type; |
| 109 | __u32 rcode; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 110 | __u32 length; |
| 111 | __u32 data[0]; |
| 112 | }; |
| 113 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 114 | /** |
Stefan Richter | e205597 | 2010-06-20 22:53:55 +0200 | [diff] [blame] | 115 | * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2 |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 116 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl |
| 117 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST |
Stefan Richter | e205597 | 2010-06-20 22:53:55 +0200 | [diff] [blame] | 118 | * @tcode: See &fw_cdev_event_request2 |
| 119 | * @offset: See &fw_cdev_event_request2 |
| 120 | * @handle: See &fw_cdev_event_request2 |
| 121 | * @length: See &fw_cdev_event_request2 |
| 122 | * @data: See &fw_cdev_event_request2 |
| 123 | * |
| 124 | * This event is sent instead of &fw_cdev_event_request2 if the kernel or |
| 125 | * the client implements ABI version <= 3. |
| 126 | * |
| 127 | * Unlike &fw_cdev_event_request2, the sender identity cannot be established, |
| 128 | * broadcast write requests cannot be distinguished from unicast writes, and |
| 129 | * @tcode of lock requests is %TCODE_LOCK_REQUEST. |
| 130 | * |
| 131 | * Requests to the FCP_REQUEST or FCP_RESPONSE register are responded to as |
| 132 | * with &fw_cdev_event_request2, except in kernel 2.6.32 and older which send |
| 133 | * the response packet of the client's %FW_CDEV_IOC_SEND_RESPONSE ioctl. |
| 134 | */ |
| 135 | struct fw_cdev_event_request { |
| 136 | __u64 closure; |
| 137 | __u32 type; |
| 138 | __u32 tcode; |
| 139 | __u64 offset; |
| 140 | __u32 handle; |
| 141 | __u32 length; |
| 142 | __u32 data[0]; |
| 143 | }; |
| 144 | |
| 145 | /** |
| 146 | * struct fw_cdev_event_request2 - Sent on incoming request to an address region |
| 147 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl |
| 148 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST2 |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 149 | * @tcode: Transaction code of the incoming request |
| 150 | * @offset: The offset into the 48-bit per-node address space |
Stefan Richter | e205597 | 2010-06-20 22:53:55 +0200 | [diff] [blame] | 151 | * @source_node_id: Sender node ID |
| 152 | * @destination_node_id: Destination node ID |
| 153 | * @card: The index of the card from which the request came |
| 154 | * @generation: Bus generation in which the request is valid |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 155 | * @handle: Reference to the kernel-side pending request |
| 156 | * @length: Data length, i.e. the request's payload size in bytes |
| 157 | * @data: Incoming data, if any |
| 158 | * |
| 159 | * This event is sent when the stack receives an incoming request to an address |
| 160 | * region registered using the %FW_CDEV_IOC_ALLOCATE ioctl. The request is |
| 161 | * guaranteed to be completely contained in the specified region. Userspace is |
| 162 | * responsible for sending the response by %FW_CDEV_IOC_SEND_RESPONSE ioctl, |
| 163 | * using the same @handle. |
| 164 | * |
| 165 | * The payload data for requests carrying data (write and lock requests) |
| 166 | * follows immediately and can be accessed through the @data field. |
Stefan Richter | e205597 | 2010-06-20 22:53:55 +0200 | [diff] [blame] | 167 | * |
| 168 | * Unlike &fw_cdev_event_request, @tcode of lock requests is one of the |
| 169 | * firewire-core specific %TCODE_LOCK_MASK_SWAP...%TCODE_LOCK_VENDOR_DEPENDENT, |
| 170 | * i.e. encodes the extended transaction code. |
| 171 | * |
| 172 | * @card may differ from &fw_cdev_get_info.card because requests are received |
| 173 | * from all cards of the Linux host. @source_node_id, @destination_node_id, and |
| 174 | * @generation pertain to that card. Destination node ID and bus generation may |
| 175 | * therefore differ from the corresponding fields of the last |
| 176 | * &fw_cdev_event_bus_reset. |
| 177 | * |
| 178 | * @destination_node_id may also differ from the current node ID because of a |
| 179 | * non-local bus ID part or in case of a broadcast write request. Note, a |
| 180 | * client must call an %FW_CDEV_IOC_SEND_RESPONSE ioctl even in case of a |
| 181 | * broadcast write request; the kernel will then release the kernel-side pending |
| 182 | * request but will not actually send a response packet. |
| 183 | * |
| 184 | * In case of a write request to FCP_REQUEST or FCP_RESPONSE, the kernel already |
| 185 | * sent a write response immediately after the request was received; in this |
| 186 | * case the client must still call an %FW_CDEV_IOC_SEND_RESPONSE ioctl to |
| 187 | * release the kernel-side pending request, though another response won't be |
| 188 | * sent. |
| 189 | * |
| 190 | * If the client subsequently needs to initiate requests to the sender node of |
| 191 | * an &fw_cdev_event_request2, it needs to use a device file with matching |
| 192 | * card index, node ID, and generation for outbound requests. |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 193 | */ |
Stefan Richter | e205597 | 2010-06-20 22:53:55 +0200 | [diff] [blame] | 194 | struct fw_cdev_event_request2 { |
Kristian Høgsberg | da8ecff | 2007-03-27 01:43:39 -0400 | [diff] [blame] | 195 | __u64 closure; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 196 | __u32 type; |
| 197 | __u32 tcode; |
| 198 | __u64 offset; |
Stefan Richter | e205597 | 2010-06-20 22:53:55 +0200 | [diff] [blame] | 199 | __u32 source_node_id; |
| 200 | __u32 destination_node_id; |
| 201 | __u32 card; |
| 202 | __u32 generation; |
Kristian Høgsberg | 3964a44 | 2007-03-27 01:43:41 -0400 | [diff] [blame] | 203 | __u32 handle; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 204 | __u32 length; |
| 205 | __u32 data[0]; |
| 206 | }; |
| 207 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 208 | /** |
| 209 | * struct fw_cdev_event_iso_interrupt - Sent when an iso packet was completed |
| 210 | * @closure: See &fw_cdev_event_common; |
| 211 | * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl |
| 212 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_ISO_INTERRUPT |
| 213 | * @cycle: Cycle counter of the interrupt packet |
| 214 | * @header_length: Total length of following headers, in bytes |
| 215 | * @header: Stripped headers, if any |
| 216 | * |
| 217 | * This event is sent when the controller has completed an &fw_cdev_iso_packet |
Stefan Richter | 3b2b65d | 2010-06-20 22:54:22 +0200 | [diff] [blame] | 218 | * with the %FW_CDEV_ISO_INTERRUPT bit set. |
| 219 | * |
| 220 | * Isochronous transmit events: |
| 221 | * |
| 222 | * In version 1 of the ABI, &header_length is 0. In version 3 and some |
| 223 | * implementations of version 2 of the ABI, &header_length is a multiple of 4 |
| 224 | * and &header contains timestamps of all packets up until the interrupt packet. |
| 225 | * The format of the timestamps is as described below for isochronous reception. |
| 226 | * |
| 227 | * Isochronous receive events: |
| 228 | * |
| 229 | * The headers stripped of all packets up until and including the interrupt |
| 230 | * packet are returned in the @header field. The amount of header data per |
| 231 | * packet is as specified at iso context creation by |
| 232 | * &fw_cdev_create_iso_context.header_size. |
Stefan Richter | 77258da | 2009-01-07 20:14:53 +0100 | [diff] [blame] | 233 | * |
| 234 | * In version 1 of this ABI, header data consisted of the 1394 isochronous |
| 235 | * packet header, followed by quadlets from the packet payload if |
| 236 | * &fw_cdev_create_iso_context.header_size > 4. |
| 237 | * |
| 238 | * In version 2 of this ABI, header data consist of the 1394 isochronous |
| 239 | * packet header, followed by a timestamp quadlet if |
| 240 | * &fw_cdev_create_iso_context.header_size > 4, followed by quadlets from the |
| 241 | * packet payload if &fw_cdev_create_iso_context.header_size > 8. |
| 242 | * |
| 243 | * Behaviour of ver. 1 of this ABI is no longer available since ABI ver. 2. |
| 244 | * |
| 245 | * Format of 1394 iso packet header: 16 bits len, 2 bits tag, 6 bits channel, |
| 246 | * 4 bits tcode, 4 bits sy, in big endian byte order. Format of timestamp: |
| 247 | * 16 bits invalid, 3 bits cycleSeconds, 13 bits cycleCount, in big endian byte |
| 248 | * order. |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 249 | */ |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 250 | struct fw_cdev_event_iso_interrupt { |
Kristian Høgsberg | da8ecff | 2007-03-27 01:43:39 -0400 | [diff] [blame] | 251 | __u64 closure; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 252 | __u32 type; |
| 253 | __u32 cycle; |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 254 | __u32 header_length; |
Kristian Høgsberg | 9b32d5f | 2007-02-16 17:34:44 -0500 | [diff] [blame] | 255 | __u32 header[0]; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 256 | }; |
| 257 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 258 | /** |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 259 | * struct fw_cdev_event_iso_resource - Iso resources were allocated or freed |
| 260 | * @closure: See &fw_cdev_event_common; |
Stefan Richter | 1ec3c02 | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 261 | * set by %FW_CDEV_IOC_(DE)ALLOCATE_ISO_RESOURCE(_ONCE) ioctl |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 262 | * @type: %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or |
| 263 | * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED |
| 264 | * @handle: Reference by which an allocated resource can be deallocated |
| 265 | * @channel: Isochronous channel which was (de)allocated, if any |
| 266 | * @bandwidth: Bandwidth allocation units which were (de)allocated, if any |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 267 | * |
| 268 | * An %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED event is sent after an isochronous |
| 269 | * resource was allocated at the IRM. The client has to check @channel and |
| 270 | * @bandwidth for whether the allocation actually succeeded. |
| 271 | * |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 272 | * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event is sent after an isochronous |
| 273 | * resource was deallocated at the IRM. It is also sent when automatic |
| 274 | * reallocation after a bus reset failed. |
Stefan Richter | 1ec3c02 | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 275 | * |
| 276 | * @channel is <0 if no channel was (de)allocated or if reallocation failed. |
| 277 | * @bandwidth is 0 if no bandwidth was (de)allocated or if reallocation failed. |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 278 | */ |
| 279 | struct fw_cdev_event_iso_resource { |
| 280 | __u64 closure; |
| 281 | __u32 type; |
| 282 | __u32 handle; |
| 283 | __s32 channel; |
| 284 | __s32 bandwidth; |
| 285 | }; |
| 286 | |
| 287 | /** |
Stefan Richter | 850bb6f | 2010-07-16 22:25:14 +0200 | [diff] [blame^] | 288 | * struct fw_cdev_event_phy_packet - A PHY packet was transmitted |
| 289 | * @closure: See &fw_cdev_event_common; |
| 290 | * set by %FW_CDEV_IOC_SEND_PHY_PACKET ioctl |
| 291 | * @type: %FW_CDEV_EVENT_PHY_PACKET_SENT |
| 292 | * @rcode: %RCODE_..., indicates success or failure of transmission |
| 293 | */ |
| 294 | struct fw_cdev_event_phy_packet { |
| 295 | __u64 closure; |
| 296 | __u32 type; |
| 297 | __u32 rcode; |
| 298 | }; |
| 299 | |
| 300 | /** |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 301 | * union fw_cdev_event - Convenience union of fw_cdev_event_ types |
| 302 | * @common: Valid for all types |
| 303 | * @bus_reset: Valid if @common.type == %FW_CDEV_EVENT_BUS_RESET |
| 304 | * @response: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE |
| 305 | * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST |
Stefan Richter | e205597 | 2010-06-20 22:53:55 +0200 | [diff] [blame] | 306 | * @request2: Valid if @common.type == %FW_CDEV_EVENT_REQUEST2 |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 307 | * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 308 | * @iso_resource: Valid if @common.type == |
| 309 | * %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or |
| 310 | * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED |
Stefan Richter | 850bb6f | 2010-07-16 22:25:14 +0200 | [diff] [blame^] | 311 | * @phy_packet: Valid if @common.type == %FW_CDEV_EVENT_PHY_PACKET_SENT |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 312 | * |
Jay Fenlason | be585c0 | 2008-10-01 18:13:20 -0400 | [diff] [blame] | 313 | * Convenience union for userspace use. Events could be read(2) into an |
| 314 | * appropriately aligned char buffer and then cast to this union for further |
| 315 | * processing. Note that for a request, response or iso_interrupt event, |
| 316 | * the data[] or header[] may make the size of the full event larger than |
| 317 | * sizeof(union fw_cdev_event). Also note that if you attempt to read(2) |
| 318 | * an event into a buffer that is not large enough for it, the data that does |
| 319 | * not fit will be discarded so that the next read(2) will return a new event. |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 320 | */ |
Kristian Høgsberg | da8ecff | 2007-03-27 01:43:39 -0400 | [diff] [blame] | 321 | union fw_cdev_event { |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 322 | struct fw_cdev_event_common common; |
| 323 | struct fw_cdev_event_bus_reset bus_reset; |
| 324 | struct fw_cdev_event_response response; |
| 325 | struct fw_cdev_event_request request; |
Stefan Richter | e205597 | 2010-06-20 22:53:55 +0200 | [diff] [blame] | 326 | struct fw_cdev_event_request2 request2; /* added in 2.6.36 */ |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 327 | struct fw_cdev_event_iso_interrupt iso_interrupt; |
Stefan Richter | 604f451 | 2010-06-20 22:52:55 +0200 | [diff] [blame] | 328 | struct fw_cdev_event_iso_resource iso_resource; /* added in 2.6.30 */ |
Stefan Richter | 850bb6f | 2010-07-16 22:25:14 +0200 | [diff] [blame^] | 329 | struct fw_cdev_event_phy_packet phy_packet; /* added in 2.6.36 */ |
Kristian Høgsberg | da8ecff | 2007-03-27 01:43:39 -0400 | [diff] [blame] | 330 | }; |
| 331 | |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 332 | /* available since kernel version 2.6.22 */ |
Stefan Richter | c8a2590 | 2009-03-10 20:59:16 +0100 | [diff] [blame] | 333 | #define FW_CDEV_IOC_GET_INFO _IOWR('#', 0x00, struct fw_cdev_get_info) |
| 334 | #define FW_CDEV_IOC_SEND_REQUEST _IOW('#', 0x01, struct fw_cdev_send_request) |
| 335 | #define FW_CDEV_IOC_ALLOCATE _IOWR('#', 0x02, struct fw_cdev_allocate) |
| 336 | #define FW_CDEV_IOC_DEALLOCATE _IOW('#', 0x03, struct fw_cdev_deallocate) |
| 337 | #define FW_CDEV_IOC_SEND_RESPONSE _IOW('#', 0x04, struct fw_cdev_send_response) |
| 338 | #define FW_CDEV_IOC_INITIATE_BUS_RESET _IOW('#', 0x05, struct fw_cdev_initiate_bus_reset) |
| 339 | #define FW_CDEV_IOC_ADD_DESCRIPTOR _IOWR('#', 0x06, struct fw_cdev_add_descriptor) |
| 340 | #define FW_CDEV_IOC_REMOVE_DESCRIPTOR _IOW('#', 0x07, struct fw_cdev_remove_descriptor) |
| 341 | #define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IOWR('#', 0x08, struct fw_cdev_create_iso_context) |
| 342 | #define FW_CDEV_IOC_QUEUE_ISO _IOWR('#', 0x09, struct fw_cdev_queue_iso) |
| 343 | #define FW_CDEV_IOC_START_ISO _IOW('#', 0x0a, struct fw_cdev_start_iso) |
| 344 | #define FW_CDEV_IOC_STOP_ISO _IOW('#', 0x0b, struct fw_cdev_stop_iso) |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 345 | |
| 346 | /* available since kernel version 2.6.24 */ |
Stefan Richter | c8a2590 | 2009-03-10 20:59:16 +0100 | [diff] [blame] | 347 | #define FW_CDEV_IOC_GET_CYCLE_TIMER _IOR('#', 0x0c, struct fw_cdev_get_cycle_timer) |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 348 | |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 349 | /* available since kernel version 2.6.30 */ |
Stefan Richter | 1ec3c02 | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 350 | #define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE _IOWR('#', 0x0d, struct fw_cdev_allocate_iso_resource) |
| 351 | #define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE _IOW('#', 0x0e, struct fw_cdev_deallocate) |
| 352 | #define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x0f, struct fw_cdev_allocate_iso_resource) |
| 353 | #define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x10, struct fw_cdev_allocate_iso_resource) |
Stefan Richter | c8a2590 | 2009-03-10 20:59:16 +0100 | [diff] [blame] | 354 | #define FW_CDEV_IOC_GET_SPEED _IO('#', 0x11) /* returns speed code */ |
Jay Fenlason, Stefan Richter | acfe833 | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 355 | #define FW_CDEV_IOC_SEND_BROADCAST_REQUEST _IOW('#', 0x12, struct fw_cdev_send_request) |
Jay Fenlason | f8c2287 | 2009-03-05 19:08:40 +0100 | [diff] [blame] | 356 | #define FW_CDEV_IOC_SEND_STREAM_PACKET _IOW('#', 0x13, struct fw_cdev_send_stream_packet) |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 357 | |
Stefan Richter | abfe5a0 | 2010-02-20 12:13:49 +0100 | [diff] [blame] | 358 | /* available since kernel version 2.6.34 */ |
| 359 | #define FW_CDEV_IOC_GET_CYCLE_TIMER2 _IOWR('#', 0x14, struct fw_cdev_get_cycle_timer2) |
| 360 | |
Stefan Richter | 850bb6f | 2010-07-16 22:25:14 +0200 | [diff] [blame^] | 361 | /* available since kernel version 2.6.36 */ |
| 362 | #define FW_CDEV_IOC_SEND_PHY_PACKET _IOWR('#', 0x15, struct fw_cdev_send_phy_packet) |
| 363 | |
Stefan Richter | 77258da | 2009-01-07 20:14:53 +0100 | [diff] [blame] | 364 | /* |
Stefan Richter | 604f451 | 2010-06-20 22:52:55 +0200 | [diff] [blame] | 365 | * ABI version history |
Stefan Richter | 77258da | 2009-01-07 20:14:53 +0100 | [diff] [blame] | 366 | * 1 (2.6.22) - initial version |
Stefan Richter | 604f451 | 2010-06-20 22:52:55 +0200 | [diff] [blame] | 367 | * (2.6.24) - added %FW_CDEV_IOC_GET_CYCLE_TIMER |
Stefan Richter | 77258da | 2009-01-07 20:14:53 +0100 | [diff] [blame] | 368 | * 2 (2.6.30) - changed &fw_cdev_event_iso_interrupt.header if |
| 369 | * &fw_cdev_create_iso_context.header_size is 8 or more |
Stefan Richter | 604f451 | 2010-06-20 22:52:55 +0200 | [diff] [blame] | 370 | * - added %FW_CDEV_IOC_*_ISO_RESOURCE*, |
| 371 | * %FW_CDEV_IOC_GET_SPEED, %FW_CDEV_IOC_SEND_BROADCAST_REQUEST, |
| 372 | * %FW_CDEV_IOC_SEND_STREAM_PACKET |
Stefan Richter | e94b6d7 | 2010-02-21 12:48:57 +0100 | [diff] [blame] | 373 | * (2.6.32) - added time stamp to xmit &fw_cdev_event_iso_interrupt |
| 374 | * (2.6.33) - IR has always packet-per-buffer semantics now, not one of |
| 375 | * dual-buffer or packet-per-buffer depending on hardware |
Stefan Richter | e205597 | 2010-06-20 22:53:55 +0200 | [diff] [blame] | 376 | * - shared use and auto-response for FCP registers |
Stefan Richter | e94b6d7 | 2010-02-21 12:48:57 +0100 | [diff] [blame] | 377 | * 3 (2.6.34) - made &fw_cdev_get_cycle_timer reliable |
Stefan Richter | 604f451 | 2010-06-20 22:52:55 +0200 | [diff] [blame] | 378 | * - added %FW_CDEV_IOC_GET_CYCLE_TIMER2 |
Stefan Richter | 850bb6f | 2010-07-16 22:25:14 +0200 | [diff] [blame^] | 379 | * 4 (2.6.36) - added %FW_CDEV_EVENT_REQUEST2, %FW_CDEV_EVENT_PHY_PACKET_SENT |
Stefan Richter | 250b2b6 | 2010-06-21 23:24:35 +0200 | [diff] [blame] | 380 | * - implemented &fw_cdev_event_bus_reset.bm_node_id |
Stefan Richter | 850bb6f | 2010-07-16 22:25:14 +0200 | [diff] [blame^] | 381 | * - added %FW_CDEV_IOC_SEND_PHY_PACKET |
Kristian Høgsberg | 344bbc4 | 2007-03-07 12:12:43 -0500 | [diff] [blame] | 382 | */ |
Stefan Richter | 604f451 | 2010-06-20 22:52:55 +0200 | [diff] [blame] | 383 | #define FW_CDEV_VERSION 3 /* Meaningless; don't use this macro. */ |
Kristian Høgsberg | 344bbc4 | 2007-03-07 12:12:43 -0500 | [diff] [blame] | 384 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 385 | /** |
| 386 | * struct fw_cdev_get_info - General purpose information ioctl |
Stefan Richter | 604f451 | 2010-06-20 22:52:55 +0200 | [diff] [blame] | 387 | * @version: The version field is just a running serial number. Both an |
| 388 | * input parameter (ABI version implemented by the client) and |
| 389 | * output parameter (ABI version implemented by the kernel). |
| 390 | * A client must not fill in an %FW_CDEV_VERSION defined from an |
| 391 | * included kernel header file but the actual version for which |
| 392 | * the client was implemented. This is necessary for forward |
| 393 | * compatibility. We never break backwards compatibility, but |
| 394 | * may add more structs, events, and ioctls in later revisions. |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 395 | * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration |
| 396 | * ROM will be copied into that user space address. In either |
| 397 | * case, @rom_length is updated with the actual length of the |
| 398 | * configuration ROM. |
| 399 | * @rom: If non-zero, address of a buffer to be filled by a copy of the |
Stefan Richter | 632321e | 2009-01-02 12:47:13 +0100 | [diff] [blame] | 400 | * device's configuration ROM |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 401 | * @bus_reset: If non-zero, address of a buffer to be filled by a |
| 402 | * &struct fw_cdev_event_bus_reset with the current state |
| 403 | * of the bus. This does not cause a bus reset to happen. |
| 404 | * @bus_reset_closure: Value of &closure in this and subsequent bus reset events |
| 405 | * @card: The index of the card this device belongs to |
| 406 | */ |
Kristian Høgsberg | 344bbc4 | 2007-03-07 12:12:43 -0500 | [diff] [blame] | 407 | struct fw_cdev_get_info { |
Kristian Høgsberg | 344bbc4 | 2007-03-07 12:12:43 -0500 | [diff] [blame] | 408 | __u32 version; |
Kristian Høgsberg | 344bbc4 | 2007-03-07 12:12:43 -0500 | [diff] [blame] | 409 | __u32 rom_length; |
| 410 | __u64 rom; |
Kristian Høgsberg | 344bbc4 | 2007-03-07 12:12:43 -0500 | [diff] [blame] | 411 | __u64 bus_reset; |
Kristian Høgsberg | da8ecff | 2007-03-27 01:43:39 -0400 | [diff] [blame] | 412 | __u64 bus_reset_closure; |
Kristian Høgsberg | e753350 | 2007-03-07 12:12:52 -0500 | [diff] [blame] | 413 | __u32 card; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 414 | }; |
| 415 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 416 | /** |
| 417 | * struct fw_cdev_send_request - Send an asynchronous request packet |
| 418 | * @tcode: Transaction code of the request |
| 419 | * @length: Length of outgoing payload, in bytes |
| 420 | * @offset: 48-bit offset at destination node |
| 421 | * @closure: Passed back to userspace in the response event |
| 422 | * @data: Userspace pointer to payload |
| 423 | * @generation: The bus generation where packet is valid |
| 424 | * |
| 425 | * Send a request to the device. This ioctl implements all outgoing requests. |
| 426 | * Both quadlet and block request specify the payload as a pointer to the data |
| 427 | * in the @data field. Once the transaction completes, the kernel writes an |
Stefan Richter | bf8e335 | 2008-12-05 22:43:41 +0100 | [diff] [blame] | 428 | * &fw_cdev_event_response event back. The @closure field is passed back to |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 429 | * user space in the response event. |
| 430 | */ |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 431 | struct fw_cdev_send_request { |
| 432 | __u32 tcode; |
| 433 | __u32 length; |
| 434 | __u64 offset; |
| 435 | __u64 closure; |
| 436 | __u64 data; |
Kristian Høgsberg | 97e3527 | 2007-03-07 12:12:53 -0500 | [diff] [blame] | 437 | __u32 generation; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 438 | }; |
| 439 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 440 | /** |
| 441 | * struct fw_cdev_send_response - Send an asynchronous response packet |
| 442 | * @rcode: Response code as determined by the userspace handler |
| 443 | * @length: Length of outgoing payload, in bytes |
| 444 | * @data: Userspace pointer to payload |
| 445 | * @handle: The handle from the &fw_cdev_event_request |
| 446 | * |
| 447 | * Send a response to an incoming request. By setting up an address range using |
| 448 | * the %FW_CDEV_IOC_ALLOCATE ioctl, userspace can listen for incoming requests. An |
| 449 | * incoming request will generate an %FW_CDEV_EVENT_REQUEST, and userspace must |
| 450 | * send a reply using this ioctl. The event has a handle to the kernel-side |
| 451 | * pending transaction, which should be used with this ioctl. |
| 452 | */ |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 453 | struct fw_cdev_send_response { |
| 454 | __u32 rcode; |
| 455 | __u32 length; |
| 456 | __u64 data; |
Kristian Høgsberg | 3964a44 | 2007-03-27 01:43:41 -0400 | [diff] [blame] | 457 | __u32 handle; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 458 | }; |
| 459 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 460 | /** |
| 461 | * struct fw_cdev_allocate - Allocate a CSR address range |
| 462 | * @offset: Start offset of the address range |
| 463 | * @closure: To be passed back to userspace in request events |
| 464 | * @length: Length of the address range, in bytes |
| 465 | * @handle: Handle to the allocation, written by the kernel |
| 466 | * |
| 467 | * Allocate an address range in the 48-bit address space on the local node |
| 468 | * (the controller). This allows userspace to listen for requests with an |
| 469 | * offset within that address range. When the kernel receives a request |
| 470 | * within the range, an &fw_cdev_event_request event will be written back. |
| 471 | * The @closure field is passed back to userspace in the response event. |
| 472 | * The @handle field is an out parameter, returning a handle to the allocated |
| 473 | * range to be used for later deallocation of the range. |
Clemens Ladisch | db5d247 | 2009-12-24 12:05:58 +0100 | [diff] [blame] | 474 | * |
| 475 | * The address range is allocated on all local nodes. The address allocation |
Stefan Richter | d505e6e | 2010-07-17 21:36:02 +0200 | [diff] [blame] | 476 | * is exclusive except for the FCP command and response registers. If an |
| 477 | * exclusive address region is already in use, the ioctl fails with errno set |
| 478 | * to %EBUSY. |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 479 | */ |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 480 | struct fw_cdev_allocate { |
| 481 | __u64 offset; |
| 482 | __u64 closure; |
| 483 | __u32 length; |
Kristian Høgsberg | 3964a44 | 2007-03-27 01:43:41 -0400 | [diff] [blame] | 484 | __u32 handle; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 485 | }; |
| 486 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 487 | /** |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 488 | * struct fw_cdev_deallocate - Free a CSR address range or isochronous resource |
| 489 | * @handle: Handle to the address range or iso resource, as returned by the |
| 490 | * kernel when the range or resource was allocated |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 491 | */ |
Kristian Høgsberg | 9472316 | 2007-03-14 17:34:55 -0400 | [diff] [blame] | 492 | struct fw_cdev_deallocate { |
Kristian Høgsberg | 3964a44 | 2007-03-27 01:43:41 -0400 | [diff] [blame] | 493 | __u32 handle; |
Kristian Høgsberg | 9472316 | 2007-03-14 17:34:55 -0400 | [diff] [blame] | 494 | }; |
| 495 | |
Kristian Høgsberg | 5371842 | 2007-03-07 12:12:42 -0500 | [diff] [blame] | 496 | #define FW_CDEV_LONG_RESET 0 |
| 497 | #define FW_CDEV_SHORT_RESET 1 |
| 498 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 499 | /** |
| 500 | * struct fw_cdev_initiate_bus_reset - Initiate a bus reset |
| 501 | * @type: %FW_CDEV_SHORT_RESET or %FW_CDEV_LONG_RESET |
| 502 | * |
| 503 | * Initiate a bus reset for the bus this device is on. The bus reset can be |
| 504 | * either the original (long) bus reset or the arbitrated (short) bus reset |
| 505 | * introduced in 1394a-2000. |
Stefan Richter | d505e6e | 2010-07-17 21:36:02 +0200 | [diff] [blame] | 506 | * |
| 507 | * The ioctl returns immediately. A subsequent &fw_cdev_event_bus_reset |
| 508 | * indicates when the reset actually happened. Since ABI v4, this may be |
| 509 | * considerably later than the ioctl because the kernel ensures a grace period |
| 510 | * between subsequent bus resets as per IEEE 1394 bus management specification. |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 511 | */ |
Kristian Høgsberg | 5371842 | 2007-03-07 12:12:42 -0500 | [diff] [blame] | 512 | struct fw_cdev_initiate_bus_reset { |
Stefan Richter | d505e6e | 2010-07-17 21:36:02 +0200 | [diff] [blame] | 513 | __u32 type; |
Kristian Høgsberg | 5371842 | 2007-03-07 12:12:42 -0500 | [diff] [blame] | 514 | }; |
| 515 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 516 | /** |
| 517 | * struct fw_cdev_add_descriptor - Add contents to the local node's config ROM |
| 518 | * @immediate: If non-zero, immediate key to insert before pointer |
| 519 | * @key: Upper 8 bits of root directory pointer |
| 520 | * @data: Userspace pointer to contents of descriptor block |
Stefan Richter | 6d3faf6 | 2010-01-24 14:48:00 +0100 | [diff] [blame] | 521 | * @length: Length of descriptor block data, in quadlets |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 522 | * @handle: Handle to the descriptor, written by the kernel |
| 523 | * |
| 524 | * Add a descriptor block and optionally a preceding immediate key to the local |
| 525 | * node's configuration ROM. |
| 526 | * |
| 527 | * The @key field specifies the upper 8 bits of the descriptor root directory |
| 528 | * pointer and the @data and @length fields specify the contents. The @key |
| 529 | * should be of the form 0xXX000000. The offset part of the root directory entry |
| 530 | * will be filled in by the kernel. |
| 531 | * |
| 532 | * If not 0, the @immediate field specifies an immediate key which will be |
| 533 | * inserted before the root directory pointer. |
| 534 | * |
Stefan Richter | 6d3faf6 | 2010-01-24 14:48:00 +0100 | [diff] [blame] | 535 | * @immediate, @key, and @data array elements are CPU-endian quadlets. |
| 536 | * |
Stefan Richter | d505e6e | 2010-07-17 21:36:02 +0200 | [diff] [blame] | 537 | * If successful, the kernel adds the descriptor and writes back a @handle to |
| 538 | * the kernel-side object to be used for later removal of the descriptor block |
| 539 | * and immediate key. The kernel will also generate a bus reset to signal the |
| 540 | * change of the configuration ROM to other nodes. |
Stefan Richter | de487da | 2009-03-10 21:00:23 +0100 | [diff] [blame] | 541 | * |
| 542 | * This ioctl affects the configuration ROMs of all local nodes. |
| 543 | * The ioctl only succeeds on device files which represent a local node. |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 544 | */ |
Kristian Høgsberg | 66dea3e | 2007-03-28 21:26:42 +0200 | [diff] [blame] | 545 | struct fw_cdev_add_descriptor { |
| 546 | __u32 immediate; |
| 547 | __u32 key; |
| 548 | __u64 data; |
| 549 | __u32 length; |
| 550 | __u32 handle; |
| 551 | }; |
| 552 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 553 | /** |
| 554 | * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM |
| 555 | * @handle: Handle to the descriptor, as returned by the kernel when the |
| 556 | * descriptor was added |
| 557 | * |
| 558 | * Remove a descriptor block and accompanying immediate key from the local |
Stefan Richter | d505e6e | 2010-07-17 21:36:02 +0200 | [diff] [blame] | 559 | * nodes' configuration ROMs. The kernel will also generate a bus reset to |
| 560 | * signal the change of the configuration ROM to other nodes. |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 561 | */ |
Kristian Høgsberg | 66dea3e | 2007-03-28 21:26:42 +0200 | [diff] [blame] | 562 | struct fw_cdev_remove_descriptor { |
| 563 | __u32 handle; |
| 564 | }; |
| 565 | |
Kristian Høgsberg | 295e3fe | 2007-02-16 17:34:40 -0500 | [diff] [blame] | 566 | #define FW_CDEV_ISO_CONTEXT_TRANSMIT 0 |
| 567 | #define FW_CDEV_ISO_CONTEXT_RECEIVE 1 |
| 568 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 569 | /** |
| 570 | * struct fw_cdev_create_iso_context - Create a context for isochronous IO |
| 571 | * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE |
| 572 | * @header_size: Header size to strip for receive contexts |
| 573 | * @channel: Channel to bind to |
Clemens Ladisch | aa6fec3 | 2010-03-31 16:26:52 +0200 | [diff] [blame] | 574 | * @speed: Speed for transmit contexts |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 575 | * @closure: To be returned in &fw_cdev_event_iso_interrupt |
| 576 | * @handle: Handle to context, written back by kernel |
| 577 | * |
| 578 | * Prior to sending or receiving isochronous I/O, a context must be created. |
| 579 | * The context records information about the transmit or receive configuration |
| 580 | * and typically maps to an underlying hardware resource. A context is set up |
| 581 | * for either sending or receiving. It is bound to a specific isochronous |
| 582 | * channel. |
| 583 | * |
| 584 | * If a context was successfully created, the kernel writes back a handle to the |
| 585 | * context, which must be passed in for subsequent operations on that context. |
Stefan Richter | 77258da | 2009-01-07 20:14:53 +0100 | [diff] [blame] | 586 | * |
Clemens Ladisch | aa6fec3 | 2010-03-31 16:26:52 +0200 | [diff] [blame] | 587 | * For receive contexts, @header_size must be at least 4 and must be a multiple |
| 588 | * of 4. |
| 589 | * |
Stefan Richter | 77258da | 2009-01-07 20:14:53 +0100 | [diff] [blame] | 590 | * Note that the effect of a @header_size > 4 depends on |
| 591 | * &fw_cdev_get_info.version, as documented at &fw_cdev_event_iso_interrupt. |
Stefan Richter | d505e6e | 2010-07-17 21:36:02 +0200 | [diff] [blame] | 592 | * |
| 593 | * No more than one iso context can be created per fd. |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 594 | */ |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 595 | struct fw_cdev_create_iso_context { |
Kristian Høgsberg | 295e3fe | 2007-02-16 17:34:40 -0500 | [diff] [blame] | 596 | __u32 type; |
| 597 | __u32 header_size; |
Kristian Høgsberg | 21efb3c | 2007-02-16 17:34:50 -0500 | [diff] [blame] | 598 | __u32 channel; |
| 599 | __u32 speed; |
Kristian Høgsberg | abaa574 | 2007-04-30 15:03:14 -0400 | [diff] [blame] | 600 | __u64 closure; |
| 601 | __u32 handle; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 602 | }; |
| 603 | |
Kristian Høgsberg | 1ca31ae | 2007-05-31 11:16:43 -0400 | [diff] [blame] | 604 | #define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v) |
| 605 | #define FW_CDEV_ISO_INTERRUPT (1 << 16) |
| 606 | #define FW_CDEV_ISO_SKIP (1 << 17) |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 607 | #define FW_CDEV_ISO_SYNC (1 << 17) |
Kristian Høgsberg | 1ca31ae | 2007-05-31 11:16:43 -0400 | [diff] [blame] | 608 | #define FW_CDEV_ISO_TAG(v) ((v) << 18) |
| 609 | #define FW_CDEV_ISO_SY(v) ((v) << 20) |
| 610 | #define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24) |
| 611 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 612 | /** |
| 613 | * struct fw_cdev_iso_packet - Isochronous packet |
| 614 | * @control: Contains the header length (8 uppermost bits), the sy field |
| 615 | * (4 bits), the tag field (2 bits), a sync flag (1 bit), |
| 616 | * a skip flag (1 bit), an interrupt flag (1 bit), and the |
| 617 | * payload length (16 lowermost bits) |
| 618 | * @header: Header and payload |
| 619 | * |
| 620 | * &struct fw_cdev_iso_packet is used to describe isochronous packet queues. |
| 621 | * |
Clemens Ladisch | aa6fec3 | 2010-03-31 16:26:52 +0200 | [diff] [blame] | 622 | * Use the FW_CDEV_ISO_ macros to fill in @control. |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 623 | * |
Clemens Ladisch | aa6fec3 | 2010-03-31 16:26:52 +0200 | [diff] [blame] | 624 | * For transmit packets, the header length must be a multiple of 4 and specifies |
| 625 | * the numbers of bytes in @header that will be prepended to the packet's |
| 626 | * payload; these bytes are copied into the kernel and will not be accessed |
| 627 | * after the ioctl has returned. The sy and tag fields are copied to the iso |
| 628 | * packet header (these fields are specified by IEEE 1394a and IEC 61883-1). |
| 629 | * The skip flag specifies that no packet is to be sent in a frame; when using |
| 630 | * this, all other fields except the interrupt flag must be zero. |
| 631 | * |
| 632 | * For receive packets, the header length must be a multiple of the context's |
| 633 | * header size; if the header length is larger than the context's header size, |
| 634 | * multiple packets are queued for this entry. The sy and tag fields are |
| 635 | * ignored. If the sync flag is set, the context drops all packets until |
| 636 | * a packet with a matching sy field is received (the sync value to wait for is |
| 637 | * specified in the &fw_cdev_start_iso structure). The payload length defines |
| 638 | * how many payload bytes can be received for one packet (in addition to payload |
| 639 | * quadlets that have been defined as headers and are stripped and returned in |
| 640 | * the &fw_cdev_event_iso_interrupt structure). If more bytes are received, the |
| 641 | * additional bytes are dropped. If less bytes are received, the remaining |
| 642 | * bytes in this part of the payload buffer will not be written to, not even by |
| 643 | * the next packet, i.e., packets received in consecutive frames will not |
| 644 | * necessarily be consecutive in memory. If an entry has queued multiple |
| 645 | * packets, the payload length is divided equally among them. |
| 646 | * |
| 647 | * When a packet with the interrupt flag set has been completed, the |
| 648 | * &fw_cdev_event_iso_interrupt event will be sent. An entry that has queued |
| 649 | * multiple receive packets is completed when its last packet is completed. |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 650 | */ |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 651 | struct fw_cdev_iso_packet { |
Kristian Høgsberg | 1ca31ae | 2007-05-31 11:16:43 -0400 | [diff] [blame] | 652 | __u32 control; |
Stefan Richter | 5e20c28 | 2007-01-21 20:44:09 +0100 | [diff] [blame] | 653 | __u32 header[0]; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 654 | }; |
| 655 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 656 | /** |
| 657 | * struct fw_cdev_queue_iso - Queue isochronous packets for I/O |
| 658 | * @packets: Userspace pointer to packet data |
| 659 | * @data: Pointer into mmap()'ed payload buffer |
| 660 | * @size: Size of packet data in bytes |
| 661 | * @handle: Isochronous context handle |
| 662 | * |
| 663 | * Queue a number of isochronous packets for reception or transmission. |
| 664 | * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs, |
| 665 | * which describe how to transmit from or receive into a contiguous region |
Clemens Ladisch | aa6fec3 | 2010-03-31 16:26:52 +0200 | [diff] [blame] | 666 | * of a mmap()'ed payload buffer. As part of transmit packet descriptors, |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 667 | * a series of headers can be supplied, which will be prepended to the |
| 668 | * payload during DMA. |
| 669 | * |
| 670 | * The kernel may or may not queue all packets, but will write back updated |
| 671 | * values of the @packets, @data and @size fields, so the ioctl can be |
| 672 | * resubmitted easily. |
| 673 | */ |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 674 | struct fw_cdev_queue_iso { |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 675 | __u64 packets; |
| 676 | __u64 data; |
Kristian Høgsberg | da8ecff | 2007-03-27 01:43:39 -0400 | [diff] [blame] | 677 | __u32 size; |
Kristian Høgsberg | abaa574 | 2007-04-30 15:03:14 -0400 | [diff] [blame] | 678 | __u32 handle; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 679 | }; |
| 680 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 681 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1 |
| 682 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2 |
| 683 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4 |
| 684 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8 |
| 685 | #define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15 |
| 686 | |
| 687 | /** |
| 688 | * struct fw_cdev_start_iso - Start an isochronous transmission or reception |
| 689 | * @cycle: Cycle in which to start I/O. If @cycle is greater than or |
| 690 | * equal to 0, the I/O will start on that cycle. |
| 691 | * @sync: Determines the value to wait for for receive packets that have |
| 692 | * the %FW_CDEV_ISO_SYNC bit set |
| 693 | * @tags: Tag filter bit mask. Only valid for isochronous reception. |
| 694 | * Determines the tag values for which packets will be accepted. |
| 695 | * Use FW_CDEV_ISO_CONTEXT_MATCH_ macros to set @tags. |
| 696 | * @handle: Isochronous context handle within which to transmit or receive |
| 697 | */ |
Kristian Høgsberg | 69cdb72 | 2007-02-16 17:34:41 -0500 | [diff] [blame] | 698 | struct fw_cdev_start_iso { |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 699 | __s32 cycle; |
Kristian Høgsberg | eb0306e | 2007-03-14 17:34:54 -0400 | [diff] [blame] | 700 | __u32 sync; |
| 701 | __u32 tags; |
Kristian Høgsberg | abaa574 | 2007-04-30 15:03:14 -0400 | [diff] [blame] | 702 | __u32 handle; |
| 703 | }; |
| 704 | |
Kristian Høgsberg | 7ada60e | 2007-06-22 00:20:34 +0200 | [diff] [blame] | 705 | /** |
| 706 | * struct fw_cdev_stop_iso - Stop an isochronous transmission or reception |
| 707 | * @handle: Handle of isochronous context to stop |
| 708 | */ |
Kristian Høgsberg | abaa574 | 2007-04-30 15:03:14 -0400 | [diff] [blame] | 709 | struct fw_cdev_stop_iso { |
| 710 | __u32 handle; |
Kristian Høgsberg | 19a15b9 | 2006-12-19 19:58:31 -0500 | [diff] [blame] | 711 | }; |
| 712 | |
Stefan Richter | a64408b | 2007-09-29 10:41:58 +0200 | [diff] [blame] | 713 | /** |
| 714 | * struct fw_cdev_get_cycle_timer - read cycle timer register |
| 715 | * @local_time: system time, in microseconds since the Epoch |
Stefan Richter | abfe5a0 | 2010-02-20 12:13:49 +0100 | [diff] [blame] | 716 | * @cycle_timer: Cycle Time register contents |
Stefan Richter | a64408b | 2007-09-29 10:41:58 +0200 | [diff] [blame] | 717 | * |
| 718 | * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer |
Stefan Richter | abfe5a0 | 2010-02-20 12:13:49 +0100 | [diff] [blame] | 719 | * and also the system clock (%CLOCK_REALTIME). This allows to express the |
| 720 | * receive time of an isochronous packet as a system time. |
Stefan Richter | 77258da | 2009-01-07 20:14:53 +0100 | [diff] [blame] | 721 | * |
| 722 | * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and |
Stefan Richter | abfe5a0 | 2010-02-20 12:13:49 +0100 | [diff] [blame] | 723 | * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register |
| 724 | * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394. |
Stefan Richter | e94b6d7 | 2010-02-21 12:48:57 +0100 | [diff] [blame] | 725 | * |
| 726 | * In version 1 and 2 of the ABI, this ioctl returned unreliable (non- |
| 727 | * monotonic) @cycle_timer values on certain controllers. |
Stefan Richter | a64408b | 2007-09-29 10:41:58 +0200 | [diff] [blame] | 728 | */ |
| 729 | struct fw_cdev_get_cycle_timer { |
| 730 | __u64 local_time; |
| 731 | __u32 cycle_timer; |
| 732 | }; |
| 733 | |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 734 | /** |
Stefan Richter | abfe5a0 | 2010-02-20 12:13:49 +0100 | [diff] [blame] | 735 | * struct fw_cdev_get_cycle_timer2 - read cycle timer register |
| 736 | * @tv_sec: system time, seconds |
| 737 | * @tv_nsec: system time, sub-seconds part in nanoseconds |
| 738 | * @clk_id: input parameter, clock from which to get the system time |
| 739 | * @cycle_timer: Cycle Time register contents |
| 740 | * |
| 741 | * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 works like |
| 742 | * %FW_CDEV_IOC_GET_CYCLE_TIMER but lets you choose a clock like with POSIX' |
| 743 | * clock_gettime function. Supported @clk_id values are POSIX' %CLOCK_REALTIME |
| 744 | * and %CLOCK_MONOTONIC and Linux' %CLOCK_MONOTONIC_RAW. |
| 745 | */ |
| 746 | struct fw_cdev_get_cycle_timer2 { |
| 747 | __s64 tv_sec; |
| 748 | __s32 tv_nsec; |
| 749 | __s32 clk_id; |
| 750 | __u32 cycle_timer; |
| 751 | }; |
| 752 | |
| 753 | /** |
Stefan Richter | 1ec3c02 | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 754 | * struct fw_cdev_allocate_iso_resource - (De)allocate a channel or bandwidth |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 755 | * @closure: Passed back to userspace in correponding iso resource events |
Stefan Richter | 1ec3c02 | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 756 | * @channels: Isochronous channels of which one is to be (de)allocated |
| 757 | * @bandwidth: Isochronous bandwidth units to be (de)allocated |
| 758 | * @handle: Handle to the allocation, written by the kernel (only valid in |
| 759 | * case of %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE ioctls) |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 760 | * |
| 761 | * The %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE ioctl initiates allocation of an |
| 762 | * isochronous channel and/or of isochronous bandwidth at the isochronous |
| 763 | * resource manager (IRM). Only one of the channels specified in @channels is |
| 764 | * allocated. An %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED is sent after |
| 765 | * communication with the IRM, indicating success or failure in the event data. |
| 766 | * The kernel will automatically reallocate the resources after bus resets. |
| 767 | * Should a reallocation fail, an %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event |
| 768 | * will be sent. The kernel will also automatically deallocate the resources |
| 769 | * when the file descriptor is closed. |
| 770 | * |
Stefan Richter | 1ec3c02 | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 771 | * The %FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE ioctl can be used to initiate |
| 772 | * deallocation of resources which were allocated as described above. |
| 773 | * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event concludes this operation. |
| 774 | * |
| 775 | * The %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE ioctl is a variant of allocation |
| 776 | * without automatic re- or deallocation. |
| 777 | * An %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED event concludes this operation, |
| 778 | * indicating success or failure in its data. |
| 779 | * |
| 780 | * The %FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE ioctl works like |
| 781 | * %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE except that resources are freed |
Stefan Richter | 5d9cb7d | 2009-01-08 23:07:40 +0100 | [diff] [blame] | 782 | * instead of allocated. |
Stefan Richter | 1ec3c02 | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 783 | * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event concludes this operation. |
| 784 | * |
Stefan Richter | ca658b1 | 2010-04-10 12:23:09 +0200 | [diff] [blame] | 785 | * To summarize, %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE allocates iso resources |
| 786 | * for the lifetime of the fd or @handle. |
Stefan Richter | 1ec3c02 | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 787 | * In contrast, %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE allocates iso resources |
| 788 | * for the duration of a bus generation. |
| 789 | * |
Stefan Richter | 5d9cb7d | 2009-01-08 23:07:40 +0100 | [diff] [blame] | 790 | * @channels is a host-endian bitfield with the least significant bit |
| 791 | * representing channel 0 and the most significant bit representing channel 63: |
| 792 | * 1ULL << c for each channel c that is a candidate for (de)allocation. |
Jay Fenlason, Stefan Richter | b1bda4c | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 793 | * |
| 794 | * @bandwidth is expressed in bandwidth allocation units, i.e. the time to send |
| 795 | * one quadlet of data (payload or header data) at speed S1600. |
| 796 | */ |
| 797 | struct fw_cdev_allocate_iso_resource { |
| 798 | __u64 closure; |
| 799 | __u64 channels; |
| 800 | __u32 bandwidth; |
| 801 | __u32 handle; |
| 802 | }; |
| 803 | |
Stefan Richter | 33580a3 | 2009-01-04 16:23:29 +0100 | [diff] [blame] | 804 | /** |
Jay Fenlason | f8c2287 | 2009-03-05 19:08:40 +0100 | [diff] [blame] | 805 | * struct fw_cdev_send_stream_packet - send an asynchronous stream packet |
Stefan Richter | 18e9b10 | 2009-03-10 21:02:21 +0100 | [diff] [blame] | 806 | * @length: Length of outgoing payload, in bytes |
| 807 | * @tag: Data format tag |
| 808 | * @channel: Isochronous channel to transmit to |
| 809 | * @sy: Synchronization code |
| 810 | * @closure: Passed back to userspace in the response event |
| 811 | * @data: Userspace pointer to payload |
| 812 | * @generation: The bus generation where packet is valid |
| 813 | * @speed: Speed to transmit at |
Jay Fenlason | f8c2287 | 2009-03-05 19:08:40 +0100 | [diff] [blame] | 814 | * |
| 815 | * The %FW_CDEV_IOC_SEND_STREAM_PACKET ioctl sends an asynchronous stream packet |
Stefan Richter | 18e9b10 | 2009-03-10 21:02:21 +0100 | [diff] [blame] | 816 | * to every device which is listening to the specified channel. The kernel |
| 817 | * writes an &fw_cdev_event_response event which indicates success or failure of |
| 818 | * the transmission. |
Jay Fenlason | f8c2287 | 2009-03-05 19:08:40 +0100 | [diff] [blame] | 819 | */ |
| 820 | struct fw_cdev_send_stream_packet { |
Stefan Richter | 18e9b10 | 2009-03-10 21:02:21 +0100 | [diff] [blame] | 821 | __u32 length; |
| 822 | __u32 tag; |
Jay Fenlason | f8c2287 | 2009-03-05 19:08:40 +0100 | [diff] [blame] | 823 | __u32 channel; |
| 824 | __u32 sy; |
Stefan Richter | 18e9b10 | 2009-03-10 21:02:21 +0100 | [diff] [blame] | 825 | __u64 closure; |
Jay Fenlason | f8c2287 | 2009-03-05 19:08:40 +0100 | [diff] [blame] | 826 | __u64 data; |
Stefan Richter | 18e9b10 | 2009-03-10 21:02:21 +0100 | [diff] [blame] | 827 | __u32 generation; |
| 828 | __u32 speed; |
Jay Fenlason | f8c2287 | 2009-03-05 19:08:40 +0100 | [diff] [blame] | 829 | }; |
| 830 | |
Stefan Richter | 850bb6f | 2010-07-16 22:25:14 +0200 | [diff] [blame^] | 831 | /** |
| 832 | * struct fw_cdev_send_phy_packet - send a PHY packet |
| 833 | * @closure: Passed back to userspace in the PHY-packet-sent event |
| 834 | * @data: First and second quadlet of the PHY packet |
| 835 | * @generation: The bus generation where packet is valid |
| 836 | * |
| 837 | * The %FW_CDEV_IOC_SEND_PHY_PACKET ioctl sends a PHY packet to all nodes |
| 838 | * on the same card as this device. After transmission, an |
| 839 | * %FW_CDEV_EVENT_PHY_PACKET_SENT event is generated. |
| 840 | * |
| 841 | * The payload @data[] shall be specified in host byte order. Usually, |
| 842 | * @data[1] needs to be the bitwise inverse of @data[0]. VersaPHY packets |
| 843 | * are an exception to this rule. |
| 844 | * |
| 845 | * The ioctl is only permitted on device files which represent a local node. |
| 846 | */ |
| 847 | struct fw_cdev_send_phy_packet { |
| 848 | __u64 closure; |
| 849 | __u32 data[2]; |
| 850 | __u32 generation; |
| 851 | }; |
| 852 | |
Kristian Høgsberg | 4c5a443 | 2007-05-07 20:33:37 -0400 | [diff] [blame] | 853 | #endif /* _LINUX_FIREWIRE_CDEV_H */ |