summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2012-03-12 08:03:51 +0000
committerscottl <scottl@FreeBSD.org>2012-03-12 08:03:51 +0000
commit32e16cef409bd0f9bd89f7ed3f8372af410308a0 (patch)
treedc5d4c305b98bef1388bcb9d1d8e32413a75f5af /sys
parentac2071063e8d399aef49037a97358e68d356f582 (diff)
downloadFreeBSD-src-32e16cef409bd0f9bd89f7ed3f8372af410308a0.zip
FreeBSD-src-32e16cef409bd0f9bd89f7ed3f8372af410308a0.tar.gz
Convert a number of drivers to obtaining their parent DMA tag from their
PCI device attachment.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/advansys/adv_pci.c2
-rw-r--r--sys/dev/advansys/adw_pci.c2
-rw-r--r--sys/dev/amr/amr_pci.c2
-rw-r--r--sys/dev/an/if_an_pci.c2
-rw-r--r--sys/dev/arcmsr/arcmsr.c2
-rw-r--r--sys/dev/asr/asr.c2
-rw-r--r--sys/dev/buslogic/bt_pci.c2
-rw-r--r--sys/dev/bxe/if_bxe.c3
-rw-r--r--sys/dev/ciss/ciss.c2
-rw-r--r--sys/dev/cxgb/cxgb_sge.c2
-rw-r--r--sys/dev/dpt/dpt_pci.c2
-rw-r--r--sys/dev/hifn/hifn7751.c2
-rw-r--r--sys/dev/hptiop/hptiop.c2
-rw-r--r--sys/dev/hptmv/entry.c2
-rw-r--r--sys/dev/ida/ida_pci.c2
-rw-r--r--sys/dev/if_ndis/if_ndis_pci.c2
-rw-r--r--sys/dev/iir/iir_pci.c3
-rw-r--r--sys/dev/ips/ips_pci.c2
-rw-r--r--sys/dev/mfi/mfi_pci.c2
-rw-r--r--sys/dev/mlx/mlx_pci.c2
-rw-r--r--sys/dev/mly/mly.c2
-rw-r--r--sys/dev/twe/twe_freebsd.c2
-rw-r--r--sys/dev/tws/tws.c2
23 files changed, 25 insertions, 23 deletions
diff --git a/sys/dev/advansys/adv_pci.c b/sys/dev/advansys/adv_pci.c
index 6a073ba..ef938e3 100644
--- a/sys/dev/advansys/adv_pci.c
+++ b/sys/dev/advansys/adv_pci.c
@@ -189,7 +189,7 @@ 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,
diff --git a/sys/dev/advansys/adw_pci.c b/sys/dev/advansys/adw_pci.c
index 8777a44..d9169cf 100644
--- a/sys/dev/advansys/adw_pci.c
+++ b/sys/dev/advansys/adw_pci.c
@@ -260,7 +260,7 @@ adw_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 */ ADW_PCI_MAX_DMA_ADDR,
diff --git a/sys/dev/amr/amr_pci.c b/sys/dev/amr/amr_pci.c
index 61b20e1..f47d408 100644
--- a/sys/dev/amr/amr_pci.c
+++ b/sys/dev/amr/amr_pci.c
@@ -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 :
diff --git a/sys/dev/an/if_an_pci.c b/sys/dev/an/if_an_pci.c
index 2d0d2b5..fe3467d 100644
--- a/sys/dev/an/if_an_pci.c
+++ b/sys/dev/an/if_an_pci.c
@@ -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 */
diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c
index ee2e538..a24809e 100644
--- a/sys/dev/arcmsr/arcmsr.c
+++ b/sys/dev/arcmsr/arcmsr.c
@@ -3486,7 +3486,7 @@ static u_int32_t arcmsr_initialize(device_t dev)
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,
diff --git a/sys/dev/asr/asr.c b/sys/dev/asr/asr.c
index 6034b6f..127ade2 100644
--- a/sys/dev/asr/asr.c
+++ b/sys/dev/asr/asr.c
@@ -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 */
diff --git a/sys/dev/buslogic/bt_pci.c b/sys/dev/buslogic/bt_pci.c
index de7cc9e..5994bec 100644
--- a/sys/dev/buslogic/bt_pci.c
+++ b/sys/dev/buslogic/bt_pci.c
@@ -173,7 +173,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,
diff --git a/sys/dev/bxe/if_bxe.c b/sys/dev/bxe/if_bxe.c
index 1c5398a..b60d6e2 100644
--- a/sys/dev/bxe/if_bxe.c
+++ b/sys/dev/bxe/if_bxe.c
@@ -13582,7 +13582,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 */
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c
index 37af516..3291f03 100644
--- a/sys/dev/ciss/ciss.c
+++ b/sys/dev/ciss/ciss.c
@@ -796,7 +796,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 */
diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c
index a34dab2..5450b7e 100644
--- a/sys/dev/cxgb/cxgb_sge.c
+++ b/sys/dev/cxgb/cxgb_sge.c
@@ -592,7 +592,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 */
diff --git a/sys/dev/dpt/dpt_pci.c b/sys/dev/dpt/dpt_pci.c
index df92565..2009dbd 100644
--- a/sys/dev/dpt/dpt_pci.c
+++ b/sys/dev/dpt/dpt_pci.c
@@ -133,7 +133,7 @@ dpt_pci_attach (device_t 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,
diff --git a/sys/dev/hifn/hifn7751.c b/sys/dev/hifn/hifn7751.c
index 7e3a65f..ecb1239 100644
--- a/sys/dev/hifn/hifn7751.c
+++ b/sys/dev/hifn/hifn7751.c
@@ -431,7 +431,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 */
diff --git a/sys/dev/hptiop/hptiop.c b/sys/dev/hptiop/hptiop.c
index 035cf07..188ab80 100644
--- a/sys/dev/hptiop/hptiop.c
+++ b/sys/dev/hptiop/hptiop.c
@@ -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 */
diff --git a/sys/dev/hptmv/entry.c b/sys/dev/hptmv/entry.c
index 4c61e65..f525b1f 100644
--- a/sys/dev/hptmv/entry.c
+++ b/sys/dev/hptmv/entry.c
@@ -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 */
diff --git a/sys/dev/ida/ida_pci.c b/sys/dev/ida/ida_pci.c
index e71c6d4..bb6088f 100644
--- a/sys/dev/ida/ida_pci.c
+++ b/sys/dev/ida/ida_pci.c
@@ -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,
diff --git a/sys/dev/if_ndis/if_ndis_pci.c b/sys/dev/if_ndis/if_ndis_pci.c
index 2b9ad1e..a71b5da 100644
--- a/sys/dev/if_ndis/if_ndis_pci.c
+++ b/sys/dev/if_ndis/if_ndis_pci.c
@@ -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 */
diff --git a/sys/dev/iir/iir_pci.c b/sys/dev/iir/iir_pci.c
index 19d09c6..662f06b 100644
--- a/sys/dev/iir/iir_pci.c
+++ b/sys/dev/iir/iir_pci.c
@@ -318,7 +318,8 @@ iir_pci_attach(device_t 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, /*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,
diff --git a/sys/dev/ips/ips_pci.c b/sys/dev/ips/ips_pci.c
index 9781087..d39f4ac 100644
--- a/sys/dev/ips/ips_pci.c
+++ b/sys/dev/ips/ips_pci.c
@@ -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,
diff --git a/sys/dev/mfi/mfi_pci.c b/sys/dev/mfi/mfi_pci.c
index 952ab1a..30db74b 100644
--- a/sys/dev/mfi/mfi_pci.c
+++ b/sys/dev/mfi/mfi_pci.c
@@ -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 */
diff --git a/sys/dev/mlx/mlx_pci.c b/sys/dev/mlx/mlx_pci.c
index 00d0fe2..92ad878 100644
--- a/sys/dev/mlx/mlx_pci.c
+++ b/sys/dev/mlx/mlx_pci.c
@@ -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 */
diff --git a/sys/dev/mly/mly.c b/sys/dev/mly/mly.c
index ee73ae9..826b89d 100644
--- a/sys/dev/mly/mly.c
+++ b/sys/dev/mly/mly.c
@@ -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 */
diff --git a/sys/dev/twe/twe_freebsd.c b/sys/dev/twe/twe_freebsd.c
index 29dab58..6c31d6a 100644
--- a/sys/dev/twe/twe_freebsd.c
+++ b/sys/dev/twe/twe_freebsd.c
@@ -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 */
diff --git a/sys/dev/tws/tws.c b/sys/dev/tws/tws.c
index ba3b150..b1615db 100644
--- a/sys/dev/tws/tws.c
+++ b/sys/dev/tws/tws.c
@@ -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 */
OpenPOWER on IntegriCloud