From owner-freebsd-current@FreeBSD.ORG Wed Jul 28 02:15:14 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 70C5216A51E; Wed, 28 Jul 2004 02:15:14 +0000 (GMT) Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FE9A43D54; Wed, 28 Jul 2004 02:15:14 +0000 (GMT) (envelope-from dwhite@gumbysoft.com) Received: by carver.gumbysoft.com (Postfix, from userid 1000) id 43FFA72DF2; Tue, 27 Jul 2004 19:15:14 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by carver.gumbysoft.com (Postfix) with ESMTP id 3EF8972DB5; Tue, 27 Jul 2004 19:15:14 -0700 (PDT) Date: Tue, 27 Jul 2004 19:15:14 -0700 (PDT) From: Doug White To: Alexander Motin In-Reply-To: Message-ID: <20040727190430.C45805@carver.gumbysoft.com> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-current@freebsd.org cc: freebsd-hardware@freebsd.org Subject: Re: USB mouse buttons X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2004 02:15:14 -0000 On Mon, 26 Jul 2004, Alexander Motin wrote: > I have Logitech MX510 mouse with 8 buttons. When I connect it to USB > port I take message: > Jul 26 18:07:58 orphanage kernel: ums0: Logitech USB-PS/2 Optical Mouse, > rev 2.00/21.00, addr 2, iclass 3/1 > Jul 26 18:07:58 orphanage kernel: ums0: 7 buttons and Z dir. > > As I understand ums driver do not support mouses with more then 7 > buttons because of: > #define MAX_BUTTONS 7 /* chosen because sc_buttons is u_char */ > > But sc_buttons is int as I can see inside /usr/src/sys/i386/isa/mse.c Thats the old Microsoft bus mouse driver, not the syscons mouse handling stuff. sc_buttons is probably a dated reference, or a reference to NetBSD (we share a lot of USB code with them). src/dev/syscons/sysmouse.c appears to only have enough room in the sysmouse protocol to support 10 buttons, which would imply that it can get sent more than 7 :-) Further investigation of the interface in sys/mouse.h finds a bitfield big enough for 28 buttons. You'll have to use the mapping feature to cram that down to the 10 you want, if you have a device with more than 10 buttons. Try upping that to 20-something and rebuilding things and see what you get. If you get a panic, something's still amiss. -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org