From nobody@FreeBSD.org  Sat Nov 29 00:04:03 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8C7461065675
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 29 Nov 2008 00:04:03 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 6D2328FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 29 Nov 2008 00:04:03 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id mAT04275026302
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 29 Nov 2008 00:04:02 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id mAT042k1026301;
	Sat, 29 Nov 2008 00:04:02 GMT
	(envelope-from nobody)
Message-Id: <200811290004.mAT042k1026301@www.freebsd.org>
Date: Sat, 29 Nov 2008 00:04:02 GMT
From: Alex <freebsd.alex@spamfoodie.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: small patch to let moused detect usb2
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         129268
>Category:       bin
>Synopsis:       [patch] small patch to let moused(8) detect usb2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 29 00:10:00 UTC 2008
>Closed-Date:    Sun Jun 14 00:32:08 UTC 2009
>Last-Modified:  Sun Jun 14 00:32:08 UTC 2009
>Originator:     Alex
>Release:        8-CURRENT
>Organization:
>Environment:
FreeBSD moshnroll 8.0-CURRENT FreeBSD 8.0-CURRENT #8 r185353M: Thu Nov 27 01:48:42 CET 2008     root@moshnroll:/usr/obj/usr/src/sys/ARUNDEL  i386
>Description:
at the moment moused is unaware of the usb2 version of ums. if usb2 has been compiled into the kernel e.g. moused still loads the old ums kernel module. with this little patch it's able to detect if the usb2 version of ums is loaded or not. if it isn't it will load the old (usb1) ums kernel module.

cheers.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- usr.sbin/moused/moused.c	2008-11-27 01:28:44.000000000 +0100
+++ usr.sbin/moused/moused.c.new	2008-11-27 01:37:11.000000000 +0100
@@ -956,7 +956,7 @@
 static int
 usbmodule(void)
 {
-    return (kld_isloaded("uhub/ums") || kld_load("ums") != -1);
+    return (kld_isloaded("ushub/ums") || kld_isloaded("uhub/ums") || kld_load("ums") != -1);
 }
 
 /*


>Release-Note:
>Audit-Trail:

From: Xin LI <delphij@delphij.net>
To: Alex <freebsd.alex@spamfoodie.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/129268: small patch to let moused detect usb2
Date: Fri, 28 Nov 2008 18:04:40 -0800

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 Hi, Alex,
 
 I think that the problem is that we have two USB stacks while moused
 does not know that.  With this patch, it would just go ahead and load
 ums module if usb2_input_ms is not loaded, so I think we need more work
 for this.
 
 Cheers,
 - --
 Xin LI <delphij@delphij.net>	http://www.delphij.net/
 FreeBSD - The Power to Serve!
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.9 (FreeBSD)
 
 iEYEARECAAYFAkkwozgACgkQi+vbBBjt66CfZgCcCNsHm/JESn0aLG9FAcZIuF85
 gS0An1d0pUu6GyK33uwQsLE2QXhspzIv
 =PKQC
 -----END PGP SIGNATURE-----

From: Alex <freebsd.alex@spamfoodie.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/129268: [patch] small patch to let moused(8) detect usb2
Date: Sat, 29 Nov 2008 10:16:16 GMT

 you're right. all the apps that rely on a usb kernel module don't know that for each usb1 module there's a usb2 counterpart.
 
 if an app needs let's say ums there are 3 possible cases to take care of:
 
 1. the kernel was compiled with usb1 or the usb1 module was loaded
 2. the kernel was compiled with usb2 or the usb2 module was loaded
 3. the kernel was compiled without usb support and no usb module is loaded
 
 how about this:
 
 let's introduce a new sysctl variable. hw.usb2.enable e.g.
 
 in case 1 the variable will remain 0. in case 2 it will be set to 1. if the kernel was compiled without any usb support and no usb module got loaded it also remains 0. if the user however wishes to use usb2 even though he didn't add it to the kernel he can set hw.usb2.enable to 1 in order to tell moused e.g. to depend on usb2.
 
 if after a while the usb2 stack becomes the default stack the standard setting of hw.usb2.enable can be changed to 1. only if the user specifically adds usb1 to the kernel it will be set to 0.
 
 this would require only minor changes to moused and the other apps that load a usb module.
 
 cheers.
 

From: Bruce Cran <bruce@cran.org.uk>
To: bug-followup@FreeBSD.org, freebsd.alex@spamfoodie.com
Cc:  
Subject: Re: bin/129268: [patch] small patch to let moused(8) detect usb2
Date: Wed, 25 Mar 2009 20:19:46 +0000

 The old usb stack has now been moved to /sys/legacy and the usb2 stack
 has been renamed to fit in its place (e.g. usb2_input_ms is now ums).
 moused should be unaware that it's dealing with the new stack.
 
 -- 
 Bruce

From: Alexander Best <alexbestms@math.uni-muenster.de>
To: <bug-followup@FreeBSD.org>
Cc:  
Subject: Re: bin/129268: [patch] small patch to let moused(8) detect usb2
Date: Sat, 13 Jun 2009 19:24:24 +0200 (CEST)

 exactly. this PR is no longer relevant and thus can be closed.
 
 ps: i'm the one who submitted the PR.
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Sun Jun 14 00:31:56 UTC 2009 
State-Changed-Why:  
Submitter notes that this is OBE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=129268 
>Unformatted:
