FreeBSD/sys/dev/mrsas/mrsas.c
/*
 * mrsas_alloc_ioc_cmd:	Allocates memory for IOC Init command
 * input:				Adapter soft state
 *
 * Allocates for the IOC Init cmd to FW to initialize the ROC/controller.
 */
Allocates memory for IOC Init command
input:                               Adapter soft state

Allocates for the IOC Init cmd to FW to initialize the ROC/controller.
Allocates memory for IOC Init command input : Adapter soft state Allocates for the IOC Init cmd to FW to initialize the ROC / controller .
int
mrsas_alloc_ioc_cmd(struct mrsas_softc *sc)
{
	int ioc_init_size;
	ioc_init_size = 1024 + sizeof(MPI2_IOC_INIT_REQUEST);
	if (bus_dma_tag_create(sc->mrsas_parent_tag,
	    1, 0,
	    BUS_SPACE_MAXADDR_32BIT,
	    BUS_SPACE_MAXADDR,
	    NULL, NULL,
	    ioc_init_size,
	    1,
	    ioc_init_size,
	    BUS_DMA_ALLOCNOW,
	    NULL, NULL,
	    &sc->ioc_init_tag)) {
		device_printf(sc->mrsas_dev, "Cannot allocate ioc init tag\n");
		return (ENOMEM);
	}
	if (bus_dmamem_alloc(sc->ioc_init_tag, (void **)&sc->ioc_init_mem,
	    BUS_DMA_NOWAIT, &sc->ioc_init_dmamap)) {
		device_printf(sc->mrsas_dev, "Cannot allocate ioc init cmd mem\n");
		return (ENOMEM);
	}
	bzero(sc->ioc_init_mem, ioc_init_size);
	if (bus_dmamap_load(sc->ioc_init_tag, sc->ioc_init_dmamap,
	    sc->ioc_init_mem, ioc_init_size, mrsas_addr_cb,
	    &sc->ioc_init_phys_mem, BUS_DMA_NOWAIT)) {
		device_printf(sc->mrsas_dev, "Cannot load ioc init cmd mem\n");
		return (ENOMEM);
	}
	return (0);
}
int mrsas_alloc_ioc_cmd ( struct mrsas_softc * sc ) { int ioc_init_size ; ioc_init_size = 1024 + sizeof ( MPI2_IOC_INIT_REQUEST ) ; if ( bus_dma_tag_create ( sc -> mrsas_parent_tag , 1 , 0 , BUS_SPACE_MAXADDR_32BIT , BUS_SPACE_MAXADDR , NULL , NULL , ioc_init_size , 1 , ioc_init_size , BUS_DMA_ALLOCNOW , NULL , NULL , & sc -> ioc_init_tag ) ) { device_printf ( sc -> mrsas_dev , " \n " ) ; return ( ENOMEM ) ; } if ( bus_dmamem_alloc ( sc -> ioc_init_tag , ( void * * ) & sc -> ioc_init_mem , BUS_DMA_NOWAIT , & sc -> ioc_init_dmamap ) ) { device_printf ( sc -> mrsas_dev , " \n " ) ; return ( ENOMEM ) ; } bzero ( sc -> ioc_init_mem , ioc_init_size ) ; if ( bus_dmamap_load ( sc -> ioc_init_tag , sc -> ioc_init_dmamap , sc -> ioc_init_mem , ioc_init_size , mrsas_addr_cb , & sc -> ioc_init_phys_mem , BUS_DMA_NOWAIT ) ) { device_printf ( sc -> mrsas_dev , " \n " ) ; return ( ENOMEM ) ; } return ( 0 ) ; }
mrsas_alloc_ioc_cmd: Allocates memory for IOC Init command
 input:                               Adapter soft state
mrsas_alloc_ioc_cmd : Allocates memory for IOC Init command input : Adapter soft state
/* Allocate IOC INIT command */