Use busnum/devnum rather than vid/pid for hid2hci
PATCH 2/2 Use busnum/devnum rather than vid/pid for hid2hci
Hi:
This is the second patch following up to the thread titled "Explicitly disable BT radio using rfkill interface on suspend". It switches the hid2hci utility to using the USB bus and device numbers rather than vendor and product ID combinations.
Note that the S3 recovery rule unfortunately still does need to rely on an environment variable set by other rules because it is using the parent's device number.
Regards
Signature · 3 lines
Mario Limonciello *Dell | Linux Engineering* [email protected]
=== modified file 'extras/hid2hci/70-hid2hci.rules'
hid2hci/70-hid2hci.rules +7 -7
@@ -9,22 +9,22 @@ # # Known supported devices: 413c:8154, 413c:8158, 413c:8162 ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProtocol}=="02", ATTRS{bDeviceClass}=="00", ATTRS{idVendor}=="413c", ATTRS{bmAttributes}=="e0", \ - RUN+="hid2hci --method dell -v $attr{idVendor} -p $attr{idProduct} --mode hci" + RUN+="hid2hci --method dell -b $attr{busnum} -d $attr{devnum} --mode hci" # When a Dell device recovers from S3, the mouse child needs to be repoked # Unfortunately the only event seen is the BT device disappearing, so the mouse # device needs to be chased down on the USB bus. -ATTR{bDeviceClass}=="e0", ATTR{bDeviceSubClass}=="01", ATTR{bDeviceProtocol}=="01", ATTR{idVendor}=="413c", ATTR{bmAttributes}=="e0", IMPORT{parent}="ID_*", ENV{REMOVE_CMD}="hid2hci --method dell -v $env{ID_VENDOR_ID} -p $env{ID_MODEL_ID} --mode hci -s 02" +ATTR{bDeviceClass}=="e0", ATTR{bDeviceSubClass}=="01", ATTR{bDeviceProtocol}=="01", ATTR{idVendor}=="413c", ATTR{bmAttributes}=="e0", IMPORT{parent}="DEVNUM", ENV{REMOVE_CMD}="hid2hci --method dell -b $attr{busnum} -d $env{DEVNUM} --mode hci -s 02" ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end" # Logitech devices -ATTR{idVendor}=="046d", ATTR{idProduct}=="c70[345abce]", RUN+="hid2hci --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci" -ATTR{idVendor}=="046d", ATTR{idProduct}=="c71[34bc]", RUN+="hid2hci --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci" +ATTR{idVendor}=="046d", ATTR{idProduct}=="c70[345abce]", RUN+="hid2hci --method logitech -b $attr{busnum} -d $attr{devnum} --mode hci" +ATTR{idVendor}=="046d", ATTR{idProduct}=="c71[34bc]", RUN+="hid2hci --method logitech -b $attr{busnum} -d $attr{devnum} --mode hci" # CSR devices (in HID mode) -ATTR{idVendor}=="0a12", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci" -ATTR{idVendor}=="0458", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci" -ATTR{idVendor}=="05ac", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci" +ATTR{idVendor}=="0a12", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -b $attr{busnum} -d $attr{devnum} --mode hci" +ATTR{idVendor}=="0458", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -b $attr{busnum} -d $attr{devnum} --mode hci" +ATTR{idVendor}=="05ac", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -b $attr{busnum} -d $attr{devnum} --mode hci" LABEL="hid2hci_end"
=== modified file 'extras/hid2hci/hid2hci.c'
hid2hci/hid2hci.c +25 -26
109 lines not on this page · raw message