如何解释/编写 USB HDMI 规则

如何解释/编写 USB  HDMI 规则

我想让 USB <> HDMI 设备工作,但我需要一些帮助来转换 DisplayLink 规则以与通用供应商(相同芯片组)一起使用。

Displaylink 规则如下所示:

# Copyright (c) 2016 - 2020 DisplayLink (UK) Ltd.
# File autogenerated by udev-installer.sh script
ACTION=="add", 
SUBSYSTEM=="usb", 
DRIVERS=="usb", 
ATTR{idVendor}=="17e9", 
IMPORT{builtin}="usb_id", 
ENV{DISPLAYLINK_DEVNAME}="$env{DEVNAME}", 
ENV{DISPLAYLINK_DEVICE_ID}="$env{ID_BUS}-$env{BUSNUM}-$env{DEVNUM}-$env{ID_SERIAL}", 
ENV{REMOVE_CMD}="/opt/displaylink/udev.sh $root $env{DISPLAYLINK_DEVICE_ID} $env{DISPLAYLINK_DEVNAME}"

ACTION=="add", 
SUBSYSTEM=="usb", 
DRIVERS=="usb", 
ATTRS{idVendor}=="17e9", 
ATTR{bInterfaceClass}=="ff", 
ATTR{bInterfaceProtocol}=="03", 
IMPORT{parent}="DISPLAYLINK*", 
RUN+="/opt/displaylink/udev.sh $root $env{DISPLAYLINK_DEVICE_ID} $env{DISPLAYLINK_DEVNAME}"

ACTION=="remove", 
ENV{PRODUCT}=="17e9/*", 
RUN+="/opt/displaylink/udev.sh $root $env{DEVNAME}"````

--------------------------------
When I run dmesg I get this:

[ 2141.202752] usb 1-2: new high-speed USB device number 8 using xhci_hcd
[ 2141.354003] usb 1-2: New USB device found, idVendor=534d, idProduct=6021, bcdDevice= 1.00
[ 2141.354008] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2141.354011] usb 1-2: Product: usb extscreen
[ 2141.354014] usb 1-2: Manufacturer: MACROSILICON
[ 2141.354016] usb 1-2: SerialNumber: 2018BA7160A0
[ 2141.357332] hid-generic 0003:534D:6021.0006: hiddev0,hidraw1: USB HID v1.10 Device [MACROSILICON usb extscreen] on usb-0000:00:14.0-2/input0
--------------------------------

and lsusb gives

Bus 001 Device 008: ID 534d:6021 MACROSILICON usb extscreen

------------------------------------
OK so I need to rewrite the DisplayLink rule to work with this vendor. 
--------------------------------------------

Q1: I am assuming that the $root is just ./ 
-----------------------------------------------

Q2: I know I have to change the vendor ID but where do the following vars come from 

ENV{DISPLAYLINK_DEVNAME}="$env{DEVNAME}" 

ENV{DISPLAYLINK_DEVICE_ID}="$env{ID_BUS}-$env{BUSNUM}-$env{DEVNUM}-$env{ID_SERIAL}"

-------------------------------------------------------------------

Q3: can I hard code the vars from Q2 into the rules file and if so what are they:

based on dmesg and lsusb above i am guessing:

DEVNAME = "usb extscreen"

ID_BUS = "1"
BUSNUM = "2"
ID_SERIAL = 2018BA7160A0
DEVNUM = changes each time ???

Any assistance would be appreciated ....

thanks 

相关内容