svn commit: r232883 - in head/sys/dev: advansys ahb cesa en wds
xen/blkfront
Scott Long
scottl at FreeBSD.org
Mon Mar 12 19:29:35 UTC 2012
Author: scottl
Date: Mon Mar 12 19:29:35 2012
New Revision: 232883
URL: http://svn.freebsd.org/changeset/base/232883
Log:
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.
Modified:
head/sys/dev/advansys/adv_eisa.c
head/sys/dev/advansys/adv_isa.c
head/sys/dev/ahb/ahb.c
head/sys/dev/cesa/cesa.c
head/sys/dev/en/midway.c
head/sys/dev/wds/wd7000.c
head/sys/dev/xen/blkfront/blkfront.c
Modified: head/sys/dev/advansys/adv_eisa.c
==============================================================================
--- head/sys/dev/advansys/adv_eisa.c Mon Mar 12 19:29:32 2012 (r232882)
+++ head/sys/dev/advansys/adv_eisa.c Mon Mar 12 19:29:35 2012 (r232883)
@@ -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,
Modified: head/sys/dev/advansys/adv_isa.c
==============================================================================
--- head/sys/dev/advansys/adv_isa.c Mon Mar 12 19:29:32 2012 (r232882)
+++ head/sys/dev/advansys/adv_isa.c Mon Mar 12 19:29:35 2012 (r232883)
@@ -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,
Modified: head/sys/dev/ahb/ahb.c
==============================================================================
--- head/sys/dev/ahb/ahb.c Mon Mar 12 19:29:32 2012 (r232882)
+++ head/sys/dev/ahb/ahb.c Mon Mar 12 19:29:35 2012 (r232883)
@@ -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,
Modified: head/sys/dev/cesa/cesa.c
==============================================================================
--- head/sys/dev/cesa/cesa.c Mon Mar 12 19:29:32 2012 (r232882)
+++ head/sys/dev/cesa/cesa.c Mon Mar 12 19:29:35 2012 (r232883)
@@ -157,7 +157,7 @@ cesa_alloc_dma_mem(struct cesa_softc *sc
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 */
Modified: head/sys/dev/en/midway.c
==============================================================================
--- head/sys/dev/en/midway.c Mon Mar 12 19:29:32 2012 (r232882)
+++ head/sys/dev/en/midway.c Mon Mar 12 19:29:35 2012 (r232883)
@@ -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))
Modified: head/sys/dev/wds/wd7000.c
==============================================================================
--- head/sys/dev/wds/wd7000.c Mon Mar 12 19:29:32 2012 (r232882)
+++ head/sys/dev/wds/wd7000.c Mon Mar 12 19:29:35 2012 (r232883)
@@ -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,
Modified: head/sys/dev/xen/blkfront/blkfront.c
==============================================================================
--- head/sys/dev/xen/blkfront/blkfront.c Mon Mar 12 19:29:32 2012 (r232882)
+++ head/sys/dev/xen/blkfront/blkfront.c Mon Mar 12 19:29:35 2012 (r232883)
@@ -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 */
More information about the svn-src-all
mailing list