@echo off
rem ********************************************************************************
rem * Description: 	Detects if there is a RAID controller supported by pRAID.
rem * Name: 		DTCTRAID.BAT
rem * Dependencies:	HWDETECT.EXE, SETERRLV.EXE, SAVERC.BAT, TKOUT.BAT
rem * Parameters: 	None
rem * Return Code:
rem * 			0   = supported RAID controller is found 
rem * 			1   = supported RAID controller not found
rem ********************************************************************************

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

rem *** ServeRAID 4H
hwdetect /vid:1014 /did:002E
if errorlevel 1 goto 4H

rem *** ServeRAID 4Lx/4Mx/4M/4L/5i
hwdetect /vid:1014 /did:01BD
if errorlevel 1 goto 4Lx

rem *** ServeRAID 6M/6i/7k
hwdetect /vid:9005 /did:0250
if errorlevel 1 goto 6M

rem *** ServeRAID 7t
hwdetect /vid:9005 /did:0285 /svid:9005 /sdid:0290
if errorlevel 1 goto 7t

rem *** ServeRAID 8i
hwdetect /vid:9005 /did:0285 /svid:1014 /sdid:02F2
if errorlevel 1 goto 8i

rem *** ServeRAID 8s
hwdetect /vid:9005 /did:0285 /svid:1014 /sdid:034D
if errorlevel 1 goto 8s

rem *** ServeRAID 8k/8k-l
hwdetect /vid:9005 /did:0286
if errorlevel 1 goto 8k

rem *** ServeRAID 7E SATA
hwdetect /vid:8086 /did:25B0
if errorlevel 1 goto 7ESATA

rem *** ServeRAID 7E SATA
hwdetect /vid:8086 /did:24DF
if errorlevel 1 goto 7ESATA

rem *** ServeRAID 7E SCSI
hwdetect /vid:9005 /did:808F
if errorlevel 1 goto 7ESCSI

rem *** ServeRAID 7E SCSI
hwdetect /vid:9005 /did:809D
if errorlevel 1 goto 7ESCSI

rem *** ServeRAID 8E SAS
hwdetect /vid:9005 /did:043F
if errorlevel 1 goto 8ESAS

rem *** ServeRAID 8E SATA
hwdetect /vid:8086 /did:27C3
if errorlevel 1 goto 8ESATA

rem *** ServeRAID 8E SATA
hwdetect /vid:8086 /did:2682
if errorlevel 1 goto 8ESATA

rem *** LSI-SCSI-RAID
hwdetect /vid:1000 /did:0030
if errorlevel 1 goto LSISCSI

rem *** LSI-SAS-RAID-1064
hwdetect /vid:1000 /did:0050
if errorlevel 1 goto LSISAS

rem *** LSI-SAS-RAID-1064E
hwdetect /vid:1000 /did:0056
if errorlevel 1 goto LSISAS

rem *** LSI-SAS-RAID-1064A
hwdetect /vid:1000 /did:005C
if errorlevel 1 goto LSISAS

rem *** LSI-SAS-RAID-1068
hwdetect /vid:1000 /did:0054
if errorlevel 1 goto LSISAS

rem *** LSI-SAS-RAID-1068E
hwdetect /vid:1000 /did:0058
if errorlevel 1 goto LSISAS

rem *** LSI-MegaRAID-8480
hwdetect /vid:1000 /did:0411
if errorlevel 1 goto MEGARAID

rem *** LSI-IDEal-RAID
hwdetect /vid:1166 /did:0213
if errorlevel 1 goto IDERAID

rem *** LSI-SAS-1078-IR
hwdetect /vid:1000 /did:0062
if errorlevel 1 goto LSISASIR

rem *** ServeRAID-MR10i
hwdetect /vid:1000 /did:0060 /svid:1014 /sdid:0364
if errorlevel 1 goto 10i

rem *** ServeRAID-MR10k
hwdetect /vid:1000 /did:0060 /svid:1014 /sdid:0363
if errorlevel 1 goto 10k

rem *** ServeRAID-MR10M
hwdetect /vid:1000 /did:0060 /svid:1014 /sdid:0379
if errorlevel 1 goto 10M


:NORAID
set MSG="RAID adapters not detected."
call TKOUT.BAT
SET RC=1
goto END


:4H
set MSG="Detected RAID adapter ServeRAID-4H."
call TKOUT.BAT
goto RAID
:4Lx
set MSG="Detected RAID adapter ServeRAID-4Lx/4Mx/4M/4L/5i."
call TKOUT.BAT
goto RAID
:6M
set MSG="Detected RAID adapter ServeRAID-6M/6i/7k."
call TKOUT.BAT
goto RAID
:7t
set MSG="Detected RAID adapter ServeRAID-7t."
call TKOUT.BAT
goto RAID
:8i
set MSG="Detected RAID adapter ServeRAID-8i."
call TKOUT.BAT
goto RAID
:8s
set MSG="Detected RAID adapter ServeRAID-8s."
call TKOUT.BAT
goto RAID
:8k
set MSG="Detected RAID adapter ServeRAID-8k/8k-l."
call TKOUT.BAT
goto RAID
:7ESATA
set MSG="Detected RAID adapter ServeRAID-7e-SATA."
call TKOUT.BAT
goto RAID
:7ESCSI
set MSG="Detected RAID adapter ServeRAID-7e-SCSI."
call TKOUT.BAT
goto RAID
:8ESAS
set MSG="Detected RAID adapter ServeRAID-8e-SAS."
call TKOUT.BAT
goto RAID
:8ESATA
set MSG="Detected RAID adapter ServeRAID-8e-SATA."
call TKOUT.BAT
goto RAID
:LSISCSI
set MSG="Detected RAID adapter LSI-SCSI-RAID"
call TKOUT.BAT
goto RAID
:LSISAS
set MSG="Detected RAID adapter LSI-SAS-RAID"
call TKOUT.BAT
goto RAID
:MEGARAID
set MSG="Detected RAID adapter LSI-MegaRAID"
call TKOUT.BAT
goto RAID
:IDERAID
set MSG="Detected RAID adapter LSI-IDEal-RAID"
call TKOUT.BAT
goto RAID
:LSISASIR
set MSG="Detected RAID adapter LSI-SAS-1078-IR"
call TKOUT.BAT
goto RAID
:10i
set MSG="Detected RAID adapter ServeRAID-MR10i"
call TKOUT.BAT
goto RAID
:10k
set MSG="Detected RAID adapter ServeRAID-MR10k"
call TKOUT.BAT
goto RAID
:10M
set MSG="Detected RAID adapter ServeRAID-MR10M"
call TKOUT.BAT
goto RAID

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

:END
SET MSG=
SETERRLV %RC%



