From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 6 11:54:38 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3FFAC87 for ; Fri, 6 Feb 2015 11:54:37 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2BD73B7 for ; Fri, 6 Feb 2015 11:54:37 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C3E451FE023; Fri, 6 Feb 2015 12:54:33 +0100 (CET) Message-ID: <54D4ABA6.805@selasky.org> Date: Fri, 06 Feb 2015 12:55:18 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "O'Connor, Daniel" , FreeBSD Hackers Subject: Re: Two drivers sharing a single PCI device References: <643918BB-810C-4FB2-AE1A-C4CDA6C8A661@dons.net.au> In-Reply-To: <643918BB-810C-4FB2-AE1A-C4CDA6C8A661@dons.net.au> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 11:54:38 -0000 On 02/06/15 04:50, O'Connor, Daniel wrote: > Hi, > I am working on an EHCI debug driver and I have the basics working (attach, probe for a debug dongle and send data back and forth) - https://bitbucket.org/DJOConnor/dbgp > > However one problem remaining is that for it to work you have to detach the EHCI driver (obviously rather suboptimal :) so I am wondering what the best way would be to allow both ehci and dbgp to attach to the same PCI device. > > The dbgp driver doesn't touch the EHCI registers once it's running but it does have some code to start the EHCI controller and reset the port during attach. > > I can modify echi so it uses RF_SHAREABLE which should allow them to get newbus handles to the same area but the problem is that only one probe routine gets called. > > Any help appreciated, thanks. Hi, You possibly want "D_TRACKCLOSE" in d_flags in your cdevsw. What's the advantage of using the debug port over the regular EHCI USB interface? --HPS