From owner-freebsd-net@FreeBSD.ORG Tue Jul 31 16:23:25 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EDB41106566B; Tue, 31 Jul 2012 16:23:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id C0E788FC17; Tue, 31 Jul 2012 16:23:25 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 34FE8B918; Tue, 31 Jul 2012 12:23:25 -0400 (EDT) From: John Baldwin To: Adrian Chadd Date: Tue, 31 Jul 2012 12:22:55 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201207311222.55618.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 31 Jul 2012 12:23:25 -0400 (EDT) Cc: freebsd-net@freebsd.org, Venkat Duvvuru Subject: Re: PCI BAR mmap X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jul 2012 16:23:26 -0000 On Tuesday, July 31, 2012 12:14:41 pm Adrian Chadd wrote: > On 31 July 2012 08:22, Venkat Duvvuru wrote: > > Hi John, > > Thanks for your response. > > Is there an alternative to mmap the PCI BARs, I mean without implementing > > an mmap method in the driver, something like a pci subsystem mmap in Linux. > > Linux allows to mmap PCI BARs without any change in the device driver. > > I guess someone could implement a sysctl API to access PCI BAR > registers, rather than mapping /dev/pci or however pciconf -r works. > > That way you'd implement it once and all devices would have their BAR > registers show up in a userland-friendly way. Eh, no sysctl. /dev/pci uses ioctls. However, having a generic way to mmap BARs may be useful. -- John Baldwin