From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 16 23:20:35 2008 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 BC6C21065670 for ; Tue, 16 Dec 2008 23:20:35 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from thoth.sbs.de (thoth.sbs.de [192.35.17.2]) by mx1.freebsd.org (Postfix) with ESMTP id 3530D8FC08 for ; Tue, 16 Dec 2008 23:20:34 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id mBGN4V94006562 for ; Wed, 17 Dec 2008 00:04:31 +0100 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail1.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id mBGN4ViG032659 for ; Wed, 17 Dec 2008 00:04:31 +0100 Received: (from localhost) by curry.mchp.siemens.de (8.14.3/8.14.3) id mBGN4VdE030675; Date: Wed, 17 Dec 2008 00:04:30 +0100 From: Andre Albsmeier To: freebsd-hackers@freebsd.org Message-ID: <20081216230430.GA24352@curry.mchp.siemens.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Echelon: X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses! User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Andre.Albsmeier@siemens.com Subject: How to "detach" a foreign driver from a device so my driver can attach? 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: Tue, 16 Dec 2008 23:20:35 -0000 Hello all, I am writing a driver which attaches to the Host-PCI bridge. When compiled into the kernel or loaded by the loader everything works and the driver gets attached. This is due to the fact that I return BUS_PROBE_SPECIFIC in my probe routine which gains over the -10000 returned by pci_hostb_probe() in i386/pci/pci_bus.c. However, when I want to load my driver via kldload this fails since the hostb device has already been attached during kernel load (when my driver was not present): hostb0@pci0:0:0: class=0x060000 card=0x11d510cf chip=0x35808086 rev=0x02 hdr=0x00 What can I do to make my driver load via kldload? Is there a way to detach the hostb0 from the Host-PCI bridge? I have been digging around in the sources but didn't find something similar. In case of any hints, please CC me since I am currently travelling and can't easily read the lists at home... Thanks, -Andre