Hi,
I am pretty new to Windows driver development, I would appreciate if
you can provide some feedback on the below approach before I branch
off into some wrong direction.
I am on Windows 7 x64.
I have a PCI card that has 12 UARTs (16650 compatible) exposed via
single BAR1. There are no shared registers/other resources, except for
the interrupt. So I would like to use mf.sys and serial.sys (to
minimize the amount of code I need to maintain).
Questions:
-
Is in-box “mf.sys” and “serial.sys” supported for the above
hardware scenario? -
In case I want to write my own “myserial.sys”, can I host it with
mf.sys? (i.e., mf.sys + myserial.sys). Is resource arbitration
work-flow between them is defined? -
What is the alternative?
mybus.sys + myserial.sys: mybus.sys would enumerate 12 children,
each of which would be loaded with myserial.sys. mybus.sys and
myserial.sys would have “private” interface between them for
communication.
Does it make sense? Would I need to stick in any other driver
object in the stack?
For the option 1 above, I tried:
From what I read on MSDN and on ntdev list here, I have written two
INF files, one for mf.sys that breaks BAR1 into 12 children using
“VaryingResourceMap” and then each of them would load “serial.sys”.
Using these two INF files, the devices are enumerated and shown
properly in the “Device Manager”.
But when I try sending/receiving some data (using hyperterminal or
powershell script), nothing happens (open etc succeeds).
I observed the following things:
-
There are high no. of interrupts.
-
Using xperf.exe, I verified that serial.sys is the one executing,
specifically in “SerialIntervalReadTimeout”. -
I verified using windbg, !devnode etc that the resources
types/values are allocated/set as expected. -
Enabled debug logs, nothing useful is coming out of serial.sys.
As a next step, I am thinking of using “wdfserial.sys” example and
load it with mf.sys. Is this supported?
Thanks for your time.
PS: INF files
--------------INF1----------------------
[Version]
Signature=“$Windows NT$”
Class=MultiFunction
ClassGUID={4d36e971-e325-11ce-bfc1-08002be10318}
Provider=%MyComp%
DriverVer=08/19/2013
[ControlFlags]
ExcludeFromSelect=*
[Manufacturer]
%MyComp%=MyComp, NTamd64
; Replace xxxx with proper VEN DEV IDs
[MyComp.NTamd64]
%MyCompFPGA%=MyCompFPGA_inst, PCI\VEN_xxxx&DEV_xxxx
%MyCompFPGA%=MyCompFPGA_inst, PCI\VEN_xxxx&DEV_xxxx&SUBSYS_xxxxxxxx
[MyCompFPGA_inst.NTamd64]
Include = mf.inf
Needs = MFINSTALL.mf
[MyCompFPGA_inst.NTamd64.HW]
AddReg=MyCompFPGA_inst.NTamd64.RegHW
[MyCompFPGA_inst.NTamd64.Services]
Include = mf.inf
Needs = MFINSTALL.mf.Services
[MyCompFPGA_inst.NTamd64.RegHW]
HKR,Child0000,HardwareID,MF\MYCOMPFPGA_UART_COM
HKR,Child0000,VaryingResourceMap,1,02, 00,00,00,00, 08,00,00,00
HKR,Child0000,ResourceMap,1,8
HKR,Child0001,HardwareID,MF\MYCOMPFPGA_UART_COM
HKR,Child0001,VaryingResourceMap,1,02, 10,00,00,00, 08,00,00,00
HKR,Child0001,ResourceMap,1,8
HKR,Child0002,HardwareID,MF\MYCOMPFPGA_UART_COM
HKR,Child0002,VaryingResourceMap,1,02, 20,00,00,00, 08,00,00,00
HKR,Child0002,ResourceMap,1,8
HKR,Child0003,HardwareID,MF\MYCOMPFPGA_UART_COM
HKR,Child0003,VaryingResourceMap,1,02, 30,00,00,00, 08,00,00,00
HKR,Child0003,ResourceMap,1,8
HKR,Child0004,HardwareID,MF\MYCOMPFPGA_UART_COM
HKR,Child0004,VaryingResourceMap,1,02, 40,00,00,00, 08,00,00,00
HKR,Child0004,ResourceMap,1,8
HKR,Child0005,HardwareID,MF\MYCOMPFPGA_UART_COM
HKR,Child0005,VaryingResourceMap,1,02, 50,00,00,00, 08,00,00,00
HKR,Child0005,ResourceMap,1,8
HKR,Child0006,HardwareID,MF\MYCOMPFPGA_UART_COM
HKR,Child0006,VaryingResourceMap,1,02, 60,00,00,00, 08,00,00,00
HKR,Child0006,ResourceMap,1,8
HKR,Child0007,HardwareID,MF\MYCOMPFPGA_UART_COM
HKR,Child0007,VaryingResourceMap,1,02, 70,00,00,00, 08,00,00,00
HKR,Child0007,ResourceMap,1,8
HKR,Child0008,HardwareID,MF\MYCOMPFPGA_UART_COM
HKR,Child0008,VaryingResourceMap,1,02, 80,00,00,00, 08,00,00,00
HKR,Child0008,ResourceMap,1,8
HKR,Child0009,HardwareID,MF\MYCOMPFPGA_UART_COM
HKR,Child0009,VaryingResourceMap,1,02, 90,00,00,00, 08,00,00,00
HKR,Child0009,ResourceMap,1,8
HKR,Child0010,HardwareID,MF\MYCOMPFPGA_UART_COM
HKR,Child0010,VaryingResourceMap,1,02, A0,00,00,00, 08,00,00,00
HKR,Child0010,ResourceMap,1,8
HKR,Child0011,HardwareID,MF\MYCOMPFPGA_UART_COM
HKR,Child0011,VaryingResourceMap,1,02, B0,00,00,00, 08,00,00,00
HKR,Child0011,ResourceMap,1,8
[Strings]
MyComp= “MyComp”
MyCompFPGA = “MyComp PCI FPGA Device (12 UARTs)”
--------------INF2----------------------
[Version]
signature=“$Windows NT$”
Class=Ports
ClassGUID={4d36e978-e325-11ce-bfc1-08002be10318}
Provider=%MyComp%
DriverVer=08/19/2013
[ControlFlags]
ExcludeFromSelect=*
[Manufacturer]
%MyComp%=MyCompFPGAUARTPort, NTamd64
[MyCompFPGAUARTPort.NTamd64]
%MyCompFPGAUARTPort.ComPortName%=ComPort,MF\MYCOMPFPGA_UART_COM
[ComPort.NTamd64]
Include = msports.inf
Needs = ComPort.NT
[ComPort.NTamd64.HW]
Include = msports.inf
Needs = ComPort.NT.HW.AddReg
[ComPort.NTamd64.Services]
Include = msports.inf
Needs = ComPort.NT.Services
[Strings]
MyComp= “MyComp”
MyCompFPGAUARTPort.ComPortName = “MyComp PCI FPGA UART Port (16550A compatible)”