INF How To: interdependent drivers for independent chips

Hi all,

I’m asking for help with an unusual INF: I’m stuck on making an INF that orders starting of drivers for independent PnP chips where the chip’s drivers are interdependent.

A better description: My product uses two independent PnP PCI devices: One is a DMAC, the other is a Special Function Device (SFD). The SFD runs faster with the DMAC. The SFD is therefore dependent on the DMAC driver being installed.

How to…? My INF must assure the DMAC driver loads and starts before the SFD’s driver starts, but how? I’ve stumbled through INF filter and load-order variations, but so far no luck. (It’s probably a simple little thing… :slight_smile:

My plight might be slightly unusual, but I’m sure it’s been solved before… If you know of such an INF I’d appreciate hearing from you. If you can share, a sample INF would be super great.

Thanks to all,
Ryan

You have some serious problems here. There can be an ordering on boot time
drivers, but otherwise all you can do is either make the SFD driver wait for
an interface from the DMAC. The concept of driver A dependant on driver B
is not enforcable for PnP.


Don Burn (MVP, Windows DDK)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

wrote in message news:xxxxx@ntdev…
> Hi all,
>
> I’m asking for help with an unusual INF: I’m stuck on making an INF that
> orders starting of drivers for independent PnP chips where the chip’s
> drivers are interdependent.
>
> A better description: My product uses two independent PnP PCI devices: One
> is a DMAC, the other is a Special Function Device (SFD). The SFD runs
> faster with the DMAC. The SFD is therefore dependent on the DMAC driver
> being installed.
>
> How to…? My INF must assure the DMAC driver loads and starts before the
> SFD’s driver starts, but how? I’ve stumbled through INF filter and
> load-order variations, but so far no luck. (It’s probably a simple little
> thing… :slight_smile:
>
> My plight might be slightly unusual, but I’m sure it’s been solved
> before… If you know of such an INF I’d appreciate hearing from you. If
> you can share, a sample INF would be super great.
>
> Thanks to all,
> Ryan
>

Even boot time drivers for independent pci devices have a difficult time
guaranteeing pnp start device ordering. There is no inf file magic.
From the OP’s description his ‘SFD’ does not have a strong dependency on his
‘DMAC’ instead it just works faster if the DMAC is present. That would be a
weak dependency.

Device interaces (IoRegisterDeviceInterface, IoSetDeviceInterfaceState,
IoRegisterPlugPlayNotification) are the best solution here. The DMAC
provides its device interface, the SFD registers for PnP notification on
that interface, sets up the high performance configuration when it is
available, and perhaps also provides its own device interface that is set
enabled only when the DMAC is available.

Mark Roddy

On Sat, Jan 10, 2009 at 1:43 PM, Don Burn wrote:

> You have some serious problems here. There can be an ordering on boot
> time
> drivers, but otherwise all you can do is either make the SFD driver wait
> for
> an interface from the DMAC. The concept of driver A dependant on driver B
> is not enforcable for PnP.
>
>
> –
> Don Burn (MVP, Windows DDK)
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
>
>
> wrote in message news:xxxxx@ntdev…
> > Hi all,
> >
> > I’m asking for help with an unusual INF: I’m stuck on making an INF that
> > orders starting of drivers for independent PnP chips where the chip’s
> > drivers are interdependent.
> >
> > A better description: My product uses two independent PnP PCI devices:
> One
> > is a DMAC, the other is a Special Function Device (SFD). The SFD runs
> > faster with the DMAC. The SFD is therefore dependent on the DMAC driver
> > being installed.
> >
> > How to…? My INF must assure the DMAC driver loads and starts before the
> > SFD’s driver starts, but how? I’ve stumbled through INF filter and
> > load-order variations, but so far no luck. (It’s probably a simple little
> > thing… :slight_smile:
> >
> > My plight might be slightly unusual, but I’m sure it’s been solved
> > before… If you know of such an INF I’d appreciate hearing from you. If
> > you can share, a sample INF would be super great.
> >
> > Thanks to all,
> > Ryan
> >
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Take this advice, it’s good.

In general, it’s not easily possible to make two independent PCI functions
act as a single “device.” There are too many corner cases in PnP and power
management to deal with. Take, for example, what happens as the machine
goes to sleep, or resumes from hibernate, or goes through a driver upgrade
on only one of your devices.

Make the device work with or without the DMA engine. Then make it faster
with the DMA engine.


Jake Oshins
Hyper-V I/O Architect
Windows Kernel Team

This post implies no warranties and confers no rights.


“Mark Roddy” wrote in message news:xxxxx@ntdev…
> Even boot time drivers for independent pci devices have a difficult time
> guaranteeing pnp start device ordering. There is no inf file magic.
> From the OP’s description his ‘SFD’ does not have a strong dependency on
> his
> ‘DMAC’ instead it just works faster if the DMAC is present. That would be
> a
> weak dependency.
>
> Device interaces (IoRegisterDeviceInterface, IoSetDeviceInterfaceState,
> IoRegisterPlugPlayNotification) are the best solution here. The DMAC
> provides its device interface, the SFD registers for PnP notification on
> that interface, sets up the high performance configuration when it is
> available, and perhaps also provides its own device interface that is set
> enabled only when the DMAC is available.
>
> Mark Roddy
>
>
> On Sat, Jan 10, 2009 at 1:43 PM, Don Burn wrote:
>
>> You have some serious problems here. There can be an ordering on boot
>> time
>> drivers, but otherwise all you can do is either make the SFD driver wait
>> for
>> an interface from the DMAC. The concept of driver A dependant on driver
>> B
>> is not enforcable for PnP.
>>
>>
>> –
>> Don Burn (MVP, Windows DDK)
>> Windows Filesystem and Driver Consulting
>> Website: http://www.windrvr.com
>> Blog: http://msmvps.com/blogs/WinDrvr
>> Remove StopSpam to reply
>>
>>
>>
>> wrote in message news:xxxxx@ntdev…
>> > Hi all,
>> >
>> > I’m asking for help with an unusual INF: I’m stuck on making an INF
>> > that
>> > orders starting of drivers for independent PnP chips where the chip’s
>> > drivers are interdependent.
>> >
>> > A better description: My product uses two independent PnP PCI devices:
>> One
>> > is a DMAC, the other is a Special Function Device (SFD). The SFD runs
>> > faster with the DMAC. The SFD is therefore dependent on the DMAC driver
>> > being installed.
>> >
>> > How to…? My INF must assure the DMAC driver loads and starts before
>> > the
>> > SFD’s driver starts, but how? I’ve stumbled through INF filter and
>> > load-order variations, but so far no luck. (It’s probably a simple
>> > little
>> > thing… :slight_smile:
>> >
>> > My plight might be slightly unusual, but I’m sure it’s been solved
>> > before… If you know of such an INF I’d appreciate hearing from you.
>> > If
>> > you can share, a sample INF would be super great.
>> >
>> > Thanks to all,
>> > Ryan
>> >
>>
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>

Jake, Mark, Don – Thanks for your fantastic feedback. I agree with Mark’s ‘weak dependency’ observation. Clearly the INF path is the wrong way. I’ll try Mark’s PnP notification strategy next.

I learned important stuff today.

Ryan

Uh-oh… Problem resolving exports…

The DMAC’s driver exports functions for the SFD driver. If the DMAC driver is not in memory, the other driver (‘SFD’) won’t load. (SFD’s driver can’t resolve imported DMAC functions.)

And if I have the INF for SFD include the DMAC driver, the DMAC’s PnP installation fails due to DMAC’s “instance of driver already installed.” Heheh…

Darn. I’m guessing the solution (the only solution?) is to convert the DMAC’s interface to a DDI.

Yes - but perhaps you have implemented complexity here that should be
discarded rather than piled onto?
Mark Roddy

On Sun, Jan 11, 2009 at 12:57 PM, wrote:

> Uh-oh… Problem resolving exports…
>
> The DMAC’s driver exports functions for the SFD driver. If the DMAC driver
> is not in memory, the other driver (‘SFD’) won’t load. (SFD’s driver can’t
> resolve imported DMAC functions.)
>
> And if I have the INF for SFD include the DMAC driver, the DMAC’s PnP
> installation fails due to DMAC’s “instance of driver already installed.”
> Heheh…
>
> Darn. I’m guessing the solution (the only solution?) is to convert the
> DMAC’s interface to a DDI.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

I’d say a DDI is more complex than an import/export strategy… But in this case you are quite correct: import/export does not seem to apply well between two PnP drivers, so I have little choice than to discard import/export in favor of DDI.