Date: Tue, 20 Jul 1999 22:37:47 +0200 (CEST) From: Wilko Bulte <wilko@yedi.iaf.nl> To: gibbs@narnia.plutotech.com (Justin T. Gibbs) Cc: hackers@FreeBSD.ORG Subject: Re: any docs on how to use bus_dma_tag_create e.a. ? Message-ID: <199907202037.WAA00801@yedi.iaf.nl> In-Reply-To: <199907201958.NAA07710@narnia.plutotech.com> from "Justin T. Gibbs" at "Jul 20, 1999 1:58:54 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907202037.WAA00801>