From owner-freebsd-arch@FreeBSD.ORG Thu Jun 3 14:21:02 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 100C816A4CE for ; Thu, 3 Jun 2004 14:21:02 -0700 (PDT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E88543D3F for ; Thu, 3 Jun 2004 14:21:01 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.11/8.12.11) with ESMTP id i53LHQ3Z050083; Thu, 3 Jun 2004 15:17:27 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 03 Jun 2004 15:17:31 -0600 (MDT) Message-Id: <20040603.151731.118628002.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: References: <20040603.092954.114645644.imp@bsdimp.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable cc: arch@freebsd.org Subject: Re: cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2004 21:21:02 -0000 In message: des@des.no (Dag-Erling Sm=F8rgrav) writes: : "M. Warner Losh" writes: : > des@des.no (Dag-Erling Sm=F8rgrav) writes: : > : "M. Warner Losh" writes: : > : > How about an API? How does the driver deal with the global/ins= tance : > : > variable split? If I set dev.fxp.gerbil to 1 and dev.fxp.1.ger= bil to : > : > 23? Is that order dependent? : > : that's up to the driver author to decide. : > That's why I want to know the API the driver will use so that it ca= n : > be judged as sufficient or not. I also think we should have some k= ind : > of default design pattern. : = : The API will be {devclass,device}_get_sysctl_{ctx,tree}(). The drive= r : then adds children to these nodes using sysctl_add_*(). We're going to wind up with the same code in a bunch of drivers for the global sysctls then. It will look like if (!devclass_get_sysctl("foo")) add_global_sysctl("foo"); add_local_sysctl(device_get_sysctl(), "foo"); This is going to lead to some drivers not having global settings for some systclts. The question that I was trying to ask is 'is this desirable?' Does it make sense to break symmetry like this? Maybe it does, but I guess I need to see what you do and play with it a little with cbb to see how well it works in practice... Warner