Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 01 Feb 2014 16:48:14 +1300 (NZDT)
From:      Andrew Childs <lorne@cons.org.nz>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   usb/186317: ums module not loaded by devd for Razer Lachesis mouse
Message-ID:  <20140201034814.6471F8B9BBB@xenon.cons.org.nz>
Resent-Message-ID: <201402010410.s114A2pl000572@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         186317
>Category:       usb
>Synopsis:       ums module not loaded by devd for Razer Lachesis mouse
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-usb
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 01 04:10:01 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Childs
>Release:        FreeBSD 10.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD xenon 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64


	
>Description:

My mouse doesn't work by default in FreeBSD 10.0-RELEASE, but works
fine after manually loading the ums module. This was not a problem
with FreeBSD 9.1-RELEASE where the ums driver was compiled in.

The Razer Lachesis exposes two interfaces:

 interface 0: class=3 (HID), subclass=0 (non-boot), protocol=2 (mouse)
 interface 1: class=3 (HID), subclass=1 (boot)    , protocol=1 (keyboard)

The intended logic of loading the ums driver is to fail at matching
entirely, and fall through to devd's nomatch blocks, which will then
load the ums module.

There are two problems with this approach:

  1. uhid will return a low priority match for all non boot protocol
     devices (3/0/*), (precisely: it explicitly ignores 3/1/1, 3/1/2,
     and quirks). We can see this behaviour in the probing of the
     Razer Lachesis mouse interface with dtrace:


     CPU     ID                    FUNCTION:NAME
       0  27731         device_probe_child:entry dev=fffff80030b73500, child=fffff80029148a00
       0  11436                 ukbd_probe:entry dev=fffff80029148a00
       0  11437                ukbd_probe:return 6
       0  48559                 uhid_probe:entry dev=fffff80029148a00
       0  48560                uhid_probe:return -100

     (here the uhid driver is selected as best match and attached)

       0  48559                 uhid_probe:entry dev=fffff80029148a00
       0  48560                uhid_probe:return -100
       0  27732        device_probe_child:return 

  2. The ums driver's contribution to etc/devd/usb.conf (via ums_devs)
     will only match boot protocol mice (3/1/2)

     nomatch 32 {
         match "bus" "uhub[0-9]+";
         match "mode" "host";
         match "intclass" "0x03";
         match "intsubclass" "0x01";
         match "intprotocol" "0x02";
         action "kldload -n ums";
     };

>How-To-Repeat:
	

>Fix:

I think the easiest solution is to compile in ums. A more correct
solution to allow ums to be a module would be to modify uhid_probe to
better reflect the result of ums_probe and ukbd_probe (check
hid_is_mouse and hid_is_keyboard), and relax the the ums module's
matching to only check interface class.

As I workaround, I added ums_load="YES" to /boot/loader.conf.
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140201034814.6471F8B9BBB>