FreeBSD/sys/dev/mrsas/mrsas.c
/*
 * mrsas_shutdown_ctlr:       Instructs FW to shutdown the controller input:
 * Adapter soft state Shutdown/Hibernate
 *
 * This function issues a DCMD internal command to Firmware to initiate shutdown
 * of the controller.
 */
Instructs FW to shutdown the controller input:
Adapter soft state Shutdown/Hibernate

This function issues a DCMD internal command to Firmware to initiate shutdown
of the controller.
Instructs FW to shutdown the controller input : Adapter soft state Shutdown / Hibernate This function issues a DCMD internal command to Firmware to initiate shutdown of the controller .
static void
mrsas_shutdown_ctlr(struct mrsas_softc *sc, u_int32_t opcode)
{
	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 shutdown cmd.\n");
		return;
	}
	if (sc->aen_cmd)
		mrsas_issue_blocked_abort_cmd(sc, sc->aen_cmd);
	if (sc->map_update_cmd)
		mrsas_issue_blocked_abort_cmd(sc, sc->map_update_cmd);
	if (sc->jbod_seq_cmd)
		mrsas_issue_blocked_abort_cmd(sc, sc->jbod_seq_cmd);
	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 = opcode;
	device_printf(sc->mrsas_dev, "Preparing to shut down controller.\n");
	mrsas_issue_blocked_cmd(sc, cmd);
	mrsas_release_mfi_cmd(cmd);
	return;
}
static void mrsas_shutdown_ctlr ( struct mrsas_softc * sc , u_int32_t opcode ) { 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 ; } if ( sc -> aen_cmd ) mrsas_issue_blocked_abort_cmd ( sc , sc -> aen_cmd ) ; if ( sc -> map_update_cmd ) mrsas_issue_blocked_abort_cmd ( sc , sc -> map_update_cmd ) ; if ( sc -> jbod_seq_cmd ) mrsas_issue_blocked_abort_cmd ( sc , sc -> jbod_seq_cmd ) ; 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 = opcode ; device_printf ( sc -> mrsas_dev , " \n " ) ; mrsas_issue_blocked_cmd ( sc , cmd ) ; mrsas_release_mfi_cmd ( cmd ) ; return ; }
mrsas_shutdown_ctlr:       Instructs FW to shutdown the controller input:
 Adapter soft state Shutdown/Hibernate
mrsas_shutdown_ctlr : Instructs FW to shutdown the controller input : Adapter soft state Shutdown / Hibernate