Reformat arguments bus_dma_tag_create().

This commit is contained in:
mdodd 2004-12-14 17:23:01 +00:00
parent 58a6bbdf3c
commit e49536d312
2 changed files with 45 additions and 21 deletions

View File

@ -207,25 +207,40 @@ ida_init(struct ida_softc *ida)
*/
/* DMA tag for our hardware QCB structures */
error = bus_dma_tag_create(ida->parent_dmat,
/*alignment*/1, /*boundary*/0,
/*lowaddr*/BUS_SPACE_MAXADDR, /*highaddr*/BUS_SPACE_MAXADDR,
/*filter*/NULL, /*filterarg*/NULL,
IDA_QCB_MAX * sizeof(struct ida_hardware_qcb),
/*nsegments*/1, /*maxsegsz*/BUS_SPACE_MAXSIZE_32BIT,
/*flags*/0, /*lockfunc*/busdma_lock_mutex, /*lockarg*/&Giant,
&ida->hwqcb_dmat);
error = bus_dma_tag_create(
/* parent */ ida->parent_dmat,
/* alignment */ 1,
/* boundary */ 0,
/* lowaddr */ BUS_SPACE_MAXADDR,
/* highaddr */ BUS_SPACE_MAXADDR,
/* filter */ NULL,
/* filterarg */ NULL,
/* maxsize */ IDA_QCB_MAX * sizeof(struct ida_hardware_qcb),
/* nsegments */ 1,
/* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT,
/* flags */ 0,
/* lockfunc */ busdma_lock_mutex,
/* lockarg */ &Giant,
&ida->hwqcb_dmat);
if (error)
return (ENOMEM);
/* DMA tag for mapping buffers into device space */
error = bus_dma_tag_create(ida->parent_dmat,
/*alignment*/1, /*boundary*/0,
/*lowaddr*/BUS_SPACE_MAXADDR, /*highaddr*/BUS_SPACE_MAXADDR,
/*filter*/NULL, /*filterarg*/NULL,
/*maxsize*/MAXBSIZE, /*nsegments*/IDA_NSEG,
/*maxsegsz*/BUS_SPACE_MAXSIZE_32BIT, /*flags*/0,
/*lockfunc*/busdma_lock_mutex, /*lockarg*/&Giant, &ida->buffer_dmat);
error = bus_dma_tag_create(
/* parent */ ida->parent_dmat,
/* alignment */ 1,
/* boundary */ 0,
/* lowaddr */ BUS_SPACE_MAXADDR,
/* highaddr */ BUS_SPACE_MAXADDR,
/* filter */ NULL,
/* filterarg */ NULL,
/* maxsize */ MAXBSIZE,
/* nsegments */ IDA_NSEG,
/* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT,
/* flags */ 0,
/* lockfunc */ busdma_lock_mutex,
/* lockarg */ &Giant,
&ida->buffer_dmat);
if (error)
return (ENOMEM);

View File

@ -264,12 +264,21 @@ ida_pci_attach(device_t dev)
return (ENOMEM);
}
error = bus_dma_tag_create(/*parent*/NULL, /*alignment*/1,
/*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
/*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL,
/*maxsize*/MAXBSIZE, /*nsegments*/IDA_NSEG,
/*maxsegsize*/BUS_SPACE_MAXSIZE_32BIT, /*flags*/BUS_DMA_ALLOCNOW,
/*lockfunc*/NULL, /*lockarg*/NULL, &ida->parent_dmat);
error = bus_dma_tag_create(
/* parent */ NULL,
/* alignment */ 1,
/* boundary */ 0,
/* lowaddr */ BUS_SPACE_MAXADDR_32BIT,
/* highaddr */ BUS_SPACE_MAXADDR,
/* filter */ NULL,
/* filterarg */ NULL,
/* maxsize */ MAXBSIZE,
/* nsegments */ IDA_NSEG,
/* maxsegsize */ BUS_SPACE_MAXSIZE_32BIT,
/* flags */ BUS_DMA_ALLOCNOW,
/* lockfunc */ NULL,
/* lockarg */ NULL,
&ida->parent_dmat);
if (error != 0) {
device_printf(dev, "can't allocate DMA tag\n");
ida_free(ida);