PCIe Multi Function Device

Hi

Below from archives

>>
If your device has multiple interfaces, for example multiple ports in a NIC, you'll need to split that out so that Windows perceives your adapter as multiple devices. 
You can either do that 
1) using the PCI spec, exposing multiple functions in which case Microsoft's PCI.sys will be the bus driver that exposes multiple device, or 
2) do it by exposing a single function to PCI.sys and then supplying your own bus driver which further splits your adapter up into different logical devices.

If you choose to use Microsoft's bus driver, then you've got to conform to 
a) all the picayune details of the PCI and PCI Express specs for multi-function devices and 
b) all the things implied by those specs within Microsoft's driver model.
<<

[A] Why is [b] needed if device already satisfies [a] ?
[B] Can I use MF.sys with below

  • No registers overlap
  • Uses MSI or possibly MSI-X
  • Probably each driver can Dx/reset/upgrade itself without affecting the other.

Thanks

Are you trying to design a new device here? If you conform to the PCIe multifunction spec, then each device gets its own configuration space, and everything is managed by the PCI bus driver, just like a multi-interface USB device. MF.SYS is for devices that have one function (in PCI terms). Have you been through this pages and the pages following?

https://docs.microsoft.com/en-us/windows-hardware/drivers/multifunction/using-the-system-supplied-multifunction-bus-driver

Tim
Yes, looking at requirements for a true multifunc pcie device eventually.
But as initial next step looking at using using MF.sys. I went through those later pages as well now, looks like I could use those resource maps with MSIX, need to see if I can use those with MSI as well.
Thanks

Do the functions require non trivial custom drivers? Then maybe make a bus driver, and manage the resources in it.
But if you plan to reuse in-box drivers, sharing MSI interrupts with them may be a problem.
– pa