Debian Codegraph @

etc/udev/z99_comedi.rules

raw
1 #This file provides some example udev rules which may be helpful for comedi.
2 #It includes rules for creating symlinks to the device file with
3 #persistent names in /dev/comedi/by-path/, setting permissions and
4 #group ownership on the comedi device files, and examples showing
5 #adjustment of a device file's buffer size.
6
7 SUBSYSTEM!="comedi", GOTO="comedi_end"
8
9
10 ACTION!="add", GOTO="comedi_add_end"
11
12
13 #create symlink with persistent name based on hardware path
14 KERNEL=="comedi[0-9]*", KERNEL!="comedi[0-9]*_subd[0-9]*", SUBSYSTEMS=="pci", SYMLINK+="comedi/by-path/pci-$id"
15
16 #persistent subdevice symlinks
17 KERNEL=="comedi[0-9]*subd[0-9]*", SUBSYSTEMS=="pci", SYMLINK+="comedi/by-path/pci-$id_subd%n"
18
19
20 #The following line would automatically run comedi_config on main device file
21 #to adjust the read buffer size for a specific board at pci path
22 #0000:07:0d.0 (bus 0x7, slot 0xd).
23 #KERNEL=="comedi[0-9]*", KERNEL!="comedi[0-9]*_subd[0-9]*", SUBSYSTEMS=="pci", KERNELS=="0000:07:0d.0", RUN+="/usr/local/sbin/comedi_config $tempnode --read-buffer 1024"
24
25 #Here we do the same, except we are matching by pci vendor/device id instead of bus/slot
26 #KERNEL=="comedi[0-9]*", KERNEL!="comedi[0-9]*_subd[0-9]*", SUBSYSTEMS=="pci", ATTRS{vendor}=="0x1093", ATTRS{device}=="0x70bf", RUN+="/usr/local/sbin/comedi_config $tempnode --read-buffer 1024"
27
28
29 # wide open device file permissions
30 KERNEL=="comedi[0-9]*", MODE="0666"
31
32 # device files restricted to the "comedi" group
33 #KERNEL=="comedi[0-9]*", MODE="0660", GROUP="comedi"
34
35 # device files restricted to the "iocard" group
36 #KERNEL=="comedi[0-9]*", MODE="0660", GROUP="iocard"
37
38
39 LABEL="comedi_add_end"
40
41
42 LABEL="comedi_end"
43