From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 15 17:17:38 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67F16387 for ; Sat, 15 Nov 2014 17:17:38 +0000 (UTC) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21121EE0 for ; Sat, 15 Nov 2014 17:17:38 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id c9so3640124qcz.19 for ; Sat, 15 Nov 2014 09:17:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=MuxI9TUPDkl9wPCjZJ9GcVh/K4ZE7VCwb3YUQ9XcIXg=; b=ld7G2QbtqT+Y4xUcFYKgR5Y6pzKVsROuchMWSTSCcb/S9PktQeUR300GANUGpzArvm obHINeVKlH7ys0+7DWL8XMF1OfTkdqMo3DnV7SQniQGDr3exfGRLI6UPWFbt5qu1quwF eE9s6wlx1RMeBKW3mjZ3r4mqG/adMNxEvbJHtc7CqT1SQ6f7RWygNs3DM3rHnXbCx3O1 68Kj3/BmJbwci+XI+1OJnF+jiJREnnj9QazXS8C53J9dVTQplYkxIP7lA13oTn5dpsXe oGLu+WF5IUnRP3lZixz/ihaMFsVm8OT3tL2p0aAFF3UNLRv+xhVG1G8V40GWbKoXzYm1 6IGA== X-Received: by 10.224.10.195 with SMTP id q3mr21080964qaq.8.1416071856406; Sat, 15 Nov 2014 09:17:36 -0800 (PST) Received: from kan ([2601:6:6780:7e0:226:18ff:fe00:232e]) by mx.google.com with ESMTPSA id m8sm30083544qag.25.2014.11.15.09.17.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Nov 2014 09:17:35 -0800 (PST) Date: Sat, 15 Nov 2014 12:17:30 -0500 From: Alexander Kabaev To: "O'Connor, Daniel" Subject: Re: Newbus question Message-ID: <20141115121730.3a5bac94@kan> In-Reply-To: References: X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.22; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/oyipExaqpN.rvU7xy3OZF8P"; protocol="application/pgp-signature" Cc: FreeBSD Hackers 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: Sat, 15 Nov 2014 17:17:38 -0000 --Sig_/oyipExaqpN.rvU7xy3OZF8P Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Sat, 15 Nov 2014 17:32:39 +1030 "O'Connor, Daniel" wrote: > Hi, > I am trying to write a driver for the EHCI debug port [1]. I found > some userland code which I got working (written by the person who did > the Linux version) and now I am trying to get it running in the > kernel. One problem I have is that it needs to run in parallel with > the normal EHCI controller. It uses the same BAR as the EHCI > controller but offset (the offset is found in a PCI capability). I > think I can bus_alloc_resource() if I change EHCI to allocate with > RF_SHAREABLE but my first problem is to add another device so my > driver doesn't contest with the EHCI driver. >=20 > Currently I have a module which loops over bus/slot/func using > find_bsf (is there a way to enumerate all connected PCI devices?) and > then check each for the debug capability (I plan on being a bit > pickier later but it works so far) then creating a child device. The > problem is that the probe routine >=20 Hi, I do not think this can be done without cooperation of the ECHI device. You'd have to go the way of the full parent/child relationship between ehci parent and debug port child devices. Fortunately, this is not that hard to do and you can even define your own devmethod interfaces to make communication between debug port decoupled, so that debug port can be loaded and unloaded independently. The echi device already manages one child usbus device, adding another should not be too hard. --=20 Alexander Kabaev --Sig_/oyipExaqpN.rvU7xy3OZF8P Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iD8DBQFUZ4quQ6z1jMm+XZYRAmnGAKCW1kPEjSclBHUkYWUZjvL2nydMIwCfZ+4n 4JJgm/FglzZfIu3lr973uk8= =tGtX -----END PGP SIGNATURE----- --Sig_/oyipExaqpN.rvU7xy3OZF8P--