;***************************************************************************************
;
; Name      : unisoc_iot_npi.inf  
;
; Function  : Install UNISOC USB Serial Driver
;
; Copyright (c) UNISOC Communications Inc.  All rights reserved.
;
;***************************************************************************************


[version]
signature   = "$CHICAGO$"
Class       = Ports
ClassGuid   = {4D36E978-E325-11CE-BFC1-08002BE10318}
Provider    = %SPRD%
DriverVer   = 10/11/2019,2.0.0.133
CatalogFile = unisoc_iot_npi.cat

; ================= Device Install section =====================

[ControlFlags]
ExcludeFromSelect=*

[SourceDisksNames]
1 = %DISK_NAME%,,,\i386
2 = %DISK_NAME%,,,\amd64

[SourceDisksFiles.x86]
WdfCoInstaller01009.dll = 1
sprdvcomIOT.sys         = 1

[SourceDisksFiles.amd64]
WdfCoInstaller01009.dll = 2
sprdvcomIOT.sys         = 2

[DestinationDirs]
DefaultDestDir          = 12
CoInstaller_CopyFiles   = 11

[Manufacturer]
%SPRD%=SPRD,NTx86,NTAMD64

; For Win2K
[SPRD]
%USBCOMM_DL% = Serial_Inst, USB\VID_1782&PID_4D12

; For XP and later
[SPRD.NTx86]
%USBCOMM_DL% = Serial_Inst, USB\VID_1782&PID_4D12


[SPRD.NTAMD64]
%USBCOMM_DL% = Serial_Inst, USB\VID_1782&PID_4D12

[Serial_Inst.NT]
CopyFiles = Serial.CopyFiles
AddReg    = Serial_Inst.AddReg

[Serial_Inst.AddReg]
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[Serial_Inst.NT.HW]
AddReg = Models_HW_AddReg

[Serial.CopyFiles]
sprdvcomIOT.sys

[Serial_Inst.NT.Services]
AddService = sprdvcomIOT,0x00000002,Serial_Service 

[Serial_Service]
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL
ServiceBinary  = %12%\sprdvcomIOT.sys
AddReg         = Serial_Parameters_AddReg

[Models_HW_AddReg]
HKR,,"VendorRequestTimeoutValue", %REG_DWORD%, 5
HKR,,DeviceCharacteristics,0x10001,0x0100         ; Use same security checks on relative opens
HKR,,Security,,"D:P(A;;GA;;;BA)(A;;GA;;;WD)"      ; Allow generic-all access to Built-in administrators and Local system 
HKR,,"SpreadtrumVendorRequest",%REG_DWORD%,0
HKR,,"CdcControlLineState",%REG_DWORD%,1
HKR,,"UseContinuousRead",%REG_DWORD%,0
HKR,,"RxFifoSize",%REG_DWORD%,2048
HKR,,"UsbEnableZLP",%REG_DWORD%,1

[Serial_Parameters_AddReg]

;-------------- WDF Coinstaller installation

[Serial_Inst.NT.CoInstallers]
AddReg     = CoInstaller_AddReg
CopyFiles  = CoInstaller_CopyFiles

[CoInstaller_CopyFiles]
WdfCoInstaller01009.dll

[CoInstaller_AddReg]
HKR,,CoInstallers32,0x00010000, "WdfCoInstaller01009.dll,WdfCoInstaller"

[Serial_Inst.NT.Wdf]
KmdfService = sprdvcomIOT, Serial_wdfsect

[Serial_wdfsect]
KmdfLibraryVersion = 1.9

[Strings]
SPRD           = "UNISOC Communications Inc."
DISK_NAME      = "UNISOC USB to Serial Install Disk"
USBCOMM_DL     = "SPRD U2S Diag"
REG_EXPAND_SZ  = 0x00020000 
REG_DWORD      = 0x00010001 
