Use bus_get_dma_tag() to get parent tag. Also use

BUS_SPACE_MAXSIZE_32BIT to specify sum of all segment lengths.
Previously it used MAXBSIZE which was wrong.

Reviewed by:	davidch
This commit is contained in:
Pyun YongHyeon 2010-07-19 23:35:43 +00:00
parent 66c0f45a3d
commit 6351e52fcf

View File

@ -3146,10 +3146,10 @@ bce_dma_alloc(device_t dev)
/*
* Allocate the parent bus DMA tag appropriate for PCI.
*/
if (bus_dma_tag_create(NULL, 1, BCE_DMA_BOUNDARY,
if (bus_dma_tag_create(bus_get_dma_tag(dev), 1, BCE_DMA_BOUNDARY,
sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL,
MAXBSIZE, BUS_SPACE_UNRESTRICTED, BUS_SPACE_MAXSIZE_32BIT,
0, NULL, NULL, &sc->parent_tag)) {
BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL,
&sc->parent_tag)) {
BCE_PRINTF("%s(%d): Could not allocate parent DMA tag!\n",
__FILE__, __LINE__);
rc = ENOMEM;