# There are a number of modifiers that are allowed to be used in some of the
# fields.  See the udev man page for a full description of them.

# tty devices
KERNEL=="console", 	NAME="%k", MODE="0600"
KERNEL=="tty",		NAME="%k", MODE="0666"
KERNEL=="tty[0-9]*", 	NAME="vc/%n",  SYMLINK="%k"
KERNEL=="ttyS[0-9]*", 	NAME="tts/%n", SYMLINK="%k"
KERNEL=="ttyUSB[0-9]*", NAME="tts/USB%n", SYMLINK="%k", MODE="0660"
KERNEL=="ippp0", 	NAME="%k"
KERNEL=="isdn*", 	NAME="%k"
KERNEL=="dcbri*", 	NAME="%k"
KERNEL=="ircomm*", 	NAME="%k"

# pty devices
KERNEL=="ptmx", 		NAME="%k", MODE="0666"
KERNEL=="pty[p-za-e][0-9a-f]*", NAME="pty/m%n", SYMLINK="%k"
KERNEL=="tty[p-za-e][0-9a-f]*", NAME="pty/s%n", SYMLINK="%k"

# vc devices
KERNEL=="vcs", 		NAME="vcc/0", 	SYMLINK="%k"
KERNEL=="vcs[0-9]*", 	NAME="vcc/%n", 	SYMLINK="%k"
KERNEL=="vcsa", 	NAME="vcc/a0", 	SYMLINK="%k"
KERNEL=="vcsa[0-9]*", 	NAME="vcc/a%n", SYMLINK="%k"

# device mapper creates its own device nodes so ignore these
KERNEL=="dm-[0-9]*", 	OPTIONS="ignore_device"
KERNEL=="device-mapper", NAME="mapper/control"

# disk devices
KERNEL=="sd*",           NAME="%k", GROUP="disk"
KERNEL=="dasd*",         NAME="%k", GROUP="disk"
KERNEL=="ataraid*",      NAME="%k", GROUP="disk"
SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", GROUP="disk"
SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", GROUP="burning"

# all block devices
SUBSYSTEM=="block", GROUP="disk", MODE="0640"
SUBSYSTEM=="block", ATTRS{removable}=="1", GROUP="floppy", MODE="0660"

# scsi cdrom devices
SUBSYSTEMS=="scsi", KERNEL=="s[grt][0-9]*", ATTRS{type}=="5", MODE="0660", GROUP="cdrom"

# tape devices
KERNEL=="ht*", 		NAME="%k"
KERNEL=="nht*", 	NAME="%k"
KERNEL=="pt*", 		NAME="%k"
KERNEL=="npt*", 	NAME="%k"
KERNEL=="st*", 		NAME="%k"
KERNEL=="nst*", 	NAME="%k"
KERNEL=="osst*", 	NAME="%k"
KERNEL=="nosst*", 	NAME="%k"

# input devices
KERNEL=="mice", 	NAME="input/%k", MODE="0644"
KERNEL=="mouse*", 	NAME="input/%k", MODE="0644"
KERNEL=="event*", 	NAME="input/%k", MODE="0644"
KERNEL=="js*", 		NAME="input/%k", MODE="0644"
KERNEL=="ts*", 		NAME="input/%k", MODE="0644"
KERNEL=="psaux", 	NAME="input/%k", SYMLINK="%k", MODE="0644"

# misc devices
KERNEL=="agpgart", 	NAME="misc/%k", SYMLINK="%k"
KERNEL=="rtc", 		NAME="misc/%k", SYMLINK+="%k", MODE="0644"
KERNEL=="uinput", 	NAME="misc/%k", SYMLINK+="%k"
KERNEL=="inotify", 	NAME="misc/%k", SYMLINK+="%k", MODE="0666"

# capi devices
KERNEL=="capi",          NAME="capi20", SYMLINK="isdn/capi20"
KERNEL=="capi*",         NAME="capi/%n"

# cpu devices
KERNEL=="cpu[0-9]*", 	NAME="cpu/%n/cpuid"
KERNEL=="msr[0-9]*", 	NAME="cpu/%n/msr"
KERNEL=="microcode", 	NAME="cpu/microcode"

# i2c devices
KERNEL=="i2c-[0-9]*", 	NAME="i2c/%n", SYMLINK+="%k"

# loop devices
KERNEL=="loop[0-9]*", 	NAME="loop/%n", SYMLINK+="%k", GROUP="disk"

# md block devices
KERNEL=="md[0-9]*", 	NAME="md/%n", SYMLINK+="%k", GROUP="disk"

# aoe char devices,
SUBSYSTEM=="aoe", KERNEL=="discover", 	NAME="etherd/%k", GROUP="disk", MODE="0220"
SUBSYSTEM=="aoe", KERNEL=="err", 	NAME="etherd/%k", GROUP="disk", MODE="0440"
SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k", GROUP="disk", MODE="0220"

# netlink devices
KERNEL=="route", 	NAME="netlink/%k"
KERNEL=="skip", 	NAME="netlink/%k"
KERNEL=="usersock", 	NAME="netlink/%k"
KERNEL=="fwmonitor", 	NAME="netlink/%k"
KERNEL=="tcpdiag", 	NAME="netlink/%k"
KERNEL=="nflog", 	NAME="netlink/%k"
KERNEL=="xfrm", 	NAME="netlink/%k"
KERNEL=="arpd", 	NAME="netlink/%k"
KERNEL=="route6", 	NAME="netlink/%k"
KERNEL=="ip6_fw", 	NAME="netlink/%k"
KERNEL=="dnrtmsg", 	NAME="netlink/%k"
KERNEL=="tap*", 	NAME="netlink/%k"

# ramdisk devices
KERNEL=="ram[0-9]*", 	NAME="rd/%n", SYMLINK+="%k"

# IEEE1394 (firewire) devices (must be before raw devices below)
KERNEL=="raw1394", 	NAME="%k", 		GROUP="video"
KERNEL=="dv1394*", 	NAME="dv1394/%n", 	GROUP="video"
KERNEL=="video1394*", 	NAME="video1394/%n", 	GROUP="video"

# raw devices
KERNEL=="raw[0-9]*", 	NAME="raw/%k", 		GROUP="disk"
KERNEL=="ram*", 	NAME="%k", 		GROUP="disk"

# memory devices
KERNEL=="random", 	NAME="%k", MODE="0666"
KERNEL=="urandom", 	NAME="%k", MODE="0444"
KERNEL=="mem", 		NAME="%k", MODE="0640"
KERNEL=="kmem", 	NAME="%k", MODE="0640"
KERNEL=="port", 	NAME="%k", MODE="0640"
KERNEL=="full", 	NAME="%k", MODE="0666"
KERNEL=="null", 	NAME="%k", MODE="0666"
KERNEL=="zero", 	NAME="%k", MODE="0666"

# usb devices
KERNEL=="hiddev*", 		NAME="usb/%k"
KERNEL=="auer*", 		NAME="usb/%k"
KERNEL=="legousbtower*", 	NAME="usb/%k"
KERNEL=="dabusb*", 		NAME="usb/%k"

# dvb devices
SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="video"

# Asterisk Zaptel devices
KERNEL=="zapctl", 	NAME="zap/ctl"
KERNEL=="zaptimer", 	NAME="zap/timer"
KERNEL=="zapchannel", 	NAME="zap/channel"
KERNEL=="zappseudo", 	NAME="zap/pseudo"
KERNEL=="zap[0-9]*", 	NAME="zap/%n"

# jaz devices
KERNEL=="jaz*", 	NAME="%k", GROUP="disk"

# zip devices
KERNEL=="pocketzip*", 	NAME="%k", GROUP="disk"
KERNEL=="zip*", 	NAME="%k", GROUP="disk"

# ls120 devices
KERNEL=="ls120", 	NAME="%k", GROUP="disk"

# printer (usb printer rule must be before the rest)
SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k", GROUP="lp", MODE="0660"
KERNEL=="lp*", 		NAME="%k", GROUP="lp", MODE="0660"
KERNEL=="irlpt", 	NAME="%k", GROUP="lp", MODE="0660"
KERNEL=="usblp", 	NAME="%k", GROUP="lp", MODE="0660"
KERNEL=="parport*", 	NAME="%k", GROUP="lp", MODE="0660"

# v4l devices
KERNEL=="video[0-9]*", 	NAME="v4l/video%n", SYMLINK="video%n", GROUP="video", MODE="0660"
KERNEL=="radio[0-9]*", 	NAME="v4l/radio%n", GROUP="video", MODE="0660"
KERNEL=="vbi[0-9]*", 	NAME="v4l/vbi%n", SYMLINK="vbi%n", GROUP="video", MODE="0660"
KERNEL=="vtx[0-9]*", 	NAME="v4l/vtx%n", GROUP="video", MODE="0660"

# video devices
KERNEL=="card*", 	NAME="dri/card%n", MODE="0660", GROUP="video"
KERNEL=="3dfx*", 	NAME="%k", MODE="0660", GROUP="video"
KERNEL=="nvidia*", 	NAME="%k", MODE="0660", GROUP="video"
KERNEL=="fb[0-9]", 	NAME="%k", MODE="0660", GROUP="video"
KERNEL=="svga[0-9]", 	NAME="%k", MODE="0660", GROUP="video"

# network devices
KERNEL=="tun", 		NAME="net/%k"
KERNEL=="ippp*", 	NAME="net/%k", SYMLINK="%k", MODE="0644"
KERNEL=="ipstate*", 	NAME="net/%k", SYMLINK="%k", MODE="0660"
KERNEL=="spx", 		NAME="net/%k", SYMLINK="%k", MODE="0644"

# diskonkey devices
KERNEL=="diskonkey*", 	NAME="%k", GROUP="disk"

# rem_ide devices
KERNEL=="microdrive*", 	NAME="%k", GROUP="disk"

# kbd devices
KERNEL=="kbd", 		NAME="%k", MODE="0664"

# Sony Vaio Jogdial sonypi device
KERNEL=="sonypi", 	NAME="%k", MODE="0666"

# packet devices
KERNEL=="pktcdvd", NAME="pktcdvd/control", GROUP="burning", MODE="0660"
KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/pktcdvd%n", GROUP="burning", MODE="0660"

# infiniband devices
KERNEL=="umad*", 	NAME="infiniband/%k"
KERNEL=="issm*", 	NAME="infiniband/%k"

# load firmware - rule generated by udev spell
SUBSYSTEM=="firmware", ACTION=="add", RUN+="/lib/udev/firmware_helper"
