From owner-freebsd-net@FreeBSD.ORG Tue Jul 31 16:13:57 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 94FAD1065677 for ; Tue, 31 Jul 2012 16:13:57 +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 6AC3A8FC1B for ; Tue, 31 Jul 2012 16:13:57 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D31ABB984; Tue, 31 Jul 2012 12:13:56 -0400 (EDT) From: John Baldwin To: Venkat Duvvuru Date: Tue, 31 Jul 2012 12:08:21 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201207310951.12251.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201207311208.21178.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:13:56 -0400 (EDT) Cc: freebsd-net@freebsd.org 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:13:57 -0000 On Tuesday, July 31, 2012 11:22:25 am 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. No, we do not currently have a generic way to mmap PCI BARs. > /Venkat > > On Tue, Jul 31, 2012 at 7:21 PM, John Baldwin wrote: > > > On Tuesday, July 31, 2012 8:48:00 am Venkat Duvvuru wrote: > > > Hi, > > > How to mmap PCI BARs from userland in freebsd? > > > In Linux the PCI BAR appears as a file in the sysfs file system. How can > > I > > > access PCI BAR as a file in freebsd to mmap it? > > > > You can export a BAR via a d_mmap() method from a cdevsw device you create > > in > > your driver. > > > > -- > > John Baldwin > > > -- John Baldwin