Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Jan 2003 15:46:16 -0800
From:      Maxime Henrion <mux@freebsd.org>
To:        Josef Karthauser <joe@FreeBSD.org>
Cc:        Thomas Moestl <tmoestl@gmx.net>, current@FreeBSD.org
Subject:   Re: Bus DMA for USB - compilation problems.
Message-ID:  <20030115234616.GI16775@elvis.mu.org>
In-Reply-To: <20030115231539.GB14326@genius.tao.org.uk>
References:  <20030115195607.GA13076@genius.tao.org.uk> <20030115200519.GH16775@elvis.mu.org> <20030115202033.GA13368@genius.tao.org.uk> <20030115215804.GA286@crow.dom2ip.de> <20030115231539.GB14326@genius.tao.org.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Josef Karthauser wrote:
> On Wed, Jan 15, 2003 at 10:58:04PM +0100, Thomas Moestl wrote:
> > 
> > DMAADDR is:
> > 	
> >   #define DMAADDR(dma, o) ((dma)->block->map->dm_segs[0].ds_addr + (dma)->offs + (o))
> > 
> > struct usb_dma_block starts like:
> > 
> >   typedef struct usb_dma_block {
> > 	  bus_dma_tag_t tag;
> > 	  bus_dmamap_t map;
> > 
> > However, bus_dmamap_t (like bus_dma_tag_t) is supposed to be opaque to
> > users of the busdma interface on FreeBSD. Our implementations enforce
> > this by defining it as:
> > 
> >   typedef struct bus_dmamap *bus_dmamap_t;
> > 
> > , and by not exporting struct bus_dmamap in public headers.
> > 
> > The DMA addresses are obtained by writing an appropriate callback
> > routine to process them and passing it to bus_dmamap_load().
> > The usb_mem.c will need some other changes to work on FreeBSD, since
> > our busdma code has diverged from NetBSD's quite a bit.
> 
> Is ours documented anywhere, or is converting usb_mem.c to our style
> something that you could help me with?

Sorry for the late reply.  As Thomas said, you have to get this
information in the callback routine.  Unfortunately, we don't have
manpages for the busdma API yet, but we should get them soon now as
someone is working on it.  You can get examples by looking at several
drivers which have been converted, like if_rl or if_sis.

Cheers,
Maxime



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030115234616.GI16775>