;************************************************************************************
;                           - oemsetup.inf - 
;		This is the INF file for Windows Vista and above only 
;			Areca RAID Host Adapters
;
;		*********************************************************************
;		*                                                                   *
;		*  Copyright 2012 Areca, Inc. All rights reserved.                  *
;		*                                                                   *
;		*  This file is property of Areca, Inc. and is licensed for         *
;		*  use as is.  The receipt of or possession of this file does not   *
;		*  convey any rights to modify its contents, in whole, or in part,  *
;		*  without the specific written consent of Areca, Inc.              *
;		*                                                                   *
;		*********************************************************************
;************************************************************************************

[Version]
Signature="$Windows NT$"
Class=SCSIAdapter
ClassGUID={4D36E97B-E325-11CE-BFC1-08002BE10318}
Provider=%ARECA%
DriverVer = 10/21/2020,18.56.51.904
CatalogFile=arcmsr.cat

[DestinationDirs]
DefaultDestDir = 12           ; DIRID_DRIVERS

[SourceDisksFiles]
arcmsr.sys = 1

[SourceDisksNames]
1 = %ArcMSR.Source.Disk.Name%,,,

[Manufacturer]
%ARECA%=ARECA,NTamd64

[ARECA.NTamd64]
%ArcMSR.Sata.Nr6.DevDesc% =    ArcMSR_Inst, PCI\VEN_17D3&DEV_1110
%ArcMSR.Sata.Yr6.DevDesc% =    ArcMSR_Inst, PCI\VEN_17D3&DEV_1120
%ArcMSR.Sata.Yr6.DevDesc% =    ArcMSR_Inst, PCI\VEN_17D3&DEV_1130
%ArcMSR.Sata.Yr6.DevDesc% =    ArcMSR_Inst, PCI\VEN_17D3&DEV_1160
%ArcMSR.Sata.Yr6.DevDesc% =    ArcMSR_Inst, PCI\VEN_17D3&DEV_1170
%ArcMSR.Sata.Nr6.DevDesc% = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1210
%ArcMSR.Sata.Yr6.DevDesc% = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1220
%ArcMSR.Sata.Yr6.DevDesc% = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1230
%ArcMSR.Sata.Yr6.DevDesc% = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1260
%ArcMSR.Sata.Yr6.DevDesc% = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1270
%ArcMSR.Sata.Yr6.DevDesc% = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1280
%ArcMSR.Sas.Yr6.DevDesc%  = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1380
%ArcMSR.Sas.Yr6.DevDesc%  = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1381
%ArcMSR.Sas.Yr6.DevDesc%  = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1680
%ArcMSR.Sas.Yr6.DevDesc%  = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1681
%ArcMSR.Sata.Nr6.DevDesc% = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1201
%ArcMSR.Sata.Nr6.DevDesc% = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1203
%ArcMSR.Sas.Yr6.DevDesc%  = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1880
%ArcMSR.Sas.Yr6.DevDesc%  = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1884
%ArcMSR.Sas.Yr6.DevDesc%  = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1889
%ArcMSR.Sas.Yr6.DevDesc%  = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_188A
%ArcMSR.Sata.Yr6.DevDesc% = ArcMSR_MsiInst, PCI\VEN_17D3&DEV_1214

[ControlFlags]
ExcludeFromSelect = PCI\VEN_17D3&DEV_1110
ExcludeFromSelect = PCI\VEN_17D3&DEV_1120
ExcludeFromSelect = PCI\VEN_17D3&DEV_1130
ExcludeFromSelect = PCI\VEN_17D3&DEV_1160
ExcludeFromSelect = PCI\VEN_17D3&DEV_1170
ExcludeFromSelect = PCI\VEN_17D3&DEV_1210
ExcludeFromSelect = PCI\VEN_17D3&DEV_1220
ExcludeFromSelect = PCI\VEN_17D3&DEV_1230
ExcludeFromSelect = PCI\VEN_17D3&DEV_1260
ExcludeFromSelect = PCI\VEN_17D3&DEV_1270
ExcludeFromSelect = PCI\VEN_17D3&DEV_1280
ExcludeFromSelect = PCI\VEN_17D3&DEV_1380
ExcludeFromSelect = PCI\VEN_17D3&DEV_1381
ExcludeFromSelect = PCI\VEN_17D3&DEV_1680
ExcludeFromSelect = PCI\VEN_17D3&DEV_1681
ExcludeFromSelect = PCI\VEN_17D3&DEV_1201
ExcludeFromSelect = PCI\VEN_17D3&DEV_1203
ExcludeFromSelect = PCI\VEN_17D3&DEV_1880
ExcludeFromSelect = PCI\VEN_17D3&DEV_1884
ExcludeFromSelect = PCI\VEN_17D3&DEV_1889
ExcludeFromSelect = PCI\VEN_17D3&DEV_188A
ExcludeFromSelect = PCI\VEN_17D3&DEV_1214

[ArcMSR_Inst]
CopyFiles = @arcmsr.sys
CopyINF   = arcvdev.inf
AddReg    = ArcMSR_AddReg

[ArcMSR_Inst.HW]
Include = machine.inf
Needs   = PciIoSpaceNotRequired
AddReg  = ArcMSR_Removal_Addreg
AddReg  = ArcMSR_Shutdown_Addreg
DelReg  = ArcMSR_LegacyStorportValues

[ArcMSR_Inst.Services]
AddService = arcmsr, %SPSVCINST_ASSOCSERVICE%, ArcMSR_Service_Inst, Miniport_EventLog_Inst

[ArcMSR_MsiInst]
CopyFiles = @arcmsr.sys
CopyINF   = arcvdev.inf
AddReg    = ArcMSR_AddReg

[ArcMSR_MsiInst.HW]
Include = machine.inf
Needs   = PciIoSpaceNotRequired
AddReg  = ArcMSR_Removal_Addreg
AddReg  = ArcMSR_Interrupt_Management_Addreg
AddReg  = ArcMSR_Shutdown_Addreg
DelReg  = ArcMSR_LegacyStorportValues

[ArcMSR_MsiInst.Services]
AddService = arcmsr, %SPSVCINST_ASSOCSERVICE%, ArcMSR_Service_Inst, Miniport_EventLog_Inst

[ArcMSR_Service_Inst]
DisplayName    = %ArcMSR.DevDesc%
ServiceType    = %SERVICE_KERNEL_DRIVER%
StartType      = %SERVICE_BOOT_START%
ErrorControl   = %SERVICE_ERROR_NORMAL%
ServiceBinary  = %12%\arcmsr.sys
LoadOrderGroup = SCSI Miniport
AddReg         = ArcMSR_Parameters_Addreg
AddReg         = ArcMSR_BusType_Addreg

[ArcMSR_Parameters_Addreg]
HKR, "Parameters\PnpInterface", "5", %REG_DWORD%, 0x00000001 ;PCIBus (5), Isa (1), Eisa (2) and PCMCIABus (8).
HKR, "Parameters\PnpInterface", "Thunderbolt", %REG_DWORD%, 0x00000001 ;
;;; The next 2 values will allow a 16 MB virtual harddisk as reported in Disk Manager (diskmgmt.msc).
HKR, "Parameters", "VirtualDiskSize",   %REG_DWORD%,  0x01000000
HKR, "Parameters", "PhysicalDiskSize",  %REG_DWORD%,  0x01000000
HKR, "Parameters", "NbrLUNsperHBA",     %REG_DWORD%,  0x00000002
;;;HKR, "Parameters", "CombineVirtDisks",  %REG_DWORD%,  0x00000001

[ArcMSR_Removal_Addreg] 
HKR, , "RemovalPolicy", %REG_DWORD%, 3 ; REMOVAL_POLICY 3

[ArcMSR_Interrupt_Management_Addreg]
HKR, "Interrupt Management", 0x00000010
HKR, "Interrupt Management\MessageSignaledInterruptProperties", 0x00000010
HKR, "Interrupt Management\MessageSignaledInterruptProperties", MSISupported, %REG_DWORD%, 1
;HKR, "Interrupt Management\Affinity Policy", 0, 0x00000010
;HKR, "Interrupt Management\Affinity Policy", DevicePolicy, %REG_DWORD%, 5 ;IrqPolicySpreadMessagesAcrossAllProcessors
;HKR, "Interrupt Management\Affinity Policy", DevicePriority, %REG_DWORD%, 3; 
;HKR, "Interrupt Management\Affinity Policy", GroupPolicy, %REG_DWORD%, 1; 

[ArcMSR_BusType_Addreg]
HKR, "Parameters", "BusType", %REG_DWORD%, 0x00000008

[ArcMSR_AddReg]
HKLM,SYSTEM\CurrentControlSet\Services\disk,TimeOutValue,%REG_DWORD%,0x5a
HKLM,SYSTEM\CurrentControlSet\Services\arcmsr\Parameters\Device,MaximumSGList,%REG_DWORD%,0x00001000
HKLM,SYSTEM\CurrentControlSet\Services\arcmsr\Parameters\Device,NumberOfRequests,%REG_DWORD%,257 ; REQUEST_COUNT 257

;******************************************
;--- arcmsr Coinstaller installation ------
;******************************************
;[DestinationDirs]
;ArcMSR_CoInstaller_CopyFiles = 11
;
;[arcmsr.CoInstallers]
;AddReg=ArcMSR_CoInstaller_AddReg
;CopyFiles=ArcMSR_CoInstaller_CopyFiles
;
;[ArcMSR_CoInstaller_AddReg]
;HKR,,CoInstallers32,0x00010000, "WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll,WdfCoInstaller"
;
;[ArcMSR_CoInstaller_CopyFiles]
;WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll
;
;[SourceDisksFiles.$ARCH$]
;WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll=1,  ; make sure the number matches with SourceDisksNames
;
;[arcmsr.Wdf]
;KmdfService = arcmsr, ArcMSR_wdfsect
;
;[ArcMSR_wdfsect]
;KmdfLibraryVersion = $KMDFVERSION$

[Miniport_EventLog_Inst]
AddReg = Miniport_EventLog_Inst.AddReg

[Miniport_EventLog_Inst.AddReg]
HKR,,EventMessageFile,%REG_EXPAND_SZ%,"%%SystemRoot%%\System32\IoLogMsg.dll;%%SystemRoot%%\System32\Drivers\arcmsr.sys"
HKR,,TypesSupported,%REG_DWORD%,7

[ArcMSR_Shutdown_Addreg]
HKR,"ScsiPort","NeedsSystemShutdownNotification",%REG_DWORD%,1

[ArcMSR_LegacyStorportValues]
HKR,ScsiPort,BusNumber
HKR,ScsiPort,LegacyInterfaceType
HKR,ScsiPort,SlotNumber

[Strings]
ARECA                   = "Areca Technology Corporation"
ArcMSR.DevDesc          = "Areca RAID Host Adapter"
ArcMSR.Sata.Nr6.DevDesc = "Areca SATA RAID Host Adapter"
ArcMSR.Sata.Yr6.DevDesc = "Areca SATA RAID Host Adapter (RAID6-ENGINE Inside)"
ArcMSR.Sas.Yr6.DevDesc  = "Areca SAS RAID Host Adapter (RAID6-ENGINE Inside)"
ArcMSR.Source.Disk.Name = "Areca SATA/SAS PCI RAID Installation Disk"

;*******************************************
;Handy macro substitutions (non-localizable)
REMOVAL_POLICY         = 3              ;where Policy = 2 for ExpectOrderlyRemoval, Policy = 3 for ExpectSurpriseRemoval.
REQUEST_COUNT          = 257
TIMEOUT_SECS           = 90
PCI_BUS                = 5
SPSVCINST_ASSOCSERVICE = 0x00000002
SERVICE_KERNEL_DRIVER  = 1
SERVICE_BOOT_START     = 0
SERVICE_ERROR_NORMAL   = 1
REG_EXPAND_SZ          = 0x00020000
REG_DWORD              = 0x00010001
