;
; Copyright (c) SK Hynix NAND Product Solutions
;

[Version]
Signature="$Windows NT$"
Provider=%SOLIDIGM%
ClassGUID={4D36E97B-E325-11CE-BFC1-08002BE10318}
Class=SCSIAdapter 
DriverVer=04/24/2023,2.2.0.1017
CatalogFile = solidnvm.cat
PnpLockDown=1

[SourceDisksNames]
1 = %DiskId1%,,,""

[SourceDisksFiles]
solidnvm.sys = 1,,,

[DestinationDirs]
DefaultDestDir = 12

;********************************************************
;* Manufacturer
;********************************************************
[Manufacturer]
%SOLIDIGM% = SOLIDIGM, NTamd64.10.0...15063

;********************************************************
;* Models
;********************************************************
[SOLIDIGM.NTamd64.10.0...15063]
%PCI\VEN_8086&DEV_FAF0.DeviceDesc% = Install, PCI\VEN_8086&DEV_FAF0
%PCI\VEN_8086&DEV_F1AA.DeviceDesc% = Install, PCI\VEN_8086&DEV_F1AA
%PCI\VEN_025E&CC_0108.DeviceDesc% = Install, PCI\VEN_025E&CC_0108
;********************************************************
;* Install
;********************************************************
[Install.NTamd64]
CopyFiles=@solidnvm.sys
; Part of Windows Driver Package ranking system, the lower the better
FeatureScore = 0x7F
AddPowerSetting = SolidigmPowerSettingGeneric1, SolidigmPowerSettingGeneric2

[SolidigmPowerSettingGeneric1]
; Disk subgroup
Subgroup = {0012ee47-9041-4b5d-9b77-535fba8b1442}
; APST ITPT for operational power states (ms) on Solidigm NVMe drive
Setting =  {849ed91c-aad3-40bb-8312-a9ae012d7371}, %SolidigmApstIdleTimeoutGeneric1%, %SolidigmApstIdleTimeoutGeneric1Desc%,,0x00000001
; Range 0 to 1 minute (unit: ms)
ValueRange = 0, 60000, 1, %Milliseconds%
; High Performance
Default = {8C5E7FDA-E8BF-4A96-9A85-A6E23A8C635C}, 0, 0
Default = {8C5E7FDA-E8BF-4A96-9A85-A6E23A8C635C}, 1, 0
; Balanced
Default = {381B4222-F694-41F0-9685-FF5BB260DF2E}, 0, 60
Default = {381B4222-F694-41F0-9685-FF5BB260DF2E}, 1, 60
; Power Saving
Default = {A1841308-3541-4FAB-BC81-F71556F20B4A}, 0, 60
Default = {A1841308-3541-4FAB-BC81-F71556F20B4A}, 1, 60

[SolidigmPowerSettingGeneric2]
; Disk subgroup
Subgroup = {0012ee47-9041-4b5d-9b77-535fba8b1442}
; APST ITPT for non-operational power states (ms) on Solidigm NVMe drive
Setting =  {6ba22d50-5fd5-4101-a690-96e37e8dd74c}, %SolidigmApstIdleTimeoutGeneric2%, %SolidigmApstIdleTimeoutGeneric2Desc%,,0x00000001
; Range 0 to 1 minute (unit: ms)
ValueRange = 0, 60000, 1, %Milliseconds%
; High Performance
Default = {8C5E7FDA-E8BF-4A96-9A85-A6E23A8C635C}, 0, 0
Default = {8C5E7FDA-E8BF-4A96-9A85-A6E23A8C635C}, 1, 0
; Balanced
Default = {381B4222-F694-41F0-9685-FF5BB260DF2E}, 0, 60
Default = {381B4222-F694-41F0-9685-FF5BB260DF2E}, 1, 60
; Power Saving
Default = {A1841308-3541-4FAB-BC81-F71556F20B4A}, 0, 60
Default = {A1841308-3541-4FAB-BC81-F71556F20B4A}, 1, 60

;********************************************************
;* Install HW registries
;********************************************************
[Install.NTamd64.HW]
AddReg = msi_addreg
AddReg = etw_solidnvm_addreg
AddReg = storport_addreg

[msi_addreg] 
HKR,Interrupt Management,,0x00000010
HKR,Interrupt Management\MessageSignaledInterruptProperties,,0x00000010
HKR,Interrupt Management\MessageSignaledInterruptProperties,MSISupported,%REG_DWORD%,1
HKR,Interrupt Management\MessageSignaledInterruptProperties,MessageNumberLimit,%REG_DWORD%,80
HKR,Interrupt Management\Affinity Policy,,0x00000010
HKR,Interrupt Management\Affinity Policy,DevicePolicy,%REG_DWORD%,5 ;IrqPolicySpreadMessagesAcrossAllProcessors

[etw_solidnvm_addreg]
; Configuring and Starting an AutoLogger Session
; LogFileMode = Buffering Mode | EVENT_TRACE_ADDTO_TRIAGE_DUMP(0x80000000) | EVENT_TRACE_NO_PER_PROCESSOR_BUFFERING (0x10000000)
HKLM, System\CurrentControlSet\Control\WMI\Autologger\solidnvm-log, LogFileMode, %REG_DWORD%, 0x90000400
HKLM, System\CurrentControlSet\Control\WMI\Autologger\solidnvm-log, FileName
HKLM, System\CurrentControlSet\Control\WMI\Autologger\solidnvm-log, Guid, %REG_SZ%, "{BC600B23-5592-42AD-A932-C093C8BAD35B}"
HKLM, System\CurrentControlSet\Control\WMI\Autologger\solidnvm-log, Start, %REG_DWORD%, 0x00000001
HKLM, System\CurrentControlSet\Control\WMI\Autologger\solidnvm-log, BufferSize, %REG_DWORD%, 0x00001388
; Configure provider using GUID
HKLM, System\CurrentControlSet\Control\WMI\Autologger\solidnvm-log\{79A27D7C-1F07-41C0-9A92-7FE0D7521105}, EnableProperty, %REG_DWORD%, 0x00000000
HKLM, System\CurrentControlSet\Control\WMI\Autologger\solidnvm-log\{79A27D7C-1F07-41C0-9A92-7FE0D7521105}, Enabled, %REG_DWORD%, 0x00000001
; Level = TRACE_LEVEL_INFORMATION
HKLM, System\CurrentControlSet\Control\WMI\Autologger\solidnvm-log\{79A27D7C-1F07-41C0-9A92-7FE0D7521105}, EnableLevel, %REG_DWORD%, 0x00000004
; Flags = ALL
HKLM, System\CurrentControlSet\Control\WMI\Autologger\solidnvm-log\{79A27D7C-1F07-41C0-9A92-7FE0D7521105}, EnableFlags, %REG_DWORD%, 0x0000FFFF

[storport_addreg]
; Enables/Disables Idle Power Management for StorPort
HKR, StorPort, EnableIdlePowerManagement, %REG_DWORD%, 0x00000001

;********************************************************
;* Install Services
;********************************************************
[Install.ntamd64.Services]
AddService = solidnvm, %SPSVCINST_ASSOCSERVICE%, solidnvm_Service_Inst, solidnvm_EventLog_Inst

[solidnvm_Service_Inst]
ServiceType    = %SERVICE_KERNEL_DRIVER%
StartType      = %SERVICE_BOOT_START%
ErrorControl   = %SERVICE_ERROR_NORMAL%
ServiceBinary  = %12%\solidnvm.sys
LoadOrderGroup = SCSI miniport
AddReg         = solidnvm_pnpsafe_pci_addreg

[solidnvm_EventLog_Inst]
AddReg = solidnvm_EventLog_addreg

[solidnvm_EventLog_addreg]
HKR,,EventMessageFile,%REG_EXPAND_SZ%,"%%SystemRoot%%\System32\IoLogMsg.dll;%%SystemRoot%%\System32\drivers\solidnvm.sys"
HKR,,TypesSupported,%REG_DWORD%,7
 
[solidnvm_pnpsafe_pci_addreg]
; Use raw values for BusType, not a DEFINE, ChkInf fails on hex alpha chars 
; BusType_ATA == 0x3, BusTypeNvme == 0x11
HKR, "Parameters\PnpInterface", "5", %REG_DWORD%, 0x00000001
HKR, "Parameters", "BusType", %REG_DWORD%, 0x00000011
; Opt into StorPort's I/O latency cap.
HKR, "Parameters", "IoLatencyCap", %REG_DWORD%,  0x00000000
; Enable Direct Storage
HKR, "Parameters", "StorageSupportedFeatures", %REG_DWORD%,  0x1
; Enable DMA remapping for external devices and/or DMA verification in Driver Verifier
HKR, "Parameters", "DmaRemappingCompatible", %REG_DWORD%,  0x2

;********************************************************
;* Strings
;********************************************************
[Strings]
; Localizable Strings
diskId1 = "solidnvm Installation Disk"
PCI\VEN_8086&DEV_FAF0.DeviceDesc = "Solidigm NVMe Storage Controller"
PCI\VEN_8086&DEV_F1AA.DeviceDesc = "Solidigm NVMe Storage Controller"
PCI\VEN_025E&CC_0108.DeviceDesc = "Solidigm NVMe Storage Controller"

SOLIDIGM = "Solidigm Technology"

Milliseconds                		= "milliseconds"
SolidigmApstIdleTimeoutGeneric1          = "APST ITPT for operational power states (ms) on Solidigm NVMe drive"
SolidigmApstIdleTimeoutGeneric1Desc      = "APST ITPT for operational power states (ms) on Solidigm NVMe drive"
SolidigmApstIdleTimeoutGeneric2          = "APST ITPT for non-operational power states (ms) on Solidigm NVMe drive"
SolidigmApstIdleTimeoutGeneric2Desc      = "APST ITPT for non-operational power states (ms) on Solidigm NVMe drive"

; Non-Localizable Strings
SPSVCINST_ASSOCSERVICE = 0x00000002
REG_SZ                 = 0x00000000
REG_MULTI_SZ           = 0x00010000
REG_EXPAND_SZ          = 0x00020000
REG_DWORD              = 0x00010001
SERVICE_KERNEL_DRIVER  = 1
SERVICE_BOOT_START     = 0
SERVICE_ERROR_NORMAL   = 1 
