Re: bus_get_dma_tag now necessary for drivers using bus_dma
- From: Hans Petter Selasky <hselasky@xxxxxxx>
- Date: Tue, 5 Sep 2006 21:11:50 +0200
On Tuesday 05 September 2006 20:31, Scott Long wrote:
Poul-Henning Kamp wrote:
In message <20060905173334.GH9421@xxxxxxxxxxxx>, John-Mark Gurney writes:
This means that for each call to bus_dma_tag_create, instead of passing
a NULL pointer, you should call bus_get_dma_tag(yourdev) and use that
as the parent tag. I committed some example code to various drivers,
such as ahc, ata, em, and ohci.
If there are never any exeptions to this requirement, why not
pass "yourdev" and have the magic hidden, rather than add 17
ritual characters to the API ?
Drivers can have their own multi-level tag heirarchy. You'd have to
create a new bus_dma_tag_create() variant that expected a device_t
instead of a bus_dma_tag_t. This might be a good idea.
I think it is easier to share code with NetBSD if we use
"bus_get_dma_tag(yourdev)".
For example I use the following prototype on NetBSD and FreeBSD:
void *
usbd_mem_alloc(bus_dma_tag_t parent, u_int32_t size,
u_int8_t align_power);
--HPS
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: bus_get_dma_tag now necessary for drivers using bus_dma
- From: John-Mark Gurney
- Re: bus_get_dma_tag now necessary for drivers using bus_dma
- References:
- Re: bus_get_dma_tag now necessary for drivers using bus_dma
- From: Poul-Henning Kamp
- Re: bus_get_dma_tag now necessary for drivers using bus_dma
- From: Scott Long
- Re: bus_get_dma_tag now necessary for drivers using bus_dma
- Prev by Date: Re: bus_get_dma_tag now necessary for drivers using bus_dma
- Next by Date: Re: bus_get_dma_tag now necessary for drivers using bus_dma
- Previous by thread: Re: bus_get_dma_tag now necessary for drivers using bus_dma
- Next by thread: Re: bus_get_dma_tag now necessary for drivers using bus_dma
- Index(es):
Relevant Pages
- Re: bus_get_dma_tag now necessary for drivers using bus_dma
... Poul-Henning Kamp wrote: ... a NULL pointer, you should call bus_get_dma_tagand
use that ... as the parent tag. ... I committed some example code to various drivers,
... (freebsd-arch) - Re: bus_get_dma_tag now necessary for drivers using bus_dma
... Poul-Henning Kamp wrote: ... a NULL pointer, you should call bus_get_dma_tagand
use that ... as the parent tag. ... I committed some example code to various drivers,
... (freebsd-current) - Re: bus_get_dma_tag now necessary for drivers using bus_dma
... a NULL pointer, you should call bus_get_dma_tagand use that ... as the parent
tag. ... Drivers can have their own multi-level tag heirarchy. ... For example
I use the following prototype on NetBSD and FreeBSD: ... (freebsd-current)