@echo off
rem ************************************************************************************
rem * Description: 	Detects if there is Qlogic Fibre controller present
rem * Name: 		DTCTQLOG.BAT
rem * Dependencies:	HWDETECT.EXE, SETERRLV.EXE, SAVERC.BAT, TKOUT.BAT
rem * Parameters: 	None
rem * Return Code:
rem * 			0   = supported FIBRE controller is found 
rem * 			1   = supported FIBRE controller not found
rem ************************************************************************************

rem ************************************************************************************
rem *** Initialize Return Code
rem ************************************************************************************
set RC=0


rem *** QLA2200
hwdetect /vid:1077 /did:2200
if errorlevel 1 goto QLA2200

rem *** QLA2300
hwdetect /vid:1077 /did:2300
if errorlevel 1 goto QLA2300

rem *** QLA2312
hwdetect /vid:1077 /did:2312
if errorlevel 1 goto QLA2312

rem *** QLA2322
hwdetect /vid:1077 /did:2322
if errorlevel 1 goto QLA2322

rem *** QLA2422
hwdetect /vid:1077 /did:2422
if errorlevel 1 goto QLA2422

rem *** QLA2432
hwdetect /vid:1077 /did:2432
if errorlevel 1 goto QLA2432

:NOFIBRE
set MSG="Qlogic Fibre adapters not detected."
call TKOUT.BAT
SET RC=1
goto END

:QLA2200
echo 
set MSG="Detected Fibre Adapter QLA2200"
call TKOUT.BAT
goto FIBRE
:QLA2300
echo 
set MSG="Detected Fibre Adapter QLA2300"
call TKOUT.BAT
goto FIBRE
:QLA2312
set MSG="Detected Fibre Adapter QLA2312/QLA2340"
call TKOUT.BAT
goto FIBRE
:QLA2322
set MSG="Detected Fibre Adapter QLA2322"
call TKOUT.BAT
goto FIBRE
:QLA2422
set MSG="Detected Fibre Adapter QLA2422"
call TKOUT.BAT
goto FIBRE
:QLA2432
set MSG="Detected Fibre Adapter QLA2432"
call TKOUT.BAT
goto FIBRE

:FIBRE
set MSG="Qlogic Fibre adapters detected."
call TKOUT.BAT
SET RC=0
goto END

:END
SET MSG=
SETERRLV %RC%
