firewire-cdev 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. What: /dev/fw[0-9]+
  2. Date: May 2007
  3. KernelVersion: 2.6.22
  4. Contact: linux1394-devel@lists.sourceforge.net
  5. Description:
  6. The character device files /dev/fw* are the interface between
  7. firewire-core and IEEE 1394 device drivers implemented in
  8. userspace. The ioctl(2)- and read(2)-based ABI is defined and
  9. documented in <linux/firewire-cdev.h>.
  10. This ABI offers most of the features which firewire-core also
  11. exposes to kernelspace IEEE 1394 drivers.
  12. Each /dev/fw* is associated with one IEEE 1394 node, which can
  13. be remote or local nodes. Operations on a /dev/fw* file have
  14. different scope:
  15. - The 1394 node which is associated with the file:
  16. - Asynchronous request transmission
  17. - Get the Configuration ROM
  18. - Query node ID
  19. - Query maximum speed of the path between this node
  20. and local node
  21. - The 1394 bus (i.e. "card") to which the node is attached to:
  22. - Isochronous stream transmission and reception
  23. - Asynchronous stream transmission and reception
  24. - Asynchronous broadcast request transmission
  25. - PHY packet transmission and reception
  26. - Allocate, reallocate, deallocate isochronous
  27. resources (channels, bandwidth) at the bus's IRM
  28. - Query node IDs of local node, root node, IRM, bus
  29. manager
  30. - Query cycle time
  31. - Bus reset initiation, bus reset event reception
  32. - All 1394 buses:
  33. - Allocation of IEEE 1212 address ranges on the local
  34. link layers, reception of inbound requests to such
  35. an address range, asynchronous response transmission
  36. to inbound requests
  37. - Addition of descriptors or directories to the local
  38. nodes' Configuration ROM
  39. Due to the different scope of operations and in order to let
  40. userland implement different access permission models, some
  41. operations are restricted to /dev/fw* files that are associated
  42. with a local node:
  43. - Addition of descriptors or directories to the local
  44. nodes' Configuration ROM
  45. - PHY packet transmission and reception
  46. A /dev/fw* file remains associated with one particular node
  47. during its entire life time. Bus topology changes, and hence
  48. node ID changes, are tracked by firewire-core. ABI users do not
  49. need to be aware of topology.
  50. The following file operations are supported:
  51. open(2)
  52. Currently the only useful flags are O_RDWR.
  53. ioctl(2)
  54. Initiate various actions. Some take immediate effect, others
  55. are performed asynchronously while or after the ioctl returns.
  56. See the inline documentation in <linux/firewire-cdev.h> for
  57. descriptions of all ioctls.
  58. poll(2), select(2), epoll_wait(2) etc.
  59. Watch for events to become available to be read.
  60. read(2)
  61. Receive various events. There are solicited events like
  62. outbound asynchronous transaction completion or isochronous
  63. buffer completion, and unsolicited events such as bus resets,
  64. request reception, or PHY packet reception. Always use a read
  65. buffer which is large enough to receive the largest event that
  66. could ever arrive. See <linux/firewire-cdev.h> for descriptions
  67. of all event types and for which ioctls affect reception of
  68. events.
  69. mmap(2)
  70. Allocate a DMA buffer for isochronous reception or transmission
  71. and map it into the process address space. The arguments should
  72. be used as follows: addr = NULL, length = the desired buffer
  73. size, i.e. number of packets times size of largest packet,
  74. prot = at least PROT_READ for reception and at least PROT_WRITE
  75. for transmission, flags = MAP_SHARED, fd = the handle to the
  76. /dev/fw*, offset = 0.
  77. Isochronous reception works in packet-per-buffer fashion except
  78. for multichannel reception which works in buffer-fill mode.
  79. munmap(2)
  80. Unmap the isochronous I/O buffer from the process address space.
  81. close(2)
  82. Besides stopping and freeing I/O contexts that were associated
  83. with the file descriptor, back out any changes to the local
  84. nodes' Configuration ROM. Deallocate isochronous channels and
  85. bandwidth at the IRM that were marked for kernel-assisted
  86. re- and deallocation.
  87. Users: libraw1394
  88. libdc1394
  89. tools like jujuutils, fwhack, ...