From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 19:43:56 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7C94916A4E1 for ; Mon, 7 Aug 2006 19:43:56 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1721343D82 for ; Mon, 7 Aug 2006 19:43:40 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (3pwhbw2zomvd7gmb@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id k77JhcWe042082; Mon, 7 Aug 2006 12:43:38 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id k77Jhc9m042081; Mon, 7 Aug 2006 12:43:38 -0700 (PDT) (envelope-from jmg) Date: Mon, 7 Aug 2006 12:43:38 -0700 From: John-Mark Gurney To: Niki Denev Message-ID: <20060807194337.GD99774@funkthat.com> Mail-Followup-To: Niki Denev , freebsd-hackers@freebsd.org References: <44D3C333.3030702@cytexbg.com> <200608071628.15316.nike_d@cytexbg.com> <20060807183406.GB99774@funkthat.com> <200608072203.56320.nike_d@cytexbg.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200608072203.56320.nike_d@cytexbg.com> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: freebsd-hackers@freebsd.org Subject: Re: linux ioremap equivalent on freebsd X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2006 19:43:56 -0000 Niki Denev wrote this message on Mon, Aug 07, 2006 at 22:03 +0300: > On Monday 07 August 2006 21:34, John-Mark Gurney wrote: > > Because for the most part it is only suppose to be used by MD code... > > > > The correct way to get device's memory is to use bus_alloc_resource_any... > > Make sure you review the handbook on device driver writing: > > http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/devicedriver > >s.html > > > > I did a presentation at BSDcan on writing devices drivers: > > http://people.freebsd.org/~jmg/drivers/ > > > > The handout is a cheat sheet of useful functions for writing a device > > driver... > > I'm looking at this right now :) Looks very useful, thanks! > > Just one more question to clear a little confusion on my side, > the device that i'm trying to write/port driver for is a cardbus device. > Do i have to do something specific about this, or can i get away with > accessing/using it as a plain PCI device? (yes, it appears as pci device to > the system, and is shown in pciconf) The only thing special that I believe you have to do is provide an additional DRIVER_MODULE line to attach to cardbus in addition to (or instead of) pci... For example: DRIVER_MODULE(re, pci, re_driver, re_devclass, 0, 0); DRIVER_MODULE(re, cardbus, re_driver, re_devclass, 0, 0); Warner is the expert on cardbus, so, if you have any questions, you could drop him an email.... Good luck! -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."