--- /dev/null
+# This file is part of systemd.
+
+# Description
+#
+# Each node on IEEE 1394 bus has configuration ROM with information for identification. Although the
+# typical content of configuration ROM is defined by 1394 Trading Association, many nodes have own
+# quirks. This database includes supplemental information to unit in the node.
+
+# Convention
+#
+# One entry has two keys. One is customized key to match a node. Another is for kernel alias to
+# match an unit included in the node.
+#
+# The customized key has two formats according to whether the node has model attribute:
+# - ven0x000000mo0x000000units0x000000:0x000000
+# - ven0x000000units0x000000:0x000000
+#
+# Even when the node has multiple units, the entry should match to one of the units. In the case,
+# the customized key should have wild pattern for units field:
+# - ven0x000000mo0x000000units*0x000000:0x000000*
+# - ven0x000000units*0x000000:0x000000*
+#
+# The hexadecimal digits part of the customized key should be lower-case. Linux FireWire subsystem
+# uses lower-case value for attributes of sysfs node, and systemd-hwdb parses the custom key by
+# case-sensitive way. On the other hand, it parses kernel alias by case-insensitive way.
+#
+# The entry should have some of IEEE1394_UNIT_FUNCTION_XXX environment variables to express function
+# of the unit. The variables are used to decide group owner of special file for character device
+# corresponding to node including the unit. At present, below variables are supported:
+# - IEEE1394_UNIT_FUNCTION_MIDI
+# - For any unit to process MIDI messages. For example, the unit includes AV/C music subunit.
+# - IEEE1394_UNIT_FUNCTION_AUDIO
+# - For any unit to process audio signal. For example, the unit includes AV/C audio subunit.
+# - IEEE1394_UNIT_FUNCTION_VIDEO
+# - For any unit to process video signal.
+#
+# Additionally, ID_VENDOR_FROM_DATABASE and ID_MODEL_FROM_DATABASE environment variables are
+# preferable.
70-mouse.hwdb
70-pointingstick.hwdb
70-touchpad.hwdb
+ 80-ieee1394-unit-function.hwdb
'''.split())
if conf.get('ENABLE_HWDB') == 1
SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", GROUP="video"
SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", GROUP="video"
+SUBSYSTEM=="firewire", TEST=="units", TEST=="model", \
+ IMPORT{builtin}="hwdb 'ieee1394:node:ven$attr{vendor}mo$attr{model}units$attr{units}'"
+
+SUBSYSTEM=="firewire", TEST=="units", TEST!="model", \
+ IMPORT{builtin}="hwdb 'ieee1394:node:ven$attr{vendor}units$attr{units}'"
+
+SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_MIDI}=="1", GROUP="audio"
+SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_AUDIO}=="1", GROUP="audio"
+SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_VIDEO}=="1", GROUP="video"
+
KERNEL=="parport[0-9]*", GROUP="lp"
SUBSYSTEM=="printer", KERNEL=="lp*", GROUP="lp"
SUBSYSTEM=="ppdev", GROUP="lp"
SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", TAG+="uaccess"
SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", TAG+="uaccess"
+SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_MIDI}=="1", TAG+="uaccess"
+SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_AUDIO}=="1", TAG+="uaccess"
+SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_VIDEO}=="1", TAG+="uaccess"
+
# DRI video devices
SUBSYSTEM=="drm", KERNEL=="card*", TAG+="uaccess"
m4_ifdef(`GROUP_RENDER_UACCESS',``