FreeBSD/sys/dev/mrsas/mrsas.c
/*
 * mrsas_flush_cache:         Requests FW to flush all its caches input:
 * Adapter soft state
 *
 * This function is issues a DCMD internal command to Firmware to initiate
 * flushing of all caches.
 */
Requests FW to flush all its caches input:
Adapter soft state

This function is issues a DCMD internal command to Firmware to initiate
flushing of all caches.
Requests FW to flush all its caches input : Adapter soft state This function is issues a DCMD internal command to Firmware to initiate flushing of all caches .
static void
mrsas_flush_cache(struct mrsas_softc *sc)
{
	struct mrsas_mfi_cmd *cmd;
	struct mrsas_dcmd_frame *dcmd;
	if (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR)
		return;
	cmd = mrsas_get_mfi_cmd(sc);
	if (!cmd) {
		device_printf(sc->mrsas_dev, "Cannot allocate for flush cache cmd.\n");
		return;
	}
	dcmd = &cmd->frame->dcmd;
	memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE);
	dcmd->cmd = MFI_CMD_DCMD;
	dcmd->cmd_status = 0x0;
	dcmd->sge_count = 0;
	dcmd->flags = MFI_FRAME_DIR_NONE;
	dcmd->timeout = 0;
	dcmd->pad_0 = 0;
	dcmd->data_xfer_len = 0;
	dcmd->opcode = MR_DCMD_CTRL_CACHE_FLUSH;
	dcmd->mbox.b[0] = MR_FLUSH_CTRL_CACHE | MR_FLUSH_DISK_CACHE;
	mrsas_issue_blocked_cmd(sc, cmd);
	mrsas_release_mfi_cmd(cmd);
	return;
}
static void mrsas_flush_cache ( struct mrsas_softc * sc ) { struct mrsas_mfi_cmd * cmd ; struct mrsas_dcmd_frame * dcmd ; if ( sc -> adprecovery == MRSAS_HW_CRITICAL_ERROR ) return ; cmd = mrsas_get_mfi_cmd ( sc ) ; if ( ! cmd ) { device_printf ( sc -> mrsas_dev , " \n " ) ; return ; } dcmd = & cmd -> frame -> dcmd ; memset ( dcmd -> mbox . b , 0 , MFI_MBOX_SIZE ) ; dcmd -> cmd = MFI_CMD_DCMD ; dcmd -> cmd_status = 0x0 ; dcmd -> sge_count = 0 ; dcmd -> flags = MFI_FRAME_DIR_NONE ; dcmd -> timeout = 0 ; dcmd -> pad_0 = 0 ; dcmd -> data_xfer_len = 0 ; dcmd -> opcode = MR_DCMD_CTRL_CACHE_FLUSH ; dcmd -> mbox . b [ 0 ] = MR_FLUSH_CTRL_CACHE | MR_FLUSH_DISK_CACHE ; mrsas_issue_blocked_cmd ( sc , cmd ) ; mrsas_release_mfi_cmd ( cmd ) ; return ; }
mrsas_flush_cache:         Requests FW to flush all its caches input:
 Adapter soft state
mrsas_flush_cache : Requests FW to flush all its caches input : Adapter soft state