[Bug 183478] x11-servers/xorg-server: DEVD backend is broken, here's a fix

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Sep 14 21:40:58 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=183478

--- Comment #5 from Henry Hu <henry.hu.sh at gmail.com> ---
I've tried this patch and it gives me better results than the current hal/devd
backend. It does not have the problem in bug 175731. After unplugging one
keyboard, other keyboards are still usable.

There is a small problem though: vendor/product information is missing. From
xorg log:
// unplug
[ 16484.088] (II) config/devd: received: -ums0
[ 16484.089] (II) config/devd: removing device ums0
[ 16484.089] (II) UnloadModule: "mouse"
[ 16484.104] (II) config/devd: received: -uhid0
// plug
[ 16486.469] (II) config/devd: received: +ums0 driver=mouse flags=pointer
usb_id=:      
[ 16486.469] (II) config/devd: ums0: driver=<mouse>
[ 16486.469] (II) config/devd: ums0: flags=<pointer>
[ 16486.469] (II) config/devd: ums0: usb_id=<:>
[ 16486.469] (II) config/devd: adding device ums0
[ 16486.469] (II) Using input driver 'mouse' for 'ums0'
[ 16486.469] (**) ums0: always reports core events
[ 16486.469] (**) Option "Device" "/dev/ums0"
[ 16486.470] (==) ums0: Protocol: "Auto"
[ 16486.470] (**) ums0: always reports core events
[ 16486.470] (==) ums0: Emulate3Buttons, Emulate3Timeout: 50
[ 16486.470] (**) ums0: ZAxisMapping: buttons 4 and 5
[ 16486.470] (**) ums0: Buttons: 5
[ 16486.470] (**) Option "config_info" "devd:ums0"
[ 16486.470] (II) XINPUT: Adding extended input device "ums0" (type: MOUSE, id
8)
[ 16486.470] (**) ums0: (accel) keeping acceleration scheme 1
[ 16486.470] (**) ums0: (accel) acceleration profile 0
[ 16486.470] (**) ums0: (accel) acceleration factor: 2.000
[ 16486.470] (**) ums0: (accel) acceleration threshold: 4
[ 16486.470] (II) ums0: SetupAuto: hw.iftype is 5, hw.model is 0
[ 16486.470] (II) ums0: SetupAuto: protocol is SysMouse
[ 16486.471] (WW) fcntl(28, F_SETOWN): Inappropriate ioctl for device
[ 16486.495] (II) config/devd: received: +uhid0 usb_id=:      
[ 16486.495] (II) config/devd: uhid0: usb_id=<:>
[ 16486.495] (II) config/devd: adding device uhid0
[ 16486.496] (II) No input driver specified, ignoring this device.
[ 16486.496] (II) This device may have been added with another device file.

The reason is that, in xhotplug.conf, it says
    action "/usr/local/etc/rc.d/xhotplug add/usb $device-name $port.$devaddr";
and in xhotplug usbconfig is called with '-d $1' where $1 is $port.$devaddr.
However, usbconfig expects $bus.$devaddr, not $port.$devaddr.
For example, in this case ums0 is at ugen0.3, but xhotplug is called with 2.3,
but if you change it into $bus it still does not work. From debug devd log:

Processing event '+ums0 at bus=0 hubaddr=2 port=2 devaddr=3 interface=1
vendor=0x046d product=0xc52b devclass=0x00 devsubclass=0x00 sernum=""
release=0x1201 mode=host intclass=0x03 intsubcla
ss=0x01 intprotocol=0x02  on uhub3'
Pushing table
setting device-name=ums0
setting bus=0
setting hubaddr=2
setting port=2
setting devaddr=3
setting interface=1
setting vendor=0x046d
setting product=0xc52b
setting devclass=0x00
setting devsubclass=0x00
setting sernum=
setting release=0x1201
setting mode=host
setting intclass=0x03
setting intsubclass=0x01
setting intprotocol=0x02
setting bus=uhub3
Processing attach event
Testing device-name=ums0 against ^(joy|psm)[0-9]+$, invert=0
Testing device-name=ums0 against ^(atp|uep|uhid)[0-9]+$, invert=0
Testing device-name=ums0 against ^ums[0-9]+$, invert=0
Executing '/etc/rc.d/moused quietstart ums0'
Executing '/usr/local/etc/rc.d/xhotplug add/usb ums0 2.3'
Popping table

The correct value (bus=0) is silently overridden by bus=uhub3, so it's hard to
obtain the usb bus value. It's possible to obtain this value by looking into
dmesg but that's too ugly.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-x11 mailing list