As Justin T. Gibbs wrote ...
> In article <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message