From owner-freebsd-embedded@FreeBSD.ORG Sat Dec 29 01:04:13 2007 Return-Path: Delivered-To: embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D64116A417 for ; Sat, 29 Dec 2007 01:04:13 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 045B513C4D5 for ; Sat, 29 Dec 2007 01:04:12 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id lBT0wAL9079350; Fri, 28 Dec 2007 17:58:10 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 28 Dec 2007 18:03:00 -0700 (MST) Message-Id: <20071228.180300.-432832706.imp@bsdimp.com> To: marcelm@juniper.net From: "M. Warner Losh" In-Reply-To: <20071228.163257.756911359.imp@bsdimp.com> References: <20071228.150443.-924279995.imp@bsdimp.com> <4FA37AAF-8113-44DE-8FF9-5BB203188912@juniper.net> <20071228.163257.756911359.imp@bsdimp.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: embedded@freebsd.org Subject: Re: ocpbus(4) X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2007 01:04:13 -0000 In message: <20071228.163257.756911359.imp@bsdimp.com> "M. Warner Losh" writes: : No, this is more or less the gist of it. The type and id : can be chosen in any way we like, including using the type : as the id. I just went out to shovel the drive way (a hazard of living in Colorado) and the above stuck in my head. One could also make the type/id a string and then the probe routines become something like: static int at91_ssc_probe(device_t dev) { if (strcmpy(device_get_name(dev), ocpbus_get_devname(dev)) != 0) return (ENXIO); device_set_descr(dev, "SSC"); return (0); /* or some other negative value */ } without the need to have the actual enumeration... This would be more complicated than setting the name when the child was added, but it would have the advantage of being overrideable if necessary. I'm just worried that the file defining an enum would soon become a big source of integration failures when code designed for these devices is integrated back into the tree. Maintaining big lists in the tree is something that newbus was designed to avoid. The artificial IDs seem to be reintroducing that, which is why I've had the negative reaction that I've had to it. Warner