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