FreeBSD/sys/dev/isp/isp.c
/*
 * Re-initialize the ISP and complete all orphaned commands
 * with a 'botched' notice. The reset/init routines should
 * not disturb an already active list of commands.
 */
Re-initialize the ISP and complete all orphaned commands
with a 'botched' notice. The reset/init routines should
not disturb an already active list of commands.
Re - initialize the ISP and complete all orphaned commands with a ' botched ' notice . The reset / init routines should not disturb an already active list of commands .
int
isp_reinit(ispsoftc_t *isp, int do_load_defaults)
{
	int i, res = 0;
	if (isp->isp_state == ISP_RUNSTATE)
		isp_deinit(isp);
	if (isp->isp_state != ISP_RESETSTATE)
		isp_reset(isp, do_load_defaults);
	if (isp->isp_state != ISP_RESETSTATE) {
		res = EIO;
		isp_prt(isp, ISP_LOGERR, "%s: cannot reset card", __func__);
		ISP_DISABLE_INTS(isp);
		goto cleanup;
	}
	isp_init(isp);
	if (isp->isp_state > ISP_RESETSTATE &&
	    isp->isp_state != ISP_RUNSTATE) {
		res = EIO;
		isp_prt(isp, ISP_LOGERR, "%s: cannot init card", __func__);
		ISP_DISABLE_INTS(isp);
		if (IS_FC(isp)) {
			if (!IS_24XX(isp)) {
				ISP_WRITE(isp, BIU2100_CSR, BIU2100_FPM0_REGS);
				ISP_WRITE(isp, FPM_DIAG_CONFIG, FPM_SOFT_RESET);
				ISP_WRITE(isp, BIU2100_CSR, BIU2100_FB_REGS);
				ISP_WRITE(isp, FBM_CMD, FBMCMD_FIFO_RESET_ALL);
				ISP_WRITE(isp, BIU2100_CSR, BIU2100_RISC_REGS);
			}
		}
	}
cleanup:
	isp->isp_nactive = 0;
	isp_clear_commands(isp);
	if (IS_FC(isp)) {
		for (i = 0; i < isp->isp_nchan; i++)
			isp_clear_portdb(isp, i);
	}
	return (res);
}
int isp_reinit ( ispsoftc_t * isp , int do_load_defaults ) { int i , res = 0 ; if ( isp -> isp_state == ISP_RUNSTATE ) isp_deinit ( isp ) ; if ( isp -> isp_state != ISP_RESETSTATE ) isp_reset ( isp , do_load_defaults ) ; if ( isp -> isp_state != ISP_RESETSTATE ) { res = EIO ; isp_prt ( isp , ISP_LOGERR , " " , __func__ ) ; ISP_DISABLE_INTS ( isp ) ; goto cleanup ; } isp_init ( isp ) ; if ( isp -> isp_state > ISP_RESETSTATE && isp -> isp_state != ISP_RUNSTATE ) { res = EIO ; isp_prt ( isp , ISP_LOGERR , " " , __func__ ) ; ISP_DISABLE_INTS ( isp ) ; if ( IS_FC ( isp ) ) { if ( ! IS_24XX ( isp ) ) { ISP_WRITE ( isp , BIU2100_CSR , BIU2100_FPM0_REGS ) ; ISP_WRITE ( isp , FPM_DIAG_CONFIG , FPM_SOFT_RESET ) ; ISP_WRITE ( isp , BIU2100_CSR , BIU2100_FB_REGS ) ; ISP_WRITE ( isp , FBM_CMD , FBMCMD_FIFO_RESET_ALL ) ; ISP_WRITE ( isp , BIU2100_CSR , BIU2100_RISC_REGS ) ; } } } cleanup : isp -> isp_nactive = 0 ; isp_clear_commands ( isp ) ; if ( IS_FC ( isp ) ) { for ( i = 0 ; i < isp -> isp_nchan ; i ++ ) isp_clear_portdb ( isp , i ) ; } return ( res ) ; }
Re-initialize the ISP and complete all orphaned commands
 with a 'botched' notice.
Re - initialize the ISP and complete all orphaned commands with a ' botched ' notice .
/*
			 * If we're in ISP_ROLE_NONE, turn off the lasers.
			 */