FreeBSD/sys/dev/mrsas/mrsas_ioctl.c
/*
 * mrsas_alloc_frame:	Allocates MFI Frames
 * input:				Adapter soft state
 *
 * Create bus DMA memory tag and dmamap and load memory for MFI frames. Returns
 * virtual memory pointer to allocated region.
 */
Allocates MFI Frames
input:                               Adapter soft state

Create bus DMA memory tag and dmamap and load memory for MFI frames. Returns
virtual memory pointer to allocated region.
Allocates MFI Frames input : Adapter soft state Create bus DMA memory tag and dmamap and load memory for MFI frames . Returns virtual memory pointer to allocated region .
void   *
mrsas_alloc_frame(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd)
{
	u_int32_t frame_size = MRSAS_MFI_FRAME_SIZE;
	if (bus_dmamem_alloc(sc->mficmd_frame_tag, (void **)&cmd->frame_mem,
	    BUS_DMA_NOWAIT, &cmd->frame_dmamap)) {
		device_printf(sc->mrsas_dev, "Cannot alloc MFI frame memory\n");
		return (NULL);
	}
	if (bus_dmamap_load(sc->mficmd_frame_tag, cmd->frame_dmamap,
	    cmd->frame_mem, frame_size, mrsas_alloc_cb,
	    &cmd->frame_phys_addr, BUS_DMA_NOWAIT)) {
		device_printf(sc->mrsas_dev, "Cannot load IO request memory\n");
		return (NULL);
	}
	return (cmd->frame_mem);
}
void * mrsas_alloc_frame ( struct mrsas_softc * sc , struct mrsas_mfi_cmd * cmd ) { u_int32_t frame_size = MRSAS_MFI_FRAME_SIZE ; if ( bus_dmamem_alloc ( sc -> mficmd_frame_tag , ( void * * ) & cmd -> frame_mem , BUS_DMA_NOWAIT , & cmd -> frame_dmamap ) ) { device_printf ( sc -> mrsas_dev , " \n " ) ; return ( NULL ) ; } if ( bus_dmamap_load ( sc -> mficmd_frame_tag , cmd -> frame_dmamap , cmd -> frame_mem , frame_size , mrsas_alloc_cb , & cmd -> frame_phys_addr , BUS_DMA_NOWAIT ) ) { device_printf ( sc -> mrsas_dev , " \n " ) ; return ( NULL ) ; } return ( cmd -> frame_mem ) ; }
mrsas_alloc_frame:   Allocates MFI Frames
 input:                               Adapter soft state
mrsas_alloc_frame : Allocates MFI Frames input : Adapter soft state