Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging

The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.

Check out The OSR Learning Library at:

PCIe Multi Function Device

msrmsr Member Posts: 344
edited November 2019 in NTDEV


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.



  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,490

    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?

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • msrmsr Member Posts: 344

    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.

  • Pavel_APavel_A Member Posts: 2,713
    edited November 2019

    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

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 15 Jun 2020 LIVE ONLINE
Writing WDF Drivers 22 June 2020 LIVE ONLINE
Internals & Software Drivers 28 Sept 2020 Dulles, VA