FreeBSD/sys/dev/mrsas/mrsas.c
/*
 * mrsas_get_mfi_cmd:	Get a cmd from free command pool
 * input:				Adapter soft state
 *
 * This function removes an MFI command from the command list.
 */
Get a cmd from free command pool
input:                               Adapter soft state

This function removes an MFI command from the command list.
Get a cmd from free command pool input : Adapter soft state This function removes an MFI command from the command list .
struct mrsas_mfi_cmd *
mrsas_get_mfi_cmd(struct mrsas_softc *sc)
{
	struct mrsas_mfi_cmd *cmd = NULL;
	mtx_lock(&sc->mfi_cmd_pool_lock);
	if (!TAILQ_EMPTY(&sc->mrsas_mfi_cmd_list_head)) {
		cmd = TAILQ_FIRST(&sc->mrsas_mfi_cmd_list_head);
		TAILQ_REMOVE(&sc->mrsas_mfi_cmd_list_head, cmd, next);
	}
	mtx_unlock(&sc->mfi_cmd_pool_lock);
	return cmd;
}
struct mrsas_mfi_cmd * mrsas_get_mfi_cmd ( struct mrsas_softc * sc ) { struct mrsas_mfi_cmd * cmd = NULL ; mtx_lock ( & sc -> mfi_cmd_pool_lock ) ; if ( ! TAILQ_EMPTY ( & sc -> mrsas_mfi_cmd_list_head ) ) { cmd = TAILQ_FIRST ( & sc -> mrsas_mfi_cmd_list_head ) ; TAILQ_REMOVE ( & sc -> mrsas_mfi_cmd_list_head , cmd , next ) ; } mtx_unlock ( & sc -> mfi_cmd_pool_lock ) ; return cmd ; }
mrsas_get_mfi_cmd:   Get a cmd from free command pool
 input:                               Adapter soft state
mrsas_get_mfi_cmd : Get a cmd from free command pool input : Adapter soft state