From owner-cvs-all@FreeBSD.ORG Sat Dec 31 05:09:38 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6372716A41F; Sat, 31 Dec 2005 05:09:38 +0000 (GMT) (envelope-from mux@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1512A43D80; Sat, 31 Dec 2005 05:09:32 +0000 (GMT) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id 018E01A3C1E; Fri, 30 Dec 2005 21:09:32 -0800 (PST) Date: Sat, 31 Dec 2005 06:09:31 +0100 From: Maxime Henrion To: Alexander Leidinger Message-ID: <20051231050931.GH55746@elvis.mu.org> References: <20051229183552.205C316A432@hub.freebsd.org> <43B4385D.9030206@root.org> <20051229222645.05311b1f@Magellan.Leidinger.net> <43B4FDD5.1060000@root.org> <20051230115913.243e3e21@Magellan.Leidinger.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051230115913.243e3e21@Magellan.Leidinger.net> User-Agent: Mutt/1.4.2.1i Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org, Nate Lawson Subject: Re: cvs commit: src/sys/dev/usb ums.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2005 05:09:38 -0000 Alexander Leidinger wrote: > On Fri, 30 Dec 2005 01:28:53 -0800 > Nate Lawson wrote: > > > >>> #define UMS_BUT(i) ((i) < 3 ? (((i) + 2) % 3) : (i)) > > > I meant that this maps 0:2, 1:0, 2:1, 3:3, 4:4, ... Or in other words, > > it only operates on 2-bit values (0-3). I don't know if that's an issue > > or not, I just was wondering if that also needed to be expanded. > > NetBSD has: > #define UMS_BUT(i) ((i) == 1 || (i) == 2 ? 3 - (i) : i) > > So this maps 0:0, 1:2, 2:1, 3:3, 4:4, ... so it's completely different > below 3 and the same for the rest. So for the new buttons 8 to 31 it > doesn't make a difference. Since it also wasn't changed in the > MAX_BUTTONS commit, I didn't merged it. > > I think the change was introduced in the uhidev commit, but I didn't > checked this. Maxime (CCed) is working on merging the uhidev stuff, > maybe he knows for sure. Actually, NetBSD has had the UMS_BUT() macro this way since the beginning (revision 1.16), it wasn't changed by the uhidev commit. I have no idea what's the correct thing to do here, what's quite sure is that one of us has it wrong :-). You should send a mail to augustss@NetBSD.org since he changed the UMS_BUT() macro this way a long time ago when committing patches from Nick Hibma : revision 1.16 date: 1998/12/26 12:53:03; author: augustss; state: Exp; lines: +439-88 Merge changes to make the USB stack work with FreeBSD. The original diffs from Nick Hibma , but with substantial changes from me. XXX Not tested on FreeBSD yet. Cheers, Maxime