FreeBSD/sys/dev/ips/ips_commands.c
/* Below is a pair of functions for making sure data is safely
 * on disk by flushing the adapter's cache. */
Below is a pair of functions for making sure data is safely
on disk by flushing the adapter's cache.
Below is a pair of functions for making sure data is safely on disk by flushing the adapter ' s cache .
static int ips_send_flush_cache_cmd(ips_command_t *command)
{
	ips_softc_t *sc = command->sc;
	ips_generic_cmd *command_struct;
	PRINTF(10,"ips test: got a command, building flush command\n");
	command->callback = ips_wakeup_callback;
	command_struct = (ips_generic_cmd *)command->command_buffer;
	command_struct->command = IPS_CACHE_FLUSH_CMD;
	command_struct->id = command->id;
	bus_dmamap_sync(sc->command_dmatag, command->command_dmamap, 
			BUS_DMASYNC_PREWRITE);
	sc->ips_issue_cmd(command);
	if (COMMAND_ERROR(command) == 0)
		sema_wait(&sc->cmd_sema);
	ips_insert_free_cmd(sc, command);
	return 0;
}
static int ips_send_flush_cache_cmd ( ips_command_t * command ) { ips_softc_t * sc = command -> sc ; ips_generic_cmd * command_struct ; PRINTF ( 10 , " \n " ) ; command -> callback = ips_wakeup_callback ; command_struct = ( ips_generic_cmd * ) command -> command_buffer ; command_struct -> command = IPS_CACHE_FLUSH_CMD ; command_struct -> id = command -> id ; bus_dmamap_sync ( sc -> command_dmatag , command -> command_dmamap , BUS_DMASYNC_PREWRITE ) ; sc -> ips_issue_cmd ( command ) ; if ( COMMAND_ERROR ( command ) == 0 ) sema_wait ( & sc -> cmd_sema ) ; ips_insert_free_cmd ( sc , command ) ; return 0 ; }
Below is a pair of functions for making sure data is safely
 on disk by flushing the adapter's cache.
Below is a pair of functions for making sure data is safely on disk by flushing the adapter ' s cache .