1
0
mirror of https://github.com/systemd/systemd synced 2026-03-26 16:54:53 +01:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Bastien Nocera
6a3e4e43be hwdb: Allow end-users root-less access to USB analyzers
Procotol analyzers are external devices used to capture traffic over a
wire so that it could be analysed. End-users at the console should be
able to access those devices without requiring root access.

This change obsoletes the need to install Total Phase's "Linux drivers",
which are really just udev rules and hotplug usermap files to do that:
https://www.totalphase.com/products/usb-drivers-linux/
2021-09-01 15:50:19 +02:00
Bastien Nocera
94cb45d57f udev: Import hwdb matches for USB devices
Import hwdb matches for USB devices (not interfaces) which don't usually
have a modalias so that it's possible to, for example, make them
available for unprivileged users.
2021-09-01 15:49:34 +02:00
4 changed files with 22 additions and 22 deletions

View File

@ -1,31 +1,33 @@
# This file is part of systemd.
#
# Database for protocol analyzers that should be accessible to the seat owner
# Database for signal analyzers (protocol analyzers, logic analyzers,
# oscilloscopes, multimeters, bench power supplies, etc.) that should
# be accessible to the seat owner.
#
# Permitted keys:
# Specify if a device is a protocol analyzer
# ID_PROTOCOL_ANALYZER=1|0
# Specify if a device is a signal analyzer
# ID_SIGNAL_ANALYZER=1|0
###########################################################
# Total Phase
###########################################################
# Aarvark I2C/SPI Host Adapter
usb_device:v0403pe0d0*
ID_PROTOCOL_ANALYZER=1
usb:v0403pe0d0*
ID_SIGNAL_ANALYZER=1
# Beagle Protocol Analyzers
usb_device:v1679p2001*
ID_PROTOCOL_ANALYZER=1
usb:v1679p2001*
ID_SIGNAL_ANALYZER=1
# Cheetah SPI Host Adapter
usb_device:v1679p2002*
ID_PROTOCOL_ANALYZER=1
usb:v1679p2002*
ID_SIGNAL_ANALYZER=1
# Komodo CAN Duo Interface
usb_device:v1679p3001*
ID_PROTOCOL_ANALYZER=1
usb:v1679p3001*
ID_SIGNAL_ANALYZER=1
# Power Delivery Analyzers
usb_device:v1679p6003*
usb_device:v0483pdf11*
ID_PROTOCOL_ANALYZER=1
usb:v1679p6003*
usb:v0483pdf11*
ID_SIGNAL_ANALYZER=1

View File

@ -80,7 +80,6 @@ TYPES = {'mouse': ('usb', 'bluetooth', 'ps2', '*'),
GENERAL_MATCHES = {'acpi',
'bluetooth',
'usb',
'usb_device',
'pci',
'sdio',
'vmbus',
@ -148,7 +147,7 @@ def property_grammar():
('ID_INPUT_TOUCHPAD', Or((Literal('0'), Literal('1')))),
('ID_INPUT_TOUCHSCREEN', Or((Literal('0'), Literal('1')))),
('ID_INPUT_TRACKBALL', Or((Literal('0'), Literal('1')))),
('ID_PROTOCOL_ANALYZER', Or((Literal('0'), Literal('1')))),
('ID_SIGNAL_ANALYZER', Or((Literal('0'), Literal('1')))),
('POINTINGSTICK_SENSITIVITY', INTEGER),
('POINTINGSTICK_CONST_ACCEL', REAL),
('ID_INPUT_JOYSTICK_INTEGRATION', Or(('internal', 'external'))),
@ -208,9 +207,8 @@ def check_matches(groups):
matches = sum((group[0] for group in groups), [])
# This is a partial check. The other cases could be also done, but those
# three are most commonly wrong.
# two are most commonly wrong.
grammars = { 'usb' : 'v' + upperhex_word(4) + Optional('p' + upperhex_word(4)),
'usb_device' : 'v' + upperhex_word(4) + Optional('p' + upperhex_word(4)),
'pci' : 'v' + upperhex_word(8) + Optional('d' + upperhex_word(8)),
}

View File

@ -12,7 +12,7 @@ SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="hwdb 'usb_device:v$attr{idVendor}p$attr{idProduct}:name:$attr{product}:'"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="hwdb 'usb:v$attr{idVendor}p$attr{idProduct}'"
ACTION!="add", GOTO="default_end"

View File

@ -81,6 +81,6 @@ ENV{ID_SOFTWARE_RADIO}=="?*", TAG+="uaccess"
ENV{ID_MAKER_TOOL}=="?*", TAG+="uaccess"
# Protocol analyzers
ENV{ID_PROTOCOL_ANALYZER}=="?*", TAG+="uaccess"
ENV{ID_SIGNAL_ANALYZER}=="?*", TAG+="uaccess"
LABEL="uaccess_end"