svn commit: r233024 - in stable/9/sys/dev: advansys ahb aic7xxx amr
an arcmsr asr buslogic bxe ciss cxgb de dpt en glxsb hatm
hifn hptiop hptmv ida if_ndis iir ips ipw ixgb ixgbe lmc mfi
mge mlx ml...
Scott Long
scottl at FreeBSD.org
Fri Mar 16 08:47:00 UTC 2012
Author: scottl
Date: Fri Mar 16 08:46:58 2012
New Revision: 233024
URL: http://svn.freebsd.org/changeset/base/233024
Log:
MFC 232854,232874,232882,232883,232886 for bus_get_dma_tag()
Modified:
stable/9/sys/dev/advansys/adv_eisa.c
stable/9/sys/dev/advansys/adv_isa.c
stable/9/sys/dev/advansys/adv_pci.c
stable/9/sys/dev/advansys/adw_pci.c
stable/9/sys/dev/ahb/ahb.c
stable/9/sys/dev/aic7xxx/ahc_eisa.c
stable/9/sys/dev/aic7xxx/ahc_isa.c
stable/9/sys/dev/aic7xxx/ahc_pci.c
stable/9/sys/dev/aic7xxx/ahd_pci.c
stable/9/sys/dev/amr/amr_pci.c
stable/9/sys/dev/an/if_an_pci.c
stable/9/sys/dev/arcmsr/arcmsr.c
stable/9/sys/dev/asr/asr.c
stable/9/sys/dev/buslogic/bt_pci.c
stable/9/sys/dev/bxe/if_bxe.c
stable/9/sys/dev/ciss/ciss.c
stable/9/sys/dev/cxgb/cxgb_sge.c
stable/9/sys/dev/de/if_de.c
stable/9/sys/dev/dpt/dpt_pci.c
stable/9/sys/dev/en/midway.c
stable/9/sys/dev/glxsb/glxsb.c
stable/9/sys/dev/hatm/if_hatm.c
stable/9/sys/dev/hifn/hifn7751.c
stable/9/sys/dev/hptiop/hptiop.c
stable/9/sys/dev/hptmv/entry.c
stable/9/sys/dev/ida/ida_pci.c
stable/9/sys/dev/if_ndis/if_ndis_pci.c
stable/9/sys/dev/iir/iir_pci.c
stable/9/sys/dev/ips/ips_pci.c
stable/9/sys/dev/ipw/if_ipw.c
stable/9/sys/dev/ipw/if_ipwvar.h
stable/9/sys/dev/ixgb/if_ixgb.c
stable/9/sys/dev/ixgbe/ixgbe.c
stable/9/sys/dev/ixgbe/ixv.c
stable/9/sys/dev/lmc/if_lmc.c
stable/9/sys/dev/mfi/mfi_pci.c
stable/9/sys/dev/mge/if_mge.c
stable/9/sys/dev/mlx/mlx_pci.c
stable/9/sys/dev/mly/mly.c
stable/9/sys/dev/mxge/if_mxge.c
stable/9/sys/dev/nve/if_nve.c
stable/9/sys/dev/patm/if_patm_attach.c
stable/9/sys/dev/safe/safe.c
stable/9/sys/dev/trm/trm.c
stable/9/sys/dev/twe/twe_freebsd.c
stable/9/sys/dev/tws/tws.c
stable/9/sys/dev/ubsec/ubsec.c
stable/9/sys/dev/wds/wd7000.c
stable/9/sys/dev/xen/blkfront/blkfront.c
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/dev/advansys/adv_eisa.c
==============================================================================
--- stable/9/sys/dev/advansys/adv_eisa.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/advansys/adv_eisa.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -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: stable/9/sys/dev/advansys/adv_isa.c
==============================================================================
--- stable/9/sys/dev/advansys/adv_isa.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/advansys/adv_isa.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -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: stable/9/sys/dev/advansys/adv_pci.c
==============================================================================
--- stable/9/sys/dev/advansys/adv_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/advansys/adv_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -187,9 +187,8 @@ adv_pci_attach(device_t dev)
}
/* Allocate a dmatag for our transfer DMA maps */
- /* 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_PCI_MAX_DMA_ADDR,
Modified: stable/9/sys/dev/advansys/adw_pci.c
==============================================================================
--- stable/9/sys/dev/advansys/adw_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/advansys/adw_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -258,9 +258,8 @@ adw_pci_attach(device_t dev)
pci_write_config(dev, PCIR_COMMAND, command, /*bytes*/1);
/* Allocate a dmatag for our transfer DMA maps */
- /* 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 */ ADW_PCI_MAX_DMA_ADDR,
Modified: stable/9/sys/dev/ahb/ahb.c
==============================================================================
--- stable/9/sys/dev/ahb/ahb.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/ahb/ahb.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -291,8 +291,7 @@ ahbattach(device_t dev)
* need to perform during normal operation.
*/
/* 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 +310,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: stable/9/sys/dev/aic7xxx/ahc_eisa.c
==============================================================================
--- stable/9/sys/dev/aic7xxx/ahc_eisa.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/aic7xxx/ahc_eisa.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -130,7 +130,6 @@ aic7770_attach(device_t dev)
ahc_set_unit(ahc, device_get_unit(dev));
/* Allocate a dmatag for our SCB DMA maps */
- /* XXX Should be a child of the PCI bus dma tag */
error = aic_dma_tag_create(ahc, /*parent*/bus_get_dma_tag(dev),
/*alignment*/1, /*boundary*/0,
/*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
Modified: stable/9/sys/dev/aic7xxx/ahc_isa.c
==============================================================================
--- stable/9/sys/dev/aic7xxx/ahc_isa.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/aic7xxx/ahc_isa.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -253,7 +253,6 @@ ahc_isa_attach(device_t dev)
ahc_set_unit(ahc, device_get_unit(dev));
/* Allocate a dmatag for our SCB DMA maps */
- /* XXX Should be a child of the VLB/ISA bus dma tag */
error = aic_dma_tag_create(ahc, /*parent*/bus_get_dma_tag(dev),
/*alignment*/1, /*boundary*/0,
/*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
Modified: stable/9/sys/dev/aic7xxx/ahc_pci.c
==============================================================================
--- stable/9/sys/dev/aic7xxx/ahc_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/aic7xxx/ahc_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -105,7 +105,6 @@ ahc_pci_attach(device_t dev)
ahc->flags |= AHC_39BIT_ADDRESSING;
/* Allocate a dmatag for our SCB DMA maps */
- /* XXX Should be a child of the PCI bus dma tag */
error = aic_dma_tag_create(ahc, /*parent*/bus_get_dma_tag(dev),
/*alignment*/1, /*boundary*/0,
(ahc->flags & AHC_39BIT_ADDRESSING)
Modified: stable/9/sys/dev/aic7xxx/ahd_pci.c
==============================================================================
--- stable/9/sys/dev/aic7xxx/ahd_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/aic7xxx/ahd_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -107,7 +107,6 @@ ahd_pci_attach(device_t dev)
ahd->flags |= AHD_39BIT_ADDRESSING;
/* Allocate a dmatag for our SCB DMA maps */
- /* XXX Should be a child of the PCI bus dma tag */
error = aic_dma_tag_create(ahd, /*parent*/bus_get_dma_tag(dev),
/*alignment*/1, /*boundary*/0,
(ahd->flags & AHD_39BIT_ADDRESSING)
Modified: stable/9/sys/dev/amr/amr_pci.c
==============================================================================
--- stable/9/sys/dev/amr/amr_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/amr/amr_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -275,7 +275,7 @@ amr_pci_attach(device_t dev)
/*
* Allocate the parent bus DMA tag appropriate for PCI.
*/
- if (bus_dma_tag_create(NULL, /* parent */
+ if (bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */
1, 0, /* alignment,boundary */
AMR_IS_SG64(sc) ?
BUS_SPACE_MAXADDR :
Modified: stable/9/sys/dev/an/if_an_pci.c
==============================================================================
--- stable/9/sys/dev/an/if_an_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/an/if_an_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -195,7 +195,7 @@ an_attach_pci(dev)
}
/* Allocate DMA region */
- error = bus_dma_tag_create(NULL, /* parent */
+ error = bus_dma_tag_create(bus_get_dma_tag(dev),/* parent */
1, 0, /* alignment, bounds */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/arcmsr/arcmsr.c
==============================================================================
--- stable/9/sys/dev/arcmsr/arcmsr.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/arcmsr/arcmsr.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -3486,7 +3486,7 @@ static u_int32_t arcmsr_initialize(devic
return ENOMEM;
}
}
- if(bus_dma_tag_create( /*parent*/ NULL,
+ if(bus_dma_tag_create( /*PCI parent*/ bus_get_dma_tag(dev),
/*alignemnt*/ 1,
/*boundary*/ 0,
/*lowaddr*/ BUS_SPACE_MAXADDR,
Modified: stable/9/sys/dev/asr/asr.c
==============================================================================
--- stable/9/sys/dev/asr/asr.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/asr/asr.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -2328,7 +2328,7 @@ asr_alloc_dma(Asr_softc_t *sc)
dev = sc->ha_dev;
- if (bus_dma_tag_create(NULL, /* parent */
+ if (bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */
1, 0, /* algnmnt, boundary */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/buslogic/bt_pci.c
==============================================================================
--- stable/9/sys/dev/buslogic/bt_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/buslogic/bt_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -172,8 +172,7 @@ bt_pci_attach(device_t dev)
}
/* Allocate a dmatag for our CCB DMA maps */
- /* XXX Should be a child of the PCI bus dma tag */
- if (bus_dma_tag_create( /* parent */ NULL,
+ if (bus_dma_tag_create( /* PCI parent */ bus_get_dma_tag(dev),
/* alignemnt */ 1,
/* boundary */ 0,
/* lowaddr */ BUS_SPACE_MAXADDR_32BIT,
Modified: stable/9/sys/dev/bxe/if_bxe.c
==============================================================================
--- stable/9/sys/dev/bxe/if_bxe.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/bxe/if_bxe.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -13583,7 +13583,8 @@ bxe_host_structures_alloc(device_t dev)
/*
* Allocate the parent bus DMA tag appropriate for PCI.
*/
- rc = bus_dma_tag_create(NULL, /* parent tag */
+ rc = bus_dma_tag_create(
+ bus_get_dma_tag(dev), /* PCI parent tag */
1, /* alignment for segs */
BXE_DMA_BOUNDARY, /* cannot cross */
BUS_SPACE_MAXADDR, /* restricted low */
Modified: stable/9/sys/dev/ciss/ciss.c
==============================================================================
--- stable/9/sys/dev/ciss/ciss.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/ciss/ciss.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -795,7 +795,7 @@ setup:
* Note that "simple" adapters can only address within a 32-bit
* span.
*/
- if (bus_dma_tag_create(NULL, /* parent */
+ if (bus_dma_tag_create(bus_get_dma_tag(sc->ciss_dev),/* PCI parent */
1, 0, /* alignment, boundary */
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- stable/9/sys/dev/cxgb/cxgb_sge.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/cxgb/cxgb_sge.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -591,7 +591,7 @@ t3_sge_alloc(adapter_t *sc)
{
/* The parent tag. */
- if (bus_dma_tag_create( NULL, /* parent */
+ if (bus_dma_tag_create( bus_get_dma_tag(sc->dev),/* PCI parent */
1, 0, /* algnmnt, boundary */
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/de/if_de.c
==============================================================================
--- stable/9/sys/dev/de/if_de.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/de/if_de.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -4492,7 +4492,8 @@ tulip_busdma_allocring(device_t dev, tul
/* First, setup a tag. */
ri->ri_max = count;
size = count * sizeof(tulip_desc_t);
- error = bus_dma_tag_create(NULL, 32, 0, BUS_SPACE_MAXADDR_32BIT,
+ error = bus_dma_tag_create(bus_get_dma_tag(dev),
+ 32, 0, BUS_SPACE_MAXADDR_32BIT,
BUS_SPACE_MAXADDR, NULL, NULL, size, 1, size, 0, NULL, NULL,
&ri->ri_ring_tag);
if (error) {
@@ -4520,7 +4521,7 @@ tulip_busdma_allocring(device_t dev, tul
}
/* Allocate a tag for the data buffers. */
- error = bus_dma_tag_create(NULL, align, 0,
+ error = bus_dma_tag_create(bus_get_dma_tag(dev), align, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
MCLBYTES * nsegs, nsegs, MCLBYTES, 0, NULL, NULL, &ri->ri_data_tag);
if (error) {
@@ -4600,7 +4601,7 @@ tulip_busdma_init(device_t dev, tulip_so
/*
* Allocate a DMA tag, memory, and map for setup descriptor
*/
- error = bus_dma_tag_create(NULL, 32, 0,
+ error = bus_dma_tag_create(bus_get_dma_tag(dev), 32, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
sizeof(sc->tulip_setupdata), 1, sizeof(sc->tulip_setupdata), 0,
NULL, NULL, &sc->tulip_setup_tag);
Modified: stable/9/sys/dev/dpt/dpt_pci.c
==============================================================================
--- stable/9/sys/dev/dpt/dpt_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/dpt/dpt_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -132,8 +132,7 @@ dpt_pci_attach (device_t dev)
dpt_alloc(dev);
/* Allocate a dmatag representing the capabilities of this attachment */
- /* XXX Should be a child of the PCI bus dma tag */
- if (bus_dma_tag_create( /* parent */ NULL,
+ if (bus_dma_tag_create( /* PCI parent */ bus_get_dma_tag(dev),
/* alignemnt */ 1,
/* boundary */ 0,
/* lowaddr */ BUS_SPACE_MAXADDR_32BIT,
Modified: stable/9/sys/dev/en/midway.c
==============================================================================
--- stable/9/sys/dev/en/midway.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/en/midway.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -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: stable/9/sys/dev/glxsb/glxsb.c
==============================================================================
--- stable/9/sys/dev/glxsb/glxsb.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/glxsb/glxsb.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -397,7 +397,7 @@ glxsb_dma_alloc(struct glxsb_softc *sc)
dma->dma_size = GLXSB_MAX_AES_LEN * 2;
/* Setup DMA descriptor area */
- rc = bus_dma_tag_create(NULL, /* parent */
+ rc = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), /* parent */
SB_AES_ALIGN, 0, /* alignments, bounds */
BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/hatm/if_hatm.c
==============================================================================
--- stable/9/sys/dev/hatm/if_hatm.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/hatm/if_hatm.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -1722,7 +1722,7 @@ hatm_attach(device_t dev)
/*
* ALlocate a DMA tag for subsequent allocations
*/
- 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,
BUS_SPACE_MAXSIZE_32BIT, 1,
@@ -1751,7 +1751,7 @@ hatm_attach(device_t dev)
* but this would not work. So make the maximum number of TPDs
* occupied by one packet a configuration parameter.
*/
- 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,
HE_MAX_PDU, 3 * HE_CONFIG_MAX_TPD_PER_PACKET, HE_MAX_PDU, 0,
NULL, NULL, &sc->tx_tag)) {
Modified: stable/9/sys/dev/hifn/hifn7751.c
==============================================================================
--- stable/9/sys/dev/hifn/hifn7751.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/hifn/hifn7751.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -430,7 +430,7 @@ hifn_attach(device_t dev)
* Setup the area where the Hifn DMA's descriptors
* and associated data structures.
*/
- if (bus_dma_tag_create(NULL, /* parent */
+ if (bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */
1, 0, /* alignment,boundary */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/hptiop/hptiop.c
==============================================================================
--- stable/9/sys/dev/hptiop/hptiop.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/hptiop/hptiop.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -1358,7 +1358,7 @@ static int hptiop_attach(device_t dev)
mtx_init(&hba->lock, "hptioplock", NULL, MTX_DEF);
#endif
- if (bus_dma_tag_create(NULL,/* parent */
+ if (bus_dma_tag_create(bus_get_dma_tag(dev),/* PCI parent */
1, /* alignment */
0, /* boundary */
BUS_SPACE_MAXADDR, /* lowaddr */
Modified: stable/9/sys/dev/hptmv/entry.c
==============================================================================
--- stable/9/sys/dev/hptmv/entry.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/hptmv/entry.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -1326,7 +1326,7 @@ init_adapter(IAL_ADAPTER_T *pAdapter)
_vbus_p->OsExt = (void *)pAdapter;
pMvSataAdapter->IALData = pAdapter;
- if (bus_dma_tag_create(NULL,/* parent */
+ if (bus_dma_tag_create(bus_get_dma_tag(pAdapter->hpt_dev),/* parent */
4, /* alignment */
BUS_SPACE_MAXADDR_32BIT+1, /* boundary */
BUS_SPACE_MAXADDR, /* lowaddr */
Modified: stable/9/sys/dev/ida/ida_pci.c
==============================================================================
--- stable/9/sys/dev/ida/ida_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/ida/ida_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -267,7 +267,7 @@ ida_pci_attach(device_t dev)
}
error = bus_dma_tag_create(
- /* parent */ NULL,
+ /* parent */ bus_get_dma_tag(dev),
/* alignment */ 1,
/* boundary */ 0,
/* lowaddr */ BUS_SPACE_MAXADDR_32BIT,
Modified: stable/9/sys/dev/if_ndis/if_ndis_pci.c
==============================================================================
--- stable/9/sys/dev/if_ndis/if_ndis_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/if_ndis/if_ndis_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -290,7 +290,7 @@ ndis_attach_pci(dev)
* Allocate the parent bus DMA tag appropriate for PCI.
*/
#define NDIS_NSEG_NEW 32
- error = bus_dma_tag_create(NULL, /* parent */
+ error = bus_dma_tag_create(bus_get_dma_tag(dev),/* PCI parent */
1, 0, /* alignment, boundary */
BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/iir/iir_pci.c
==============================================================================
--- stable/9/sys/dev/iir/iir_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/iir/iir_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -317,8 +317,8 @@ iir_pci_attach(device_t dev)
gdt->sc_test_busy = gdt_mpr_test_busy;
/* Allocate a dmatag representing the capabilities of this attachment */
- /* XXX Should be a child of the PCI bus dma tag */
- if (bus_dma_tag_create(/*parent*/NULL, /*alignemnt*/1, /*boundary*/0,
+ if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(dev),
+ /*alignemnt*/1, /*boundary*/0,
/*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
/*highaddr*/BUS_SPACE_MAXADDR,
/*filter*/NULL, /*filterarg*/NULL,
Modified: stable/9/sys/dev/ips/ips_pci.c
==============================================================================
--- stable/9/sys/dev/ips/ips_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/ips/ips_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -135,7 +135,7 @@ static int ips_pci_attach(device_t dev)
device_printf(dev, "irq setup failed\n");
goto error;
}
- if (bus_dma_tag_create( /* parent */ NULL,
+ if (bus_dma_tag_create( /* PCI parent */bus_get_dma_tag(dev),
/* alignemnt */ 1,
/* boundary */ 0,
/* lowaddr */ BUS_SPACE_MAXADDR_32BIT,
Modified: stable/9/sys/dev/ipw/if_ipw.c
==============================================================================
--- stable/9/sys/dev/ipw/if_ipw.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/ipw/if_ipw.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -528,9 +528,21 @@ ipw_dma_alloc(struct ipw_softc *sc)
int error, i;
/*
+ * Allocate parent DMA tag for subsequent allocations.
+ */
+ error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0,
+ BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
+ BUS_SPACE_MAXSIZE_32BIT, BUS_SPACE_UNRESTRICTED,
+ BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->parent_dmat);
+ if (error != 0) {
+ device_printf(sc->sc_dev, "could not create parent DMA tag\n");
+ goto fail;
+ }
+
+ /*
* Allocate and map tx ring.
*/
- error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT,
+ error = bus_dma_tag_create(sc->parent_dmat, 4, 0, BUS_SPACE_MAXADDR_32BIT,
BUS_SPACE_MAXADDR, NULL, NULL, IPW_TBD_SZ, 1, IPW_TBD_SZ, 0, NULL,
NULL, &sc->tbd_dmat);
if (error != 0) {
@@ -556,7 +568,7 @@ ipw_dma_alloc(struct ipw_softc *sc)
/*
* Allocate and map rx ring.
*/
- error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT,
+ error = bus_dma_tag_create(sc->parent_dmat, 4, 0, BUS_SPACE_MAXADDR_32BIT,
BUS_SPACE_MAXADDR, NULL, NULL, IPW_RBD_SZ, 1, IPW_RBD_SZ, 0, NULL,
NULL, &sc->rbd_dmat);
if (error != 0) {
@@ -582,7 +594,7 @@ ipw_dma_alloc(struct ipw_softc *sc)
/*
* Allocate and map status ring.
*/
- error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT,
+ error = bus_dma_tag_create(sc->parent_dmat, 4, 0, BUS_SPACE_MAXADDR_32BIT,
BUS_SPACE_MAXADDR, NULL, NULL, IPW_STATUS_SZ, 1, IPW_STATUS_SZ, 0,
NULL, NULL, &sc->status_dmat);
if (error != 0) {
@@ -611,7 +623,7 @@ ipw_dma_alloc(struct ipw_softc *sc)
/*
* Allocate command DMA map.
*/
- error = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT,
+ error = bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT,
BUS_SPACE_MAXADDR, NULL, NULL, sizeof (struct ipw_cmd), 1,
sizeof (struct ipw_cmd), 0, NULL, NULL, &sc->cmd_dmat);
if (error != 0) {
@@ -629,7 +641,7 @@ ipw_dma_alloc(struct ipw_softc *sc)
/*
* Allocate headers DMA maps.
*/
- error = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT,
+ error = bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT,
BUS_SPACE_MAXADDR, NULL, NULL, sizeof (struct ipw_hdr), 1,
sizeof (struct ipw_hdr), 0, NULL, NULL, &sc->hdr_dmat);
if (error != 0) {
@@ -652,7 +664,7 @@ ipw_dma_alloc(struct ipw_softc *sc)
/*
* Allocate tx buffers DMA maps.
*/
- error = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT,
+ error = bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT,
BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, IPW_MAX_NSEG, MCLBYTES, 0,
NULL, NULL, &sc->txbuf_dmat);
if (error != 0) {
@@ -684,7 +696,7 @@ ipw_dma_alloc(struct ipw_softc *sc)
/*
* Pre-allocate rx buffers and DMA maps.
*/
- error = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT,
+ error = bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT,
BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, MCLBYTES, 0, NULL,
NULL, &sc->rxbuf_dmat);
if (error != 0) {
@@ -741,6 +753,10 @@ ipw_release(struct ipw_softc *sc)
struct ipw_soft_buf *sbuf;
int i;
+ if (sc->parent_dmat != NULL) {
+ bus_dma_tag_destroy(sc->parent_dmat);
+ }
+
if (sc->tbd_dmat != NULL) {
if (sc->stbd_list != NULL) {
bus_dmamap_unload(sc->tbd_dmat, sc->tbd_map);
Modified: stable/9/sys/dev/ipw/if_ipwvar.h
==============================================================================
--- stable/9/sys/dev/ipw/if_ipwvar.h Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/ipw/if_ipwvar.h Fri Mar 16 08:46:58 2012 (r233024)
@@ -117,6 +117,7 @@ struct ipw_softc {
int sc_tx_timer;
int sc_scan_timer;
+ bus_dma_tag_t parent_dmat;
bus_dma_tag_t tbd_dmat;
bus_dma_tag_t rbd_dmat;
bus_dma_tag_t status_dmat;
Modified: stable/9/sys/dev/ixgb/if_ixgb.c
==============================================================================
--- stable/9/sys/dev/ixgb/if_ixgb.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/ixgb/if_ixgb.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -1422,7 +1422,7 @@ ixgb_dma_malloc(struct adapter * adapter
int r;
dev = adapter->dev;
- r = bus_dma_tag_create(NULL, /* parent */
+ r = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
PAGE_SIZE, 0, /* alignment, bounds */
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
@@ -1514,7 +1514,7 @@ ixgb_setup_transmit_structures(struct ad
/*
* Setup DMA descriptor areas.
*/
- if (bus_dma_tag_create(NULL, /* parent */
+ if (bus_dma_tag_create(bus_get_dma_tag(adapter->dev), /* parent */
PAGE_SIZE, 0, /* alignment, bounds */
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
@@ -1852,7 +1852,7 @@ ixgb_allocate_receive_structures(struct
bzero(adapter->rx_buffer_area,
sizeof(struct ixgb_buffer) * adapter->num_rx_desc);
- error = bus_dma_tag_create(NULL, /* parent */
+ error = bus_dma_tag_create(bus_get_dma_tag(adapter->dev),/* parent */
PAGE_SIZE, 0, /* alignment, bounds */
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/ixgbe/ixgbe.c
==============================================================================
--- stable/9/sys/dev/ixgbe/ixgbe.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/ixgbe/ixgbe.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -2761,7 +2761,8 @@ ixgbe_allocate_transmit_buffers(struct t
/*
* Setup DMA descriptor areas.
*/
- if ((error = bus_dma_tag_create(NULL, /* parent */
+ if ((error = bus_dma_tag_create(
+ bus_get_dma_tag(adapter->dev), /* parent */
1, 0, /* alignment, bounds */
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/ixgbe/ixv.c
==============================================================================
--- stable/9/sys/dev/ixgbe/ixv.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/ixgbe/ixv.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -2146,7 +2146,8 @@ ixv_allocate_transmit_buffers(struct tx_
/*
* Setup DMA descriptor areas.
*/
- if ((error = bus_dma_tag_create(NULL, /* parent */
+ if ((error = bus_dma_tag_create(
+ bus_get_dma_tag(adapter->dev), /* parent */
1, 0, /* alignment, bounds */
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/lmc/if_lmc.c
==============================================================================
--- stable/9/sys/dev/lmc/if_lmc.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/lmc/if_lmc.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -2621,7 +2621,8 @@ create_ring(softc_t *sc, struct desc_rin
#ifdef __FreeBSD__
/* Create a DMA tag for descriptors and buffers. */
- if ((error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT,
+ if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev),
+ 4, 0, BUS_SPACE_MAXADDR_32BIT,
BUS_SPACE_MAXADDR, NULL, NULL, PAGE_SIZE, 2, PAGE_SIZE, BUS_DMA_ALLOCNOW,
# if (__FreeBSD_version >= 502000)
NULL, NULL,
Modified: stable/9/sys/dev/mfi/mfi_pci.c
==============================================================================
--- stable/9/sys/dev/mfi/mfi_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/mfi/mfi_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -216,7 +216,7 @@ mfi_pci_attach(device_t dev)
error = ENOMEM;
/* Allocate parent DMA tag */
- if (bus_dma_tag_create( NULL, /* parent */
+ if (bus_dma_tag_create( bus_get_dma_tag(dev), /* PCI parent */
1, 0, /* algnmnt, boundary */
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/mge/if_mge.c
==============================================================================
--- stable/9/sys/dev/mge/if_mge.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/mge/if_mge.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -439,7 +439,7 @@ mge_alloc_desc_dma(struct mge_softc *sc,
tab[size - 1].mge_desc->next_desc = desc_paddr;
/* Allocate a busdma tag for mbufs. */
- error = bus_dma_tag_create(NULL, /* parent */
+ error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), /* parent */
8, 0, /* alignment, boundary */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
@@ -477,7 +477,7 @@ mge_allocate_dma(struct mge_softc *sc)
int i;
/* Allocate a busdma tag and DMA safe memory for TX/RX descriptors. */
- error = bus_dma_tag_create(NULL, /* parent */
+ error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), /* parent */
16, 0, /* alignment, boundary */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/mlx/mlx_pci.c
==============================================================================
--- stable/9/sys/dev/mlx/mlx_pci.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/mlx/mlx_pci.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -189,7 +189,7 @@ mlx_pci_attach(device_t dev)
/*
* Allocate the parent bus DMA tag appropriate for PCI.
*/
- error = bus_dma_tag_create(NULL, /* parent */
+ error = bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */
1, 0, /* alignment, boundary */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/mly/mly.c
==============================================================================
--- stable/9/sys/dev/mly/mly.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/mly/mly.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -392,7 +392,7 @@ mly_pci_attach(struct mly_softc *sc)
*
* Note that all of these controllers are 64-bit capable.
*/
- if (bus_dma_tag_create(NULL, /* parent */
+ if (bus_dma_tag_create(bus_get_dma_tag(sc->mly_dev),/* PCI parent */
1, 0, /* alignment, boundary */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/mxge/if_mxge.c
==============================================================================
--- stable/9/sys/dev/mxge/if_mxge.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/mxge/if_mxge.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -4662,7 +4662,7 @@ mxge_attach(device_t dev)
goto abort_with_nothing;
}
- err = bus_dma_tag_create(NULL, /* parent */
+ err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
1, /* alignment */
0, /* boundary */
BUS_SPACE_MAXADDR, /* low */
Modified: stable/9/sys/dev/nve/if_nve.c
==============================================================================
--- stable/9/sys/dev/nve/if_nve.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/nve/if_nve.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -371,7 +371,8 @@ nve_attach(device_t dev)
goto fail;
}
/* Allocate DMA tags */
- error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT,
+ error = bus_dma_tag_create(bus_get_dma_tag(dev),
+ 4, 0, BUS_SPACE_MAXADDR_32BIT,
BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES * NV_MAX_FRAGS,
NV_MAX_FRAGS, MCLBYTES, 0,
busdma_lock_mutex, &Giant,
@@ -380,7 +381,8 @@ nve_attach(device_t dev)
device_printf(dev, "couldn't allocate dma tag\n");
goto fail;
}
- error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT,
+ error = bus_dma_tag_create(bus_get_dma_tag(dev),
+ 4, 0, BUS_SPACE_MAXADDR_32BIT,
BUS_SPACE_MAXADDR, NULL, NULL,
sizeof(struct nve_rx_desc) * RX_RING_SIZE, 1,
sizeof(struct nve_rx_desc) * RX_RING_SIZE, 0,
@@ -390,7 +392,8 @@ nve_attach(device_t dev)
device_printf(dev, "couldn't allocate dma tag\n");
goto fail;
}
- error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT,
+ error = bus_dma_tag_create(bus_get_dma_tag(dev),
+ 4, 0, BUS_SPACE_MAXADDR_32BIT,
BUS_SPACE_MAXADDR, NULL, NULL,
sizeof(struct nve_tx_desc) * TX_RING_SIZE, 1,
sizeof(struct nve_tx_desc) * TX_RING_SIZE, 0,
Modified: stable/9/sys/dev/patm/if_patm_attach.c
==============================================================================
--- stable/9/sys/dev/patm/if_patm_attach.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/patm/if_patm_attach.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -404,7 +404,7 @@ patm_attach(device_t dev)
* Don't use BUS_DMA_ALLOCNOW, because we never need bouncing with
* bus_dmamem_alloc()
*/
- error = bus_dma_tag_create(NULL, PAGE_SIZE, 0,
+ error = bus_dma_tag_create(bus_get_dma_tag(dev), PAGE_SIZE, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
NULL, NULL, sizeof(struct patm_scd), 1,
sizeof(struct patm_scd), 0, NULL, NULL, &sc->scd_tag);
@@ -774,7 +774,8 @@ patm_sq_init(struct patm_softc *sc)
* Don't use BUS_DMA_ALLOCNOW, because we never need bouncing with
* bus_dmamem_alloc()
*/
- error = bus_dma_tag_create(NULL, PATM_SQ_ALIGNMENT, 0,
+ error = bus_dma_tag_create(bus_get_dma_tag(sc->dev),
+ PATM_SQ_ALIGNMENT, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
NULL, NULL, sc->sq_size, 1, sc->sq_size,
0, NULL, NULL, &sc->sq_tag);
@@ -827,7 +828,7 @@ patm_rbuf_init(struct patm_softc *sc)
* Don't use BUS_DMA_ALLOCNOW, because we never need bouncing with
* bus_dmamem_alloc()
*/
- if ((error = bus_dma_tag_create(NULL, PAGE_SIZE, 0,
+ if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), PAGE_SIZE, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
SMBUF_PAGE_SIZE, 1, SMBUF_PAGE_SIZE, 0,
NULL, NULL, &sc->sbuf_tag)) != 0) {
@@ -855,7 +856,7 @@ patm_rbuf_init(struct patm_softc *sc)
* maps using one tag. Rather use BUS_DMA_NOWAIT when loading the map
* to prevent EINPROGRESS.
*/
- if ((error = bus_dma_tag_create(NULL, 4, 0,
+ if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), 4, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
MCLBYTES, 1, MCLBYTES, 0,
NULL, NULL, &sc->lbuf_tag)) != 0) {
@@ -900,7 +901,7 @@ patm_txmap_init(struct patm_softc *sc)
struct patm_txmap *map;
/* get transmission tag */
- error = bus_dma_tag_create(NULL, 1, 0,
+ error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
NULL, NULL, 65536, IDT_SCQ_SIZE - 1, 65536,
0, NULL, NULL, &sc->tx_tag);
Modified: stable/9/sys/dev/safe/safe.c
==============================================================================
--- stable/9/sys/dev/safe/safe.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/safe/safe.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -287,7 +287,7 @@ safe_attach(device_t dev)
/*
* Setup DMA descriptor area.
*/
- if (bus_dma_tag_create(NULL, /* parent */
+ if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
1, /* alignment */
SAFE_DMA_BOUNDARY, /* boundary */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
@@ -302,7 +302,7 @@ safe_attach(device_t dev)
device_printf(dev, "cannot allocate DMA tag\n");
goto bad4;
}
- if (bus_dma_tag_create(NULL, /* parent */
+ if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
1, /* alignment */
SAFE_MAX_DSIZE, /* boundary */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
@@ -1802,7 +1802,7 @@ safe_dma_malloc(
{
int r;
- r = bus_dma_tag_create(NULL, /* parent */
+ r = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), /* parent */
sizeof(u_int32_t), 0, /* alignment, bounds */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/trm/trm.c
==============================================================================
--- stable/9/sys/dev/trm/trm.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/trm/trm.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -3415,6 +3415,22 @@ trm_init(u_int16_t unit, device_t dev)
pACB->tag = rman_get_bustag(pACB->iores);
pACB->bsh = rman_get_bushandle(pACB->iores);
if (bus_dma_tag_create(
+ /*parent_dmat*/ bus_get_dma_tag(dev),
+ /*alignment*/ 1,
+ /*boundary*/ 0,
+ /*lowaddr*/ BUS_SPACE_MAXADDR,
+ /*highaddr*/ BUS_SPACE_MAXADDR,
+ /*filter*/ NULL,
+ /*filterarg*/ NULL,
+ /*maxsize*/ BUS_SPACE_MAXSIZE_32BIT,
+ /*nsegments*/ BUS_SPACE_UNRESTRICTED,
+ /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT,
+ /*flags*/ 0,
+ /*lockfunc*/ NULL,
+ /*lockarg*/ NULL,
+ /* dmat */ &pACB->parent_dmat) != 0)
+ goto bad;
+ if (bus_dma_tag_create(
/*parent_dmat*/ pACB->parent_dmat,
/*alignment*/ 1,
/*boundary*/ 0,
@@ -3458,7 +3474,9 @@ trm_init(u_int16_t unit, device_t dev)
TRM_MAX_SRB_CNT * sizeof(TRM_SRB), trm_mapSRB, pACB,
/* flags */0);
/* Create, allocate, and map DMA buffers for autosense data */
- if (bus_dma_tag_create(/*parent_dmat*/NULL, /*alignment*/1,
+ if (bus_dma_tag_create(
+ /*parent_dmat*/pACB->parent_dmat,
+ /*alignment*/1,
/*boundary*/0,
/*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
/*highaddr*/BUS_SPACE_MAXADDR,
@@ -3495,7 +3513,7 @@ trm_init(u_int16_t unit, device_t dev)
}
bzero(pACB->pFreeSRB, TRM_MAX_SRB_CNT * sizeof(TRM_SRB));
if (bus_dma_tag_create(
- /*parent_dmat*/NULL,
+ /*parent_dmat*/pACB->parent_dmat,
/*alignment*/ 1,
/*boundary*/ 0,
/*lowaddr*/ BUS_SPACE_MAXADDR,
@@ -3546,6 +3564,8 @@ bad:
bus_dma_tag_destroy(pACB->srb_dmat);
if (pACB->buffer_dmat)
bus_dma_tag_destroy(pACB->buffer_dmat);
+ if (pACB->parent_dmat)
+ bus_dma_tag_destroy(pACB->parent_dmat);
return (NULL);
}
Modified: stable/9/sys/dev/twe/twe_freebsd.c
==============================================================================
--- stable/9/sys/dev/twe/twe_freebsd.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/twe/twe_freebsd.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -225,7 +225,7 @@ twe_attach(device_t dev)
/*
* Allocate the parent bus DMA tag appropriate for PCI.
*/
- if (bus_dma_tag_create(NULL, /* parent */
+ if (bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */
1, 0, /* alignment, boundary */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/tws/tws.c
==============================================================================
--- stable/9/sys/dev/tws/tws.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/tws/tws.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -521,7 +521,7 @@ tws_init(struct tws_softc *sc)
TWS_MAX_32BIT_SG_ELEMENTS;
dma_mem_size = (sizeof(struct tws_command_packet) * tws_queue_depth) +
(TWS_SECTOR_SIZE) ;
- if ( bus_dma_tag_create(NULL, /* parent */
+ if ( bus_dma_tag_create(bus_get_dma_tag(sc->tws_dev), /* PCI parent */
TWS_ALIGNMENT, /* alignment */
0, /* boundary */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
Modified: stable/9/sys/dev/ubsec/ubsec.c
==============================================================================
--- stable/9/sys/dev/ubsec/ubsec.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/ubsec/ubsec.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -368,7 +368,7 @@ ubsec_attach(device_t dev)
/*
* Setup DMA descriptor area.
*/
- if (bus_dma_tag_create(NULL, /* parent */
+ if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
1, 0, /* alignment, bounds */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
@@ -1854,7 +1854,7 @@ ubsec_dma_malloc(
int r;
/* XXX could specify sc_dmat as parent but that just adds overhead */
- r = bus_dma_tag_create(NULL, /* parent */
+ r = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), /* parent */
1, 0, /* alignment, bounds */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
Modified: stable/9/sys/dev/wds/wd7000.c
==============================================================================
--- stable/9/sys/dev/wds/wd7000.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/wds/wd7000.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -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: stable/9/sys/dev/xen/blkfront/blkfront.c
==============================================================================
--- stable/9/sys/dev/xen/blkfront/blkfront.c Fri Mar 16 05:05:37 2012 (r233023)
+++ stable/9/sys/dev/xen/blkfront/blkfront.c Fri Mar 16 08:46:58 2012 (r233024)
@@ -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-stable-9
mailing list