firewire-cdev.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. /*
  2. * Char device interface.
  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. #ifndef _LINUX_FIREWIRE_CDEV_H
  21. #define _LINUX_FIREWIRE_CDEV_H
  22. #include <linux/ioctl.h>
  23. #include <linux/types.h>
  24. #include <linux/firewire-constants.h>
  25. #define FW_CDEV_EVENT_BUS_RESET 0x00
  26. #define FW_CDEV_EVENT_RESPONSE 0x01
  27. #define FW_CDEV_EVENT_REQUEST 0x02
  28. #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03
  29. #define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04
  30. #define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05
  31. /**
  32. * struct fw_cdev_event_common - Common part of all fw_cdev_event_ types
  33. * @closure: For arbitrary use by userspace
  34. * @type: Discriminates the fw_cdev_event_ types
  35. *
  36. * This struct may be used to access generic members of all fw_cdev_event_
  37. * types regardless of the specific type.
  38. *
  39. * Data passed in the @closure field for a request will be returned in the
  40. * corresponding event. It is big enough to hold a pointer on all platforms.
  41. * The ioctl used to set @closure depends on the @type of event.
  42. */
  43. struct fw_cdev_event_common {
  44. __u64 closure;
  45. __u32 type;
  46. };
  47. /**
  48. * struct fw_cdev_event_bus_reset - Sent when a bus reset occurred
  49. * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_GET_INFO ioctl
  50. * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_BUS_RESET
  51. * @node_id: New node ID of this node
  52. * @local_node_id: Node ID of the local node, i.e. of the controller
  53. * @bm_node_id: Node ID of the bus manager
  54. * @irm_node_id: Node ID of the iso resource manager
  55. * @root_node_id: Node ID of the root node
  56. * @generation: New bus generation
  57. *
  58. * This event is sent when the bus the device belongs to goes through a bus
  59. * reset. It provides information about the new bus configuration, such as
  60. * new node ID for this device, new root ID, and others.
  61. */
  62. struct fw_cdev_event_bus_reset {
  63. __u64 closure;
  64. __u32 type;
  65. __u32 node_id;
  66. __u32 local_node_id;
  67. __u32 bm_node_id;
  68. __u32 irm_node_id;
  69. __u32 root_node_id;
  70. __u32 generation;
  71. };
  72. /**
  73. * struct fw_cdev_event_response - Sent when a response packet was received
  74. * @closure: See &fw_cdev_event_common;
  75. * set by %FW_CDEV_IOC_SEND_REQUEST ioctl
  76. * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_RESPONSE
  77. * @rcode: Response code returned by the remote node
  78. * @length: Data length, i.e. the response's payload size in bytes
  79. * @data: Payload data, if any
  80. *
  81. * This event is sent when the stack receives a response to an outgoing request
  82. * sent by %FW_CDEV_IOC_SEND_REQUEST ioctl. The payload data for responses
  83. * carrying data (read and lock responses) follows immediately and can be
  84. * accessed through the @data field.
  85. */
  86. struct fw_cdev_event_response {
  87. __u64 closure;
  88. __u32 type;
  89. __u32 rcode;
  90. __u32 length;
  91. __u32 data[0];
  92. };
  93. /**
  94. * struct fw_cdev_event_request - Sent on incoming request to an address region
  95. * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl
  96. * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST
  97. * @tcode: Transaction code of the incoming request
  98. * @offset: The offset into the 48-bit per-node address space
  99. * @handle: Reference to the kernel-side pending request
  100. * @length: Data length, i.e. the request's payload size in bytes
  101. * @data: Incoming data, if any
  102. *
  103. * This event is sent when the stack receives an incoming request to an address
  104. * region registered using the %FW_CDEV_IOC_ALLOCATE ioctl. The request is
  105. * guaranteed to be completely contained in the specified region. Userspace is
  106. * responsible for sending the response by %FW_CDEV_IOC_SEND_RESPONSE ioctl,
  107. * using the same @handle.
  108. *
  109. * The payload data for requests carrying data (write and lock requests)
  110. * follows immediately and can be accessed through the @data field.
  111. */
  112. struct fw_cdev_event_request {
  113. __u64 closure;
  114. __u32 type;
  115. __u32 tcode;
  116. __u64 offset;
  117. __u32 handle;
  118. __u32 length;
  119. __u32 data[0];
  120. };
  121. /**
  122. * struct fw_cdev_event_iso_interrupt - Sent when an iso packet was completed
  123. * @closure: See &fw_cdev_event_common;
  124. * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl
  125. * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_ISO_INTERRUPT
  126. * @cycle: Cycle counter of the interrupt packet
  127. * @header_length: Total length of following headers, in bytes
  128. * @header: Stripped headers, if any
  129. *
  130. * This event is sent when the controller has completed an &fw_cdev_iso_packet
  131. * with the %FW_CDEV_ISO_INTERRUPT bit set. In the receive case, the headers
  132. * stripped of all packets up until and including the interrupt packet are
  133. * returned in the @header field.
  134. */
  135. struct fw_cdev_event_iso_interrupt {
  136. __u64 closure;
  137. __u32 type;
  138. __u32 cycle;
  139. __u32 header_length;
  140. __u32 header[0];
  141. };
  142. /**
  143. * struct fw_cdev_event_iso_resource - Iso resources were allocated or freed
  144. * @closure: See &fw_cdev_event_common;
  145. * set by %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE ioctl
  146. * @type: %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or
  147. * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED
  148. * @handle: Reference by which an allocated resource can be deallocated
  149. * @channel: Isochronous channel which was (de)allocated, if any
  150. * @bandwidth: Bandwidth allocation units which were (de)allocated, if any
  151. * @channels_available: Last known availability of channels
  152. * @bandwidth_available: Last known availability of bandwidth
  153. *
  154. * An %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED event is sent after an isochronous
  155. * resource was allocated at the IRM. The client has to check @channel and
  156. * @bandwidth for whether the allocation actually succeeded.
  157. *
  158. * @channel is <0 if no channel was allocated.
  159. * @bandwidth is 0 if no bandwidth was allocated.
  160. *
  161. * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event is sent after an isochronous
  162. * resource was deallocated at the IRM. It is also sent when automatic
  163. * reallocation after a bus reset failed.
  164. */
  165. struct fw_cdev_event_iso_resource {
  166. __u64 closure;
  167. __u32 type;
  168. __u32 handle;
  169. __s32 channel;
  170. __s32 bandwidth;
  171. };
  172. /**
  173. * union fw_cdev_event - Convenience union of fw_cdev_event_ types
  174. * @common: Valid for all types
  175. * @bus_reset: Valid if @common.type == %FW_CDEV_EVENT_BUS_RESET
  176. * @response: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE
  177. * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST
  178. * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT
  179. * @iso_resource: Valid if @common.type ==
  180. * %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or
  181. * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED
  182. *
  183. * Convenience union for userspace use. Events could be read(2) into an
  184. * appropriately aligned char buffer and then cast to this union for further
  185. * processing. Note that for a request, response or iso_interrupt event,
  186. * the data[] or header[] may make the size of the full event larger than
  187. * sizeof(union fw_cdev_event). Also note that if you attempt to read(2)
  188. * an event into a buffer that is not large enough for it, the data that does
  189. * not fit will be discarded so that the next read(2) will return a new event.
  190. */
  191. union fw_cdev_event {
  192. struct fw_cdev_event_common common;
  193. struct fw_cdev_event_bus_reset bus_reset;
  194. struct fw_cdev_event_response response;
  195. struct fw_cdev_event_request request;
  196. struct fw_cdev_event_iso_interrupt iso_interrupt;
  197. struct fw_cdev_event_iso_resource iso_resource;
  198. };
  199. /* available since kernel version 2.6.22 */
  200. #define FW_CDEV_IOC_GET_INFO _IOWR('#', 0x00, struct fw_cdev_get_info)
  201. #define FW_CDEV_IOC_SEND_REQUEST _IOW('#', 0x01, struct fw_cdev_send_request)
  202. #define FW_CDEV_IOC_ALLOCATE _IOWR('#', 0x02, struct fw_cdev_allocate)
  203. #define FW_CDEV_IOC_DEALLOCATE _IOW('#', 0x03, struct fw_cdev_deallocate)
  204. #define FW_CDEV_IOC_SEND_RESPONSE _IOW('#', 0x04, struct fw_cdev_send_response)
  205. #define FW_CDEV_IOC_INITIATE_BUS_RESET _IOW('#', 0x05, struct fw_cdev_initiate_bus_reset)
  206. #define FW_CDEV_IOC_ADD_DESCRIPTOR _IOWR('#', 0x06, struct fw_cdev_add_descriptor)
  207. #define FW_CDEV_IOC_REMOVE_DESCRIPTOR _IOW('#', 0x07, struct fw_cdev_remove_descriptor)
  208. #define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IOWR('#', 0x08, struct fw_cdev_create_iso_context)
  209. #define FW_CDEV_IOC_QUEUE_ISO _IOWR('#', 0x09, struct fw_cdev_queue_iso)
  210. #define FW_CDEV_IOC_START_ISO _IOW('#', 0x0a, struct fw_cdev_start_iso)
  211. #define FW_CDEV_IOC_STOP_ISO _IOW('#', 0x0b, struct fw_cdev_stop_iso)
  212. /* available since kernel version 2.6.24 */
  213. #define FW_CDEV_IOC_GET_CYCLE_TIMER _IOR('#', 0x0c, struct fw_cdev_get_cycle_timer)
  214. /* available since kernel version 2.6.30 */
  215. #define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE _IOWR('#', 0x0d, struct fw_cdev_allocate_iso_resource)
  216. #define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE _IOW('#', 0x0e, struct fw_cdev_deallocate)
  217. /* FW_CDEV_VERSION History
  218. *
  219. * 1 Feb 18, 2007: Initial version.
  220. */
  221. #define FW_CDEV_VERSION 1
  222. /**
  223. * struct fw_cdev_get_info - General purpose information ioctl
  224. * @version: The version field is just a running serial number.
  225. * We never break backwards compatibility, but may add more
  226. * structs and ioctls in later revisions.
  227. * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration
  228. * ROM will be copied into that user space address. In either
  229. * case, @rom_length is updated with the actual length of the
  230. * configuration ROM.
  231. * @rom: If non-zero, address of a buffer to be filled by a copy of the
  232. * device's configuration ROM
  233. * @bus_reset: If non-zero, address of a buffer to be filled by a
  234. * &struct fw_cdev_event_bus_reset with the current state
  235. * of the bus. This does not cause a bus reset to happen.
  236. * @bus_reset_closure: Value of &closure in this and subsequent bus reset events
  237. * @card: The index of the card this device belongs to
  238. */
  239. struct fw_cdev_get_info {
  240. __u32 version;
  241. __u32 rom_length;
  242. __u64 rom;
  243. __u64 bus_reset;
  244. __u64 bus_reset_closure;
  245. __u32 card;
  246. };
  247. /**
  248. * struct fw_cdev_send_request - Send an asynchronous request packet
  249. * @tcode: Transaction code of the request
  250. * @length: Length of outgoing payload, in bytes
  251. * @offset: 48-bit offset at destination node
  252. * @closure: Passed back to userspace in the response event
  253. * @data: Userspace pointer to payload
  254. * @generation: The bus generation where packet is valid
  255. *
  256. * Send a request to the device. This ioctl implements all outgoing requests.
  257. * Both quadlet and block request specify the payload as a pointer to the data
  258. * in the @data field. Once the transaction completes, the kernel writes an
  259. * &fw_cdev_event_response event back. The @closure field is passed back to
  260. * user space in the response event.
  261. */
  262. struct fw_cdev_send_request {
  263. __u32 tcode;
  264. __u32 length;
  265. __u64 offset;
  266. __u64 closure;
  267. __u64 data;
  268. __u32 generation;
  269. };
  270. /**
  271. * struct fw_cdev_send_response - Send an asynchronous response packet
  272. * @rcode: Response code as determined by the userspace handler
  273. * @length: Length of outgoing payload, in bytes
  274. * @data: Userspace pointer to payload
  275. * @handle: The handle from the &fw_cdev_event_request
  276. *
  277. * Send a response to an incoming request. By setting up an address range using
  278. * the %FW_CDEV_IOC_ALLOCATE ioctl, userspace can listen for incoming requests. An
  279. * incoming request will generate an %FW_CDEV_EVENT_REQUEST, and userspace must
  280. * send a reply using this ioctl. The event has a handle to the kernel-side
  281. * pending transaction, which should be used with this ioctl.
  282. */
  283. struct fw_cdev_send_response {
  284. __u32 rcode;
  285. __u32 length;
  286. __u64 data;
  287. __u32 handle;
  288. };
  289. /**
  290. * struct fw_cdev_allocate - Allocate a CSR address range
  291. * @offset: Start offset of the address range
  292. * @closure: To be passed back to userspace in request events
  293. * @length: Length of the address range, in bytes
  294. * @handle: Handle to the allocation, written by the kernel
  295. *
  296. * Allocate an address range in the 48-bit address space on the local node
  297. * (the controller). This allows userspace to listen for requests with an
  298. * offset within that address range. When the kernel receives a request
  299. * within the range, an &fw_cdev_event_request event will be written back.
  300. * The @closure field is passed back to userspace in the response event.
  301. * The @handle field is an out parameter, returning a handle to the allocated
  302. * range to be used for later deallocation of the range.
  303. */
  304. struct fw_cdev_allocate {
  305. __u64 offset;
  306. __u64 closure;
  307. __u32 length;
  308. __u32 handle;
  309. };
  310. /**
  311. * struct fw_cdev_deallocate - Free a CSR address range or isochronous resource
  312. * @handle: Handle to the address range or iso resource, as returned by the
  313. * kernel when the range or resource was allocated
  314. */
  315. struct fw_cdev_deallocate {
  316. __u32 handle;
  317. };
  318. #define FW_CDEV_LONG_RESET 0
  319. #define FW_CDEV_SHORT_RESET 1
  320. /**
  321. * struct fw_cdev_initiate_bus_reset - Initiate a bus reset
  322. * @type: %FW_CDEV_SHORT_RESET or %FW_CDEV_LONG_RESET
  323. *
  324. * Initiate a bus reset for the bus this device is on. The bus reset can be
  325. * either the original (long) bus reset or the arbitrated (short) bus reset
  326. * introduced in 1394a-2000.
  327. */
  328. struct fw_cdev_initiate_bus_reset {
  329. __u32 type; /* FW_CDEV_SHORT_RESET or FW_CDEV_LONG_RESET */
  330. };
  331. /**
  332. * struct fw_cdev_add_descriptor - Add contents to the local node's config ROM
  333. * @immediate: If non-zero, immediate key to insert before pointer
  334. * @key: Upper 8 bits of root directory pointer
  335. * @data: Userspace pointer to contents of descriptor block
  336. * @length: Length of descriptor block data, in bytes
  337. * @handle: Handle to the descriptor, written by the kernel
  338. *
  339. * Add a descriptor block and optionally a preceding immediate key to the local
  340. * node's configuration ROM.
  341. *
  342. * The @key field specifies the upper 8 bits of the descriptor root directory
  343. * pointer and the @data and @length fields specify the contents. The @key
  344. * should be of the form 0xXX000000. The offset part of the root directory entry
  345. * will be filled in by the kernel.
  346. *
  347. * If not 0, the @immediate field specifies an immediate key which will be
  348. * inserted before the root directory pointer.
  349. *
  350. * If successful, the kernel adds the descriptor and writes back a handle to the
  351. * kernel-side object to be used for later removal of the descriptor block and
  352. * immediate key.
  353. */
  354. struct fw_cdev_add_descriptor {
  355. __u32 immediate;
  356. __u32 key;
  357. __u64 data;
  358. __u32 length;
  359. __u32 handle;
  360. };
  361. /**
  362. * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM
  363. * @handle: Handle to the descriptor, as returned by the kernel when the
  364. * descriptor was added
  365. *
  366. * Remove a descriptor block and accompanying immediate key from the local
  367. * node's configuration ROM.
  368. */
  369. struct fw_cdev_remove_descriptor {
  370. __u32 handle;
  371. };
  372. #define FW_CDEV_ISO_CONTEXT_TRANSMIT 0
  373. #define FW_CDEV_ISO_CONTEXT_RECEIVE 1
  374. /**
  375. * struct fw_cdev_create_iso_context - Create a context for isochronous IO
  376. * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE
  377. * @header_size: Header size to strip for receive contexts
  378. * @channel: Channel to bind to
  379. * @speed: Speed to transmit at
  380. * @closure: To be returned in &fw_cdev_event_iso_interrupt
  381. * @handle: Handle to context, written back by kernel
  382. *
  383. * Prior to sending or receiving isochronous I/O, a context must be created.
  384. * The context records information about the transmit or receive configuration
  385. * and typically maps to an underlying hardware resource. A context is set up
  386. * for either sending or receiving. It is bound to a specific isochronous
  387. * channel.
  388. *
  389. * If a context was successfully created, the kernel writes back a handle to the
  390. * context, which must be passed in for subsequent operations on that context.
  391. */
  392. struct fw_cdev_create_iso_context {
  393. __u32 type;
  394. __u32 header_size;
  395. __u32 channel;
  396. __u32 speed;
  397. __u64 closure;
  398. __u32 handle;
  399. };
  400. #define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v)
  401. #define FW_CDEV_ISO_INTERRUPT (1 << 16)
  402. #define FW_CDEV_ISO_SKIP (1 << 17)
  403. #define FW_CDEV_ISO_SYNC (1 << 17)
  404. #define FW_CDEV_ISO_TAG(v) ((v) << 18)
  405. #define FW_CDEV_ISO_SY(v) ((v) << 20)
  406. #define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24)
  407. /**
  408. * struct fw_cdev_iso_packet - Isochronous packet
  409. * @control: Contains the header length (8 uppermost bits), the sy field
  410. * (4 bits), the tag field (2 bits), a sync flag (1 bit),
  411. * a skip flag (1 bit), an interrupt flag (1 bit), and the
  412. * payload length (16 lowermost bits)
  413. * @header: Header and payload
  414. *
  415. * &struct fw_cdev_iso_packet is used to describe isochronous packet queues.
  416. *
  417. * Use the FW_CDEV_ISO_ macros to fill in @control. The sy and tag fields are
  418. * specified by IEEE 1394a and IEC 61883.
  419. *
  420. * FIXME - finish this documentation
  421. */
  422. struct fw_cdev_iso_packet {
  423. __u32 control;
  424. __u32 header[0];
  425. };
  426. /**
  427. * struct fw_cdev_queue_iso - Queue isochronous packets for I/O
  428. * @packets: Userspace pointer to packet data
  429. * @data: Pointer into mmap()'ed payload buffer
  430. * @size: Size of packet data in bytes
  431. * @handle: Isochronous context handle
  432. *
  433. * Queue a number of isochronous packets for reception or transmission.
  434. * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs,
  435. * which describe how to transmit from or receive into a contiguous region
  436. * of a mmap()'ed payload buffer. As part of the packet descriptors,
  437. * a series of headers can be supplied, which will be prepended to the
  438. * payload during DMA.
  439. *
  440. * The kernel may or may not queue all packets, but will write back updated
  441. * values of the @packets, @data and @size fields, so the ioctl can be
  442. * resubmitted easily.
  443. */
  444. struct fw_cdev_queue_iso {
  445. __u64 packets;
  446. __u64 data;
  447. __u32 size;
  448. __u32 handle;
  449. };
  450. #define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1
  451. #define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2
  452. #define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4
  453. #define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8
  454. #define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15
  455. /**
  456. * struct fw_cdev_start_iso - Start an isochronous transmission or reception
  457. * @cycle: Cycle in which to start I/O. If @cycle is greater than or
  458. * equal to 0, the I/O will start on that cycle.
  459. * @sync: Determines the value to wait for for receive packets that have
  460. * the %FW_CDEV_ISO_SYNC bit set
  461. * @tags: Tag filter bit mask. Only valid for isochronous reception.
  462. * Determines the tag values for which packets will be accepted.
  463. * Use FW_CDEV_ISO_CONTEXT_MATCH_ macros to set @tags.
  464. * @handle: Isochronous context handle within which to transmit or receive
  465. */
  466. struct fw_cdev_start_iso {
  467. __s32 cycle;
  468. __u32 sync;
  469. __u32 tags;
  470. __u32 handle;
  471. };
  472. /**
  473. * struct fw_cdev_stop_iso - Stop an isochronous transmission or reception
  474. * @handle: Handle of isochronous context to stop
  475. */
  476. struct fw_cdev_stop_iso {
  477. __u32 handle;
  478. };
  479. /**
  480. * struct fw_cdev_get_cycle_timer - read cycle timer register
  481. * @local_time: system time, in microseconds since the Epoch
  482. * @cycle_timer: isochronous cycle timer, as per OHCI 1.1 clause 5.13
  483. *
  484. * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer
  485. * and also the system clock. This allows to express the receive time of an
  486. * isochronous packet as a system time with microsecond accuracy.
  487. */
  488. struct fw_cdev_get_cycle_timer {
  489. __u64 local_time;
  490. __u32 cycle_timer;
  491. };
  492. /**
  493. * struct fw_cdev_allocate_iso_resource - Allocate a channel or bandwidth
  494. * @closure: Passed back to userspace in correponding iso resource events
  495. * @channels: Isochronous channels of which one is to be allocated
  496. * @bandwidth: Isochronous bandwidth units to be allocated
  497. * @handle: Handle to the allocation, written by the kernel
  498. *
  499. * The %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE ioctl initiates allocation of an
  500. * isochronous channel and/or of isochronous bandwidth at the isochronous
  501. * resource manager (IRM). Only one of the channels specified in @channels is
  502. * allocated. An %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED is sent after
  503. * communication with the IRM, indicating success or failure in the event data.
  504. * The kernel will automatically reallocate the resources after bus resets.
  505. * Should a reallocation fail, an %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event
  506. * will be sent. The kernel will also automatically deallocate the resources
  507. * when the file descriptor is closed.
  508. *
  509. * @channels is a host-endian bitfield with the most significant bit
  510. * representing channel 0 and the least significant bit representing channel 63:
  511. * 1ULL << (63 - c)
  512. *
  513. * @bandwidth is expressed in bandwidth allocation units, i.e. the time to send
  514. * one quadlet of data (payload or header data) at speed S1600.
  515. */
  516. struct fw_cdev_allocate_iso_resource {
  517. __u64 closure;
  518. __u64 channels;
  519. __u32 bandwidth;
  520. __u32 handle;
  521. };
  522. #endif /* _LINUX_FIREWIRE_CDEV_H */