From owner-freebsd-hackers Tue Jul 20 13:39:57 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from uni4nn.gn.iaf.nl (osmium.gn.iaf.nl [193.67.144.12]) by hub.freebsd.org (Postfix) with ESMTP id 9B77B15074 for ; Tue, 20 Jul 1999 13:39:44 -0700 (PDT) (envelope-from wilko@yedi.iaf.nl) Received: from yedi.iaf.nl (uucp@localhost) by uni4nn.gn.iaf.nl (8.9.2/8.9.2) with UUCP id WAA09146; Tue, 20 Jul 1999 22:37:51 +0200 (MET DST) Received: (from wilko@localhost) by yedi.iaf.nl (8.9.3/8.9.3) id WAA00801; Tue, 20 Jul 1999 22:37:47 +0200 (CEST) (envelope-from wilko) From: Wilko Bulte Message-Id: <199907202037.WAA00801@yedi.iaf.nl> Subject: Re: any docs on how to use bus_dma_tag_create e.a. ? In-Reply-To: <199907201958.NAA07710@narnia.plutotech.com> from "Justin T. Gibbs" at "Jul 20, 1999 1:58:54 pm" To: gibbs@narnia.plutotech.com (Justin T. Gibbs) Date: Tue, 20 Jul 1999 22:37:47 +0200 (CEST) Cc: hackers@FreeBSD.ORG X-Organisation: Private FreeBSD site - Arnhem, The Netherlands X-pgp-info: PGP public key at 'finger wilko@freefall.freebsd.org' X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG As Justin T. Gibbs wrote ... > In article <199907201904.VAA03203@yedi.iaf.nl> you wrote: > > I'm currently trying to hack a driver together for a PCI card that uses > > shared memory to communicate to the host. > > > > If I'm not completely offtrack I need to use (under newbus/-current) > > bus_dma_tag_create, bus_dma_alloc etc to get access to the cards shared > > memory. > > bus_dma related stuff is only required if the device has a DMA engine > you wish to use. To access the shared memory on the card (e.g. map Eh, sorry, I was confused. It has *both* shared memory and a DMA engine. > it into the kernel's virtual address space), you will need to use > the resource manager and bus space. Do you by chance have an example (maybe in -current somewhere) of the shared memory stuff? I found some DMA stuff in ahc_pci.c: /* Allocate a dmatag for our SCB DMA maps */ /* XXX Should be a child of the PCI bus dma tag */ error = bus_dma_tag_create(/*parent*/NULL, /*alignment*/0, /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, /*maxsize*/MAXBSIZE, /*nsegments*/AHC_NSEG, /*maxsegsz*/AHC_MAXTRANSFER_SIZE, /*flags*/BUS_DMA_ALLOCNO but I admit it is not too clear (yet..) what all the parameters do. Most (?) drivers seem to use the older framework (can I distinguish those by COMPAT_PCI_DRIVER() ?). Thanks, Wilko -- | / o / / _ Arnhem, The Netherlands - Powered by FreeBSD - |/|/ / / /( (_) Bulte WWW : http://www.tcja.nl http://www.freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message