From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 25 14:44:39 2010 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E89C8106567A; Wed, 25 Aug 2010 14:44:39 +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 8C99A8FC1D; Wed, 25 Aug 2010 14:44:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7PEZFLA010345; Wed, 25 Aug 2010 08:35:16 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 25 Aug 2010 08:35:27 -0600 (MDT) Message-Id: <20100825.083527.578650865239426955.imp@bsdimp.com> To: ray@dlink.ua From: "M. Warner Losh" In-Reply-To: <20100825105908.c8b626fd.ray@dlink.ua> References: <20100819170643.38362078.ray@dlink.ua> <20100823.221259.904309299051719466.imp@bsdimp.com> <20100825105908.c8b626fd.ray@dlink.ua> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org, jhb@FreeBSD.org Subject: Re: Modules and Buses X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2010 14:44:40 -0000 In message: <20100825105908.c8b626fd.ray@dlink.ua> Alexandr Rybalko writes: : On Mon, 23 Aug 2010 22:12:59 -0600 (MDT) : "M. Warner Losh" wrote: : : >> In message: <20100819170643.38362078.ray@dlink.ua> : >> Alexandr Rybalko writes: : >> : On Thu, 19 Aug 2010 09:18:46 -0400 : >> : John Baldwin wrote: : >> : : >> : >> On Thursday, August 19, 2010 8:38:05 am Alexandr Rybalko wrote: : >> : >> > Hi all, : >> : >> > : >> : >> > Can someone say, how `make` in sys/modules dir can obtain available buses. : >> : >> > I try to make clean version of bfe, that can be for PCI bus or can be part : >> : >> of SoC (like BCM5354) on SSB bus. : >> : >> > So for proper module building I need to know what bus interface I must build : >> : >> if_bfe_pci.c, or if_bfe_siba.c, or both? : >> : >> : >> : >> You can always include both buses. If a bus driver isn't present in the : >> : >> kernel the attachment will just never be invoked. : >> : : >> : I was afraid of such response. Now I have to rewrite siba implementation to newbus :) : >> : Thanks you for answer! : >> : >> In the module building system (modules built with sys/modules : >> Makefiles), we generally include all relevant busses. So, for i386 we : >> include EISA front ends for some devices, but omit that on amd64. For : >> siba, you'd only include it on mips, since that's the only platform : >> where this would be relevant (I know broadcom wireless drivers are : >> implemented via a pci <-> siba bridge, but that's a really special : >> case). : >> : >> Check out sys/modules/ep for an example from the mists of history.. : >> : >> Warner : : Thanks you Warner, : : I believe Broadcom wifi cards not last instance of Broadcom devices with PCI-to-SSB bridge. : Since this is modular platform that can join multiple already existence chips onto biggest chip. : And SSB is spacial case of OCP bus, who can be used not only for MIPS periphery, but ARM too. : : So I think I should implement the SSB as a full functional bus. I agree we should implement it as a full functional bus. It would save a little code to only compile on mips. There's no arm ssb implementation in the tree, and the use case on non-mips is still theoretical. On the other hand, the bus attach code is small, and so would have little impact being always in the module. So I could go either way with this, due to the limitations in our module system. Warner