From 4f933468718174f76242d2eedcbb628a4ab83ca8 Mon Sep 17 00:00:00 2001 From: Hidetoshi Shimokawa Date: Fri, 4 Jul 2003 14:04:41 +0000 Subject: [PATCH] Add compatibility for FreeBSD-4. --- sys/dev/firewire/fwdma.c | 11 +++++++++-- sys/dev/firewire/fwohci.c | 5 ++++- sys/dev/firewire/fwohci_pci.c | 5 ++++- sys/dev/firewire/sbp.c | 5 ++++- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/sys/dev/firewire/fwdma.c b/sys/dev/firewire/fwdma.c index a16d233c4dd3..e8c6cceb75dc 100644 --- a/sys/dev/firewire/fwdma.c +++ b/sys/dev/firewire/fwdma.c @@ -77,7 +77,11 @@ fwdma_malloc(struct firewire_comm *fc, int alignment, bus_size_t size, /*nsegments*/ 1, /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, /*flags*/ BUS_DMA_ALLOCNOW, - /*lockfunc*/busdma_lock_mutex,/*lockarg*/&Giant, &dma->dma_tag); +#if __FreeBSD_version >= 501102 + /*lockfunc*/busdma_lock_mutex, + /*lockarg*/&Giant, +#endif + &dma->dma_tag); if (err) { printf("fwdma_malloc: failed(1)\n"); return(NULL); @@ -171,8 +175,11 @@ fwdma_malloc_multiseg(struct firewire_comm *fc, int alignment, /*nsegments*/ 1, /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, /*flags*/ BUS_DMA_ALLOCNOW, +#if __FreeBSD_version >= 501102 /*lockfunc*/busdma_lock_mutex, - /*lockarg*/&Giant, &am->dma_tag)) { + /*lockarg*/&Giant, +#endif + &am->dma_tag)) { printf("fwdma_malloc_multiseg: tag_create failed\n"); free(am, M_FW); return(NULL); diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c index 58f924e92da3..986d1a3d0187 100644 --- a/sys/dev/firewire/fwohci.c +++ b/sys/dev/firewire/fwohci.c @@ -1188,8 +1188,11 @@ fwohci_db_init(struct fwohci_softc *sc, struct fwohci_dbch *dbch) /*nsegments*/ dbch->ndesc > 3 ? dbch->ndesc - 2 : 1, /*maxsegsz*/ MAX_REQCOUNT, /*flags*/ 0, +#if __FreeBSD_version >= 501102 /*lockfunc*/busdma_lock_mutex, - /*lockarg*/&Giant, &dbch->dmat)) + /*lockarg*/&Giant, +#endif + &dbch->dmat)) return; /* allocate DB entries and attach one to each DMA channels */ diff --git a/sys/dev/firewire/fwohci_pci.c b/sys/dev/firewire/fwohci_pci.c index 41662397a17c..96cc01c56635 100644 --- a/sys/dev/firewire/fwohci_pci.c +++ b/sys/dev/firewire/fwohci_pci.c @@ -301,8 +301,11 @@ fwohci_pci_attach(device_t self) /*nsegments*/0x20, /*maxsegsz*/0x8000, /*flags*/BUS_DMA_ALLOCNOW, +#if __FreeBSD_version >= 501102 /*lockfunc*/busdma_lock_mutex, - /*lockarg*/&Giant, &sc->fc.dmat); + /*lockarg*/&Giant, +#endif + &sc->fc.dmat); if (err != 0) { printf("fwohci_pci_attach: Could not allocate DMA tag " "- error %d\n", err); diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c index 6f1b11118bdd..e97a9082bae8 100644 --- a/sys/dev/firewire/sbp.c +++ b/sys/dev/firewire/sbp.c @@ -1830,8 +1830,11 @@ END_DEBUG /*maxsize*/0x100000, /*nsegments*/SBP_IND_MAX, /*maxsegsz*/SBP_SEG_MAX, /*flags*/BUS_DMA_ALLOCNOW, +#if __FreeBSD_version >= 501102 /*lockfunc*/busdma_lock_mutex, - /*lockarg*/&Giant, &sbp->dmat); + /*lockarg*/&Giant, +#endif + &sbp->dmat); if (error != 0) { printf("sbp_attach: Could not allocate DMA tag " "- error %d\n", error);