FreeBSD/sys/dev/mrsas/mrsas.c
/*
 * mrsas_alloc_evt_log_info cmd: Allocates memory to get event log information.
 * Used to get sequence number at driver load time.
 * input:		Adapter soft state
 *
 * Allocates DMAable memory for the event log info internal command.
 */
mrsas_alloc_evt_log_info cmd: Allocates memory to get event log information.
Used to get sequence number at driver load time.
input:               Adapter soft state

Allocates DMAable memory for the event log info internal command.
mrsas_alloc_evt_log_info cmd : Allocates memory to get event log information . Used to get sequence number at driver load time . input : Adapter soft state Allocates DMAable memory for the event log info internal command .
int
mrsas_alloc_evt_log_info_cmd(struct mrsas_softc *sc)
{
	int el_info_size;
	el_info_size = sizeof(struct mrsas_evt_log_info);
	if (bus_dma_tag_create(sc->mrsas_parent_tag,
	    1, 0,
	    BUS_SPACE_MAXADDR_32BIT,
	    BUS_SPACE_MAXADDR,
	    NULL, NULL,
	    el_info_size,
	    1,
	    el_info_size,
	    BUS_DMA_ALLOCNOW,
	    NULL, NULL,
	    &sc->el_info_tag)) {
		device_printf(sc->mrsas_dev, "Cannot allocate event log info tag\n");
		return (ENOMEM);
	}
	if (bus_dmamem_alloc(sc->el_info_tag, (void **)&sc->el_info_mem,
	    BUS_DMA_NOWAIT, &sc->el_info_dmamap)) {
		device_printf(sc->mrsas_dev, "Cannot allocate event log info cmd mem\n");
		return (ENOMEM);
	}
	if (bus_dmamap_load(sc->el_info_tag, sc->el_info_dmamap,
	    sc->el_info_mem, el_info_size, mrsas_addr_cb,
	    &sc->el_info_phys_addr, BUS_DMA_NOWAIT)) {
		device_printf(sc->mrsas_dev, "Cannot load event log info cmd mem\n");
		return (ENOMEM);
	}
	memset(sc->el_info_mem, 0, el_info_size);
	return (0);
}
int mrsas_alloc_evt_log_info_cmd ( struct mrsas_softc * sc ) { int el_info_size ; el_info_size = sizeof ( struct mrsas_evt_log_info ) ; if ( bus_dma_tag_create ( sc -> mrsas_parent_tag , 1 , 0 , BUS_SPACE_MAXADDR_32BIT , BUS_SPACE_MAXADDR , NULL , NULL , el_info_size , 1 , el_info_size , BUS_DMA_ALLOCNOW , NULL , NULL , & sc -> el_info_tag ) ) { device_printf ( sc -> mrsas_dev , " \n " ) ; return ( ENOMEM ) ; } if ( bus_dmamem_alloc ( sc -> el_info_tag , ( void * * ) & sc -> el_info_mem , BUS_DMA_NOWAIT , & sc -> el_info_dmamap ) ) { device_printf ( sc -> mrsas_dev , " \n " ) ; return ( ENOMEM ) ; } if ( bus_dmamap_load ( sc -> el_info_tag , sc -> el_info_dmamap , sc -> el_info_mem , el_info_size , mrsas_addr_cb , & sc -> el_info_phys_addr , BUS_DMA_NOWAIT ) ) { device_printf ( sc -> mrsas_dev , " \n " ) ; return ( ENOMEM ) ; } memset ( sc -> el_info_mem , 0 , el_info_size ) ; return ( 0 ) ; }
mrsas_alloc_evt_log_info cmd: Allocates memory to get event log information.
mrsas_alloc_evt_log_info cmd : Allocates memory to get event log information .
/* Allocate get event log info command */