;
; Mpi2Ses.INF - for all versions of Windows
;
;////////////////////////////////////////////////////////////////////////////////////////////////////////
;//
;// Copyright © 2021 Broadcom.
;// All Rights Reserved.Broadcom Confidential.The term “Broadcom” refers to Broadcom Inc. and / or its subsidiaries
;//
;////////////////////////////////////////////////////////////////////////////////////////////////////////
;
; This is the INF file for the Mpi2Ses Driver based on PCI MPT environment (Serial Attached SCSI devices)
;

[version]
signature="$Windows NT$"
Class=SCSIAdapter
ClassGUID={4D36E97B-E325-11CE-BFC1-08002BE10318}
Provider=%AVAGO%
DriverVer=07/01/2021,2.61.35.00
CatalogFile=Mpi2Ses.cat

[DestinationDirs]
DefaultDestDir = 12 ; DIRID_DRIVERS

[SourceDisksFiles]
Mpi2Ses.sys = 1

[SourceDisksNames]
1 = %DiskDesc%,,

[Manufacturer]
%AVAGO%=AVAGO, NTarm64, NTamd64
%INTEL%=INTEL, NTamd64
%LENOVO%=LENOVO, NTamd64

[AVAGO.NTamd64]
%DevDesc10% = AVAGO_SAS_Inst, PCI\VEN_1000&DEV_00B2
%DevDesc17% = DDInstall_NO_DRIVER, PCI\VEN_1000&DEV_02B2
%DevDesc17% = DDInstall_NO_DRIVER, PCI\VEN_10B5&DEV_1008
%DevDesc18% = DDInstall_NO_DRIVER, PCI\VEN_1000&DEV_C010&SUBSYS_00B21000
%DevDesc19% = DDInstall_NO_DRIVER, PCI\VEN_1000&DEV_C012&SUBSYS_00B21000

[AVAGO.NTarm64]
%DevDesc10% = AVAGO_SAS_Inst, PCI\VEN_1000&DEV_00B2
%DevDesc17% = DDInstall_NO_DRIVER, PCI\VEN_1000&DEV_02B2
%DevDesc17% = DDInstall_NO_DRIVER, PCI\VEN_10B5&DEV_1008
%DevDesc18% = DDInstall_NO_DRIVER, PCI\VEN_1000&DEV_C010&SUBSYS_00B21000
%DevDesc19% = DDInstall_NO_DRIVER, PCI\VEN_1000&DEV_C012&SUBSYS_00B21000

[INTEL.NTamd64]
%DevDescI4% = AVAGO_SAS_Inst, PCI\VEN_1000&DEV_00B2&SUBSYS_35D88086
%DevDescI5% = DDInstall_NO_DRIVER, PCI\VEN_1000&DEV_02B2&SUBSYS_35D88086
%DevDescI5% = DDInstall_NO_DRIVER, PCI\VEN_1000&DEV_02B2&SUBSYS_35D98086
%DevDescI6% = AVAGO_SAS_Inst, PCI\VEN_1000&DEV_00B2&SUBSYS_35D98086

[LENOVO.NTamd64]
%DevDescL8% = AVAGO_SAS_Inst, PCI\VEN_1000&DEV_00B2&SUBSYS_00031D49
%DevDescL9% = DDInstall_NO_DRIVER, PCI\VEN_1000&DEV_02B2&SUBSYS_00031D49
%DevDescL10% = DDInstall_NO_DRIVER, PCI\VEN_1000&DEV_02B0&SUBSYS_00011D49
%DevDescL11% = DDInstall_NO_DRIVER, PCI\VEN_1000&DEV_02B0&SUBSYS_00021D49
%DevDescL12% = DDInstall_NO_DRIVER, PCI\VEN_1000&DEV_02B1&SUBSYS_00041D49

;DDA bus description
%DevDesc10Dda% = AVAGO_SAS_Inst_DDA, PCIP\VEN_1000&DEV_00B2

[ControlFlags]
ExcludeFromSelect = *

;-----------------------------------------------------------
; Driver installation section
;-----------------------------------------------------------
[DDInstall_NO_DRIVER.NT]

;-----------------------------------------------------------
; AddService section
;-----------------------------------------------------------
[DDInstall_NO_DRIVER.NT.Services]
AddService = , 0x00000002              ; NULL driver

[AVAGO_SAS_Inst]
CopyFiles = AVAGO_SAS_CopyFiles
AddReg = AVAGO_SAS_AddReg
CopyINF = SesNoDev.inf

[AVAGO_SAS_Inst.HW]
AddReg = Shutdown_addreg
DelReg = LegacyScsiportValues
AddReg = InterruptMgmtValues
Include = machine.inf
Needs = PciIoSpaceNotRequired.HW

[AVAGO_SAS_Inst.Services]
AddService = Mpi2Ses, %SPSVCINST_ASSOCSERVICE%, AVAGO_SAS_Service_Inst, Miniport_EventLog_Inst

[AVAGO_SAS_AddReg]
HKLM,SYSTEM\CurrentControlSet\Services\Mpi2SesParameters\Device,DriverParameter,0x00000002,"PlaceHolder=0;"
HKLM,SYSTEM\CurrentControlSet\Services\Mpi2Ses\Parameters\Device,EnableQueryAccessAlignment,0x00010001,1
HKR, "StorPort", "PowerSrbTimeout", %REG_DWORD%, 0x28

[AVAGO_SAS_Service_Inst]
ServiceType    = %SERVICE_KERNEL_DRIVER%
StartType      = %SERVICE_BOOT_START%
ErrorControl   = %SERVICE_ERROR_NORMAL%
ServiceBinary  = %12%\Mpi2Ses.sys
LoadOrderGroup = SCSI Miniport
AddReg         = pnpsafe_pci_addreg
AddReg         = bus_type_sas_addreg

[AVAGO_SAS_CopyFiles]
Mpi2Ses.sys,,,1

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

[LegacyScsiportValues]
HKR,Scsiport,BusNumber
HKR,Scsiport,LegacyInterfaceType
HKR,Scsiport,SlotNumber

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

[pnpsafe_pci_addreg]
HKR, "Parameters\PnpInterface", "5", %REG_DWORD%, 0x00000001

[bus_type_sas_addreg]
HKR, "Parameters", "BusType", %REG_DWORD%, 0x0000000A

[Miniport_EventLog_Inst]
AddReg = Miniport_EventLog_AddReg

[Miniport_EventLog_AddReg]
HKR,,EventMessageFile,%REG_EXPAND_SZ%,"%%SystemRoot%%\System32\IoLogMsg.dll"
HKR,,TypesSupported,%REG_DWORD%,7

; ==========================
; DDA Mitigation entries
; ==========================

[AVAGO_SAS_Inst_DDA.NT]
;Pull in PCIP device section, it also pulls in its 'properties' section but it is blank
Include=wpcip.inf
Needs=pcip_Device.NT

;DDA Specifices for HW section
[AVAGO_SAS_Inst_DDA.NT.HW]
Include=wpcip.inf
Needs=pcip_Device.NT.HW
AddReg=AVAGO_HBA_Device_DDA_Supported.NT.AddReg
AddReg=AVAGO_HBA_Device_DDA_Mitigations.NT.AddReg
DelReg=AVAGO_HBA_Device_DDA.NT.DelReg

;This pulls in and intalls the proxy bus driver, if needed
[AVAGO_SAS_Inst_DDA.NT.Services]
Include=wpcip.inf
Needs=pcip_Device.NT.Services

[AVAGO_SAS_Inst_DDA.NT.Interfaces]
Include=wpcip.inf
Needs=pcip_Device.Interfaces

[AVAGO_HBA_Device_DDA_Supported.NT.AddReg]
HKR,,SupportedDevice,%REG_DWORD%,1

[AVAGO_HBA_Device_DDA_Mitigations.NT.AddReg]
; MBAR0 Define 1st page, remaining follow preceeding def.
; Mitigation directives are CASE SENSITIVE.
;HKR,4e71479c-d352-430f-8412-7b54b5800983,,0x00000010
;HKR,4e71479c-d352-430f-8412-7b54b5800983\0,0,0,"HwRW{8000}"

[AVAGO_HBA_Device_DDA.NT.DelReg]
;In case mitigations/DDA was performed
;on uninstall delete all mitigations
HKR,,SupportedDevice
HKR,84E3B54D-71A0-4e3c-9D3C-C04724C4369C
HKR,4e71479c-d352-430f-8412-7b54b5800983

[Strings]
AVAGO = "Avago Technologies"
DiskDesc = "Broadcom PCIe Switch Management Port"
DevDesc10 = "Broadcom PCIe Switch Management Port PEX880xx"
DevDesc17 = "Broadcom Synthetic Enabler Endpoint"
DevDesc18 = "Broadcom MPT Endpoint (C010 No SES)"
DevDesc19 = "Broadcom MPT Endpoint (C012 No SES)"

;******* for DDA Support ********
DevDesc10Dda = "Broadcom PCIe Switch Management Port PEX880xx - Dismounted"

INTEL = "Intel Corporation"
DevDescI4 = "Intel(R) CYP 12-Port Switch"
DevDescI5 = "NVMe Placeholder"
DevDescI6 = "Intel(R) CYP 24-Port Switch"

LENOVO = "Lenovo"
DevDescL8 = "ThinkSystem 1611-8P PCIe Gen4 NVMe Switch Adapter"
DevDescL9 = "Lenovo 1611-8P Synthetic Enabler EP"
DevDescL10 = "ThinkSystem 1610-4P NVMe Switch Adapter"
DevDescL11 = "ThinkSystem 810-4P NVMe Switch Adapter"
DevDescL12 = "ThinkSystem 1610-8P NVMe Switch Adapter"

;*******************************************
;Handy macro substitutions (non-localizable)
SPSVCINST_ASSOCSERVICE = 0x00000002
SERVICE_KERNEL_DRIVER  = 1
SERVICE_BOOT_START     = 0
SERVICE_ERROR_NORMAL   = 1
REG_EXPAND_SZ          = 0x00020000
REG_DWORD              = 0x00010001
