From owner-freebsd-net@FreeBSD.ORG Tue Jul 31 15:22:26 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 0C6C6106566C; Tue, 31 Jul 2012 15:22:26 +0000 (UTC) (envelope-from venkatduvvuru.ml@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id B82488FC14; Tue, 31 Jul 2012 15:22:25 +0000 (UTC) Received: by obbun3 with SMTP id un3so13859390obb.13 for ; Tue, 31 Jul 2012 08:22:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xJEgnStkKMJ4SxdKJJqvErXHUYrkqDaTagXUQjG+tPM=; b=yXuw2rkBB2ExIqQsa4qEyXfiV291BR7fSghAVb/EVmns7stOUApZigd1bp9TjAB8CB l7fe88K0YgRb87WoZEOoLUOq15hdi+ir+rLjCi/Hy9Ctf81CA54HtmhIf4bv7W6oMWDt MP3SzgMXhjDn3+Hy1AYdsaZokKpsKtH1dLd3YIXobYv3QQjTvg04zMKo8wdecl+mtliQ qrs22V2/p9FD2pAVnFjB4ATFRmMABRXZ8/YAN7Ji5YOn2dQxvPgGbbdCr8glXlHv4plr sadPpBy3wJM8r5lyfUtOsQDWORzgWz/DX7Y2lz+vn1yHeb9dwqHl7m26LQ93T2pFkLys ApgA== MIME-Version: 1.0 Received: by 10.182.111.39 with SMTP id if7mr24019292obb.56.1343748145317; Tue, 31 Jul 2012 08:22:25 -0700 (PDT) Received: by 10.76.8.99 with HTTP; Tue, 31 Jul 2012 08:22:25 -0700 (PDT) In-Reply-To: <201207310951.12251.jhb@freebsd.org> References: <201207310951.12251.jhb@freebsd.org> Date: Tue, 31 Jul 2012 20:52:25 +0530 Message-ID: From: Venkat Duvvuru To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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 15:22:26 -0000 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. /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 >