From owner-freebsd-stable@FreeBSD.ORG Thu Apr 7 12:08:17 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C023A16A4CE for ; Thu, 7 Apr 2005 12:08:17 +0000 (GMT) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id D537743D1F for ; Thu, 7 Apr 2005 12:08:16 +0000 (GMT) (envelope-from jilles@stack.nl) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mailhost.stack.nl (Postfix) with ESMTP id 6C5E51F17C; Thu, 7 Apr 2005 14:08:15 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 5A9A81DAC1; Thu, 7 Apr 2005 14:08:15 +0200 (CEST) Date: Thu, 7 Apr 2005 14:08:15 +0200 From: Jilles Tjoelker To: Michael Nottebrock Message-ID: <20050407120815.GA39638@stack.nl> References: <200504052117.58620.michaelnottebrock@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200504052117.58620.michaelnottebrock@gmx.net> X-Operating-System: FreeBSD 5.3-RELEASE-p5 i386 User-Agent: Mutt/1.5.6i cc: freebsd-stable@freebsd.org Subject: Re: USB mouse troubles X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2005 12:08:17 -0000 On Tue, Apr 05, 2005 at 09:17:55PM +0200, Michael Nottebrock wrote: > FreeBSD 5.x has had funky issues with usb mice for as long as I've > been using a usb mouse with it, but since it almost works ok with the > default configuration, I never got around to complain about it. ;-) AFAIK FreeBSD 4.x has the same issues and some more, e.g. systems with more than one USB bus require a manual MAKEDEV for hotplugging to work correctly (as only /dev/usb0 is created by default). > However: In various sitations and configurations, USB mice are not > picked up. I have not tested this at this point, but it agrees with my understanding of how the code works. > - With a GENERIC kernel and all of the usb support in the kernel, usb > mice are usually recognized on boot, but they will cease to work after > going single user and back to multiuser again. The /dev/ums0 device > doesn't even get removed, but the mouse is dead. Unplugging and > replugging usually gets it going again. On the first startup, usbd will get the initial events (the mouse being attached at boot time) and start moused. When going to single user, moused is killed. If usbd is started later, it will not get the initial events again (also the set of attached devices may have changed since boot), so will not start moused again. One fix could be to change usbd to throw away the initial events, instead doing as if attach events were received for all present USB devices. This would be nasty if usbd is restarted without a reboot/single user, which could be fixed by making the new behaviour optional. This is also nasty if usbd.conf contains an action for a device instead of starting a process, e.g. automatically copying files from a umass device. This might be fixed by distinguishing the two in usbd.conf. > - With all of usb compiled as modules and usbd enabled in rc.conf, ums > usually doesn't even get loaded, but usbdevs will show the mouse > plugged in. Even subsequent unplugging and replugging will not get ums > loaded. Manually loading ums doesn't get the mouse working either, an > unplug/replug is necessary first. usbd loads only the "usb" kld, that will bring in the drivers for the USB controllers, ugen and uhub and not much more. When the mouse is plugged in, ugen will grab it (there being nothing better) and will not release it, even when you subsequently load ums. This happens before usbd gets to know about the device. A somewhat crude workaround would be to load the drivers for the devices to be used before starting usbd. This would mean /boot/loader.conf, most likely. -- Jilles Tjoelker