Final pass at having devices use their bus parent for dma tags. The

remaining drivers that haven't been converted have various problems or
complexities that will be dealt with later.  This list includes:

hptrr, hptmv, hpt27xx - device aggregation across multiple parents
drm - want to talk to the maintainer first
tsec, sec - Openfirmware devices, not sure if changes are warranted
fatm - Done except for unused testing code
usb - want to talk to the maintainer first
ce, cp, ctau, cx - Significant driver changes needed to convey parent info

There are also devices tucked into architecture subtrees that I'll leave
for the respective maintainers to deal with.
This commit is contained in:
Scott Long 2012-03-12 19:29:35 +00:00
parent f1bd1e9dd7
commit 6ac6f295b0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=232883
7 changed files with 11 additions and 14 deletions

View File

@ -171,9 +171,8 @@ adv_eisa_attach(device_t dev)
* Allocate a parent dmatag for all tags created
* by the MI portions of the advansys driver
*/
/* XXX Should be a child of the PCI bus dma tag */
error = bus_dma_tag_create(
/* parent */ NULL,
/* parent */ bus_get_dma_tag(dev),
/* alignment */ 1,
/* boundary */ 0,
/* lowaddr */ ADV_EISA_MAX_DMA_ADDR,
@ -211,9 +210,8 @@ adv_eisa_attach(device_t dev)
* Allocate a parent dmatag for all tags created
* by the MI portions of the advansys driver
*/
/* XXX Should be a child of the PCI bus dma tag */
error = bus_dma_tag_create(
/* parent */ NULL,
/* parent */ bus_get_dma_tag(dev),
/* alignment */ 1,
/* boundary */ 0,
/* lowaddr */ ADV_EISA_MAX_DMA_ADDR,

View File

@ -226,9 +226,8 @@ adv_isa_probe(device_t dev)
* Allocate a parent dmatag for all tags created
* by the MI portions of the advansys driver
*/
/* XXX Should be a child of the ISA bus dma tag */
error = bus_dma_tag_create(
/* parent */ NULL,
/* parent */ bus_get_dma_tag(dev),
/* alignemnt */ 1,
/* boundary */ 0,
/* lowaddr */ lowaddr,

View File

@ -292,7 +292,7 @@ ahbattach(device_t dev)
*/
/* DMA tag for mapping buffers into device visible space. */
/* XXX Should be a child of the EISA bus dma tag */
if (bus_dma_tag_create( /* parent */ NULL,
if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(dev),
/* alignment */ 1,
/* boundary */ 0,
/* lowaddr */ BUS_SPACE_MAXADDR_32BIT,
@ -311,7 +311,7 @@ ahbattach(device_t dev)
ahb->init_level++;
/* DMA tag for our ccb structures and ha inquiry data */
if (bus_dma_tag_create( /* parent */ NULL,
if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(dev),
/* alignment */ 1,
/* boundary */ 0,
/* lowaddr */ BUS_SPACE_MAXADDR_32BIT,

View File

@ -157,7 +157,7 @@ cesa_alloc_dma_mem(struct cesa_softc *sc, struct cesa_dma_mem *cdm,
KASSERT(cdm->cdm_vaddr == NULL,
("%s(): DMA memory descriptor in use.", __func__));
error = bus_dma_tag_create(NULL, /* parent */
error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), /* parent */
PAGE_SIZE, 0, /* alignment, boundary */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
@ -1046,7 +1046,7 @@ cesa_attach(device_t dev)
}
/* Create DMA tag for processed data */
error = bus_dma_tag_create(NULL, /* parent */
error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
1, 0, /* alignment, boundary */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */

View File

@ -2714,7 +2714,7 @@ en_dmaprobe(struct en_softc *sc)
* Allocate some DMA-able memory.
* We need 3 times the max burst size aligned to the max burst size.
*/
err = bus_dma_tag_create(NULL, MIDDMA_MAXBURST, 0,
err = bus_dma_tag_create(bus_get_dma_tag(sc->dev), MIDDMA_MAXBURST, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
3 * MIDDMA_MAXBURST, 1, 3 * MIDDMA_MAXBURST, 0,
NULL, NULL, &tag);
@ -2927,7 +2927,7 @@ en_attach(struct en_softc *sc)
MGET(sc->padbuf, M_WAIT, MT_DATA);
bzero(sc->padbuf->m_data, MLEN);
if (bus_dma_tag_create(NULL, 1, 0,
if (bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
EN_TXSZ * 1024, EN_MAX_DMASEG, EN_TXSZ * 1024, 0,
NULL, NULL, &sc->txtag))

View File

@ -549,7 +549,7 @@ wds_attach(device_t dev)
goto bad;
/* now create the memory buffer */
error = bus_dma_tag_create(NULL, /*alignment*/4,
error = bus_dma_tag_create(bus_get_dma_tag(dev), /*alignment*/4,
/*boundary*/0,
/*lowaddr*/BUS_SPACE_MAXADDR_24BIT,
/*highaddr*/ BUS_SPACE_MAXADDR,

View File

@ -650,7 +650,7 @@ blkfront_initialize(struct xb_softc *sc)
sc->max_request_blocks = BLKIF_SEGS_TO_BLOCKS(sc->max_request_segments);
/* Allocate datastructures based on negotiated values. */
error = bus_dma_tag_create(NULL, /* parent */
error = bus_dma_tag_create(bus_get_dma_tag(sc->xb_dev), /* parent */
512, PAGE_SIZE, /* algnmnt, boundary */
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */