Multifunction and PnP

Hi,
My PCI card has multiple function headers due
to the fact that it needs more than the given
BAR’s on the function 0 header.
The DDK states that for each function header,
the PnP manager will load another instance of
my driver which is the FDO.

  1. is this statement correct ?
  2. how do you suggest I’ll design my driver,
    same driver for each function ?
  3. If so how can I distinguish between the
    functions ?

Thanks,
Tom G.

Each PCI function on a slot will be enumerated as a separate PDO by the PCI bus driver. Are
you sure that your only solution to the number of memory ranges you need is to allocate new
functions? Why so many separate ranges?

Anyhow you have different VID/DIDs for each function, and thus technically a different FDO
for each VID/DID. A single driver can manage more than one type of FDO, so you can have a
single binary image. (I suppose you could try identifying each of these functions with the
same VID/DID, but that seems wrong, and I certainly don’t know of any such implementation,
and the more I think about it the more it looks broken.)

  1. You do not ever get more than one instance of your driver, even if your driver manages
    multiple FDO types. You get one PDO per enumerated function, and the function driver
    associated with that PDO is called (and loaded if required,) at its AddDevice routine to
    associate an FDO with each such PDO.

  2. I think you should consider redesigning the register layout on your hardware. Otherwise I
    suspect you are in for a bucket of woe here.

  3. Distinguishing between functions is easy. When you create the FDO for each function make
    your DeviceExtension per-function-type unique. Using C semantics, you use a common header with
    a type field to figure out which device object is which. In C++ you derive subclasses per
    function from a common base class. You ask the bus driver (using the PDO) about which device
    you have to begin with - for example you fetch the PCI config space for the PDO and look at
    the DID.

-----Original Message-----
From: Tomer Goldberg
To: “NT Developers Interest List”
Date: Wed, 10 Jul 2002 19:30:46 +0200
Subject: [ntdev] Multifunction and PnP

>
> Hi,
> My PCI card has multiple function headers due
> to the fact that it needs more than the given
> BAR’s on the function 0 header.
> The DDK states that for each function header,
> the PnP manager will load another instance of
> my driver which is the FDO.
>
> 1. is this statement correct ?
> 2. how do you suggest I’ll design my driver,
> same driver for each function ?
> 3. If so how can I distinguish between the
> functions ?
>
> Thanks,
> Tom G.
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@hollistech.com
> To unsubscribe send a blank email to %%email.unsub%%

> My PCI card has multiple function headers due

to the fact that it needs more than the given
BAR’s on the function 0 header.
The DDK states that for each function header,
the PnP manager will load another instance of
my driver which is the FDO.

Yes. PnP will treat it as several devices.
Why you cannot use all BAR’s in Function 0?

Max

Mark,

I wouldn’t say “You do not ever get more than one instance of your driver”.
I have managed to do that a few times. By changing the names of sys files
and having multiple services in the registry before I had completely changed
the names of everything everywhere. … It was one of those “Veddy
interesting …” bugs.


Gary G. Little
xxxxx@broadstor.com
xxxxx@inland.net

Good point. I should have said: ‘barring developer idiocy’, rather than ‘not
ever’ :slight_smile: In the future I’ll stick with the Gilbert&Sullivan version: ‘well
hardly ever’.

-----Original Message-----
From: Gary G. Little [mailto:xxxxx@broadstor.com]
Sent: Wednesday, July 10, 2002 3:10 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Multifunction and PnP

Mark,

I wouldn’t say “You do not ever get more than one instance of
your driver”. I have managed to do that a few times. By
changing the names of sys files and having multiple services
in the registry before I had completely changed the names of
everything everywhere. … It was one of those “Veddy
interesting …” bugs.


Gary G. Little
xxxxx@broadstor.com
xxxxx@inland.net


You are currently subscribed to ntdev as:
xxxxx@stratus.com To unsubscribe send a blank email to
%%email.unsub%%