Obtain GUID of driver supplied by microsoft

Hello,

I have to write a filter driver for “ Intel ® ICH10 LPC Interface
Controller” supplied by Microsoft.

For this purpose I need the GUID of the existing driver.

I used the following procedure:

Control Panel > Device Manager > Right Click on Device > Properties >
Details Tab > Change ‘Property’ to Driver Key >

and got the following data:

{4d36e97d-e325-11ce-bfc1-08002be10318}\0038

"{4d36e97d-e325-11ce-bfc1-08002be10318} is the class GUID contained in the
inf file (machine.inf)

This is not what I need.

In the sample filter.inx, the device id is:
{b85b7c50-6a01-11d2-b841-00c04fad5171}\MsToaster

But in public.h used by the bus and filter the define is:
DEFINE_GUID (GUID_DEVINTERFACE_BUSENUM_TOASTER,
0xD35F7840, 0x6A0C, 0x11d2, 0xB8, 0x41, 0x00, 0xC0, 0x4F, 0xAD,
0x51, 0x71);

Can you help ?

Thanks,
Zvika

What are you really looking for? There is no “GUID of driver”. There are:

  1. Device class GUID’s
  2. Device interface GUID’s
  3. GUID’s used as part of some device ID’s
  4. GUID’s used for other purposes

So what are you really trying to do? You talk about a filter driver, is
this a device filter, if so use the device ID, or a device class filter then
use the device class GUID, either of those you can get from the device
manager.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Zvi Vered
Sent: Tuesday, September 02, 2014 4:58 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Obtain GUID of driver supplied by microsoft

Hello,

I have to write a filter driver for " Intel R ICH10 LPC Interface
Controller" supplied by Microsoft.

For this purpose I need the GUID of the existing driver.

I used the following procedure:

Control Panel > Device Manager > Right Click on Device > Properties >
Details Tab > Change ‘Property’ to Driver Key >

and got the following data:

{4d36e97d-e325-11ce-bfc1-08002be10318}\0038

"{4d36e97d-e325-11ce-bfc1-08002be10318} is the class GUID contained in the
inf file (machine.inf)

This is not what I need.

In the sample filter.inx, the device id is:
{b85b7c50-6a01-11d2-b841-00c04fad5171}\MsToaster

But in public.h used by the bus and filter the define is:
DEFINE_GUID (GUID_DEVINTERFACE_BUSENUM_TOASTER,
0xD35F7840, 0x6A0C, 0x11d2, 0xB8, 0x41, 0x00, 0xC0, 0x4F, 0xAD,
0x51, 0x71);

Can you help ?

Thanks,
Zvika


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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

Hi Don,

My filter is based on the Toaster sample.
This sample uses the file public.h which contains the following defintion:
DEFINE_GUID (GUID_DEVINTERFACE_BUSENUM_TOASTER,
0xD35F7840, 0x6A0C, 0x11d2, 0xB8, 0x41, 0x00, 0xC0, 0x4F, 0xAD,
0x51, 0x71);

The Toaster bus (and filter) uses the same public.h

In my case the bus is a Microsoft driver for which I do not have sources.
I have to write a filter for Microsoft’s bus driver.

I think I must use the same DEFINE_GUID as used in Microsoft’s bus driver.
How can I obtain this DEFINE_GUID ?

Thanks,
Zvika

-----Original Message-----
From: Don Burn
Sent: Wednesday, September 03, 2014 12:14 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Obtain GUID of driver supplied by microsoft

What are you really looking for? There is no “GUID of driver”. There are:

  1. Device class GUID’s
  2. Device interface GUID’s
  3. GUID’s used as part of some device ID’s
  4. GUID’s used for other purposes

So what are you really trying to do? You talk about a filter driver, is
this a device filter, if so use the device ID, or a device class filter then
use the device class GUID, either of those you can get from the device
manager.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Zvi Vered
Sent: Tuesday, September 02, 2014 4:58 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Obtain GUID of driver supplied by microsoft

Hello,

I have to write a filter driver for " Intel R ICH10 LPC Interface
Controller" supplied by Microsoft.

For this purpose I need the GUID of the existing driver.

I used the following procedure:

Control Panel > Device Manager > Right Click on Device > Properties >
Details Tab > Change ‘Property’ to Driver Key >

and got the following data:

{4d36e97d-e325-11ce-bfc1-08002be10318}\0038

"{4d36e97d-e325-11ce-bfc1-08002be10318} is the class GUID contained in the
inf file (machine.inf)

This is not what I need.

In the sample filter.inx, the device id is:
{b85b7c50-6a01-11d2-b841-00c04fad5171}\MsToaster

But in public.h used by the bus and filter the define is:
DEFINE_GUID (GUID_DEVINTERFACE_BUSENUM_TOASTER,
0xD35F7840, 0x6A0C, 0x11d2, 0xB8, 0x41, 0x00, 0xC0, 0x4F, 0xAD,
0x51, 0x71);

Can you help ?

Thanks,
Zvika


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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

Do you want to filter the requests for the LPC Bus function driver, or do you want to filter the requests for the child devices of the LPC bus?

If there is a specific device on the LPC bus you want to filter, you would add a lower filter for that device, not have a filter on the LPC bus driver.

You would need an unusual kind of filter driver if you want to intercept the requests coming into the LPC bus driver?s PDO, like for example to change the PnP Id being returned. Bus PDO filters are not supported by KMDF, and are poorly documented.

So, what are you actually trying to do.

Jan

On Sep 2, 2014, at 7:22 PM, Zvi Vered wrote:

> Hi Don,
>
> My filter is based on the Toaster sample.
> This sample uses the file public.h which contains the following defintion:
> DEFINE_GUID (GUID_DEVINTERFACE_BUSENUM_TOASTER,
> 0xD35F7840, 0x6A0C, 0x11d2, 0xB8, 0x41, 0x00, 0xC0, 0x4F, 0xAD, 0x51, 0x71);
>
> The Toaster bus (and filter) uses the same public.h
>
> In my case the bus is a Microsoft driver for which I do not have sources.
> I have to write a filter for Microsoft’s bus driver.
>
> I think I must use the same DEFINE_GUID as used in Microsoft’s bus driver.
> How can I obtain this DEFINE_GUID ?
>
> Thanks,
> Zvika
>
> -----Original Message----- From: Don Burn
> Sent: Wednesday, September 03, 2014 12:14 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Obtain GUID of driver supplied by microsoft
>
> What are you really looking for? There is no “GUID of driver”. There are:
>
> 1. Device class GUID’s
> 2. Device interface GUID’s
> 3. GUID’s used as part of some device ID’s
> 4. GUID’s used for other purposes
>
> So what are you really trying to do? You talk about a filter driver, is
> this a device filter, if so use the device ID, or a device class filter then
> use the device class GUID, either of those you can get from the device
> manager.
>
>
> Don Burn
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
>
>
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Zvi Vered
> Sent: Tuesday, September 02, 2014 4:58 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Obtain GUID of driver supplied by microsoft
>
> Hello,
>
> I have to write a filter driver for " Intel R ICH10 LPC Interface
> Controller" supplied by Microsoft.
>
> For this purpose I need the GUID of the existing driver.
>
> I used the following procedure:
>
> Control Panel > Device Manager > Right Click on Device > Properties >
> Details Tab > Change ‘Property’ to Driver Key >
>
> and got the following data:
>
> {4d36e97d-e325-11ce-bfc1-08002be10318}\0038
>
> "{4d36e97d-e325-11ce-bfc1-08002be10318} is the class GUID contained in the
> inf file (machine.inf)
>
> This is not what I need.
>
> In the sample filter.inx, the device id is:
> {b85b7c50-6a01-11d2-b841-00c04fad5171}\MsToaster
>
> But in public.h used by the bus and filter the define is:
> DEFINE_GUID (GUID_DEVINTERFACE_BUSENUM_TOASTER,
> 0xD35F7840, 0x6A0C, 0x11d2, 0xB8, 0x41, 0x00, 0xC0, 0x4F, 0xAD,
> 0x51, 0x71);
>
> Can you help ?
>
> Thanks,
> Zvika
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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

Hello,

The LPC contains (also) GPIO that I have to control.
The regular driver supplied by microsoft does not handle this.
So I have to add functionality to Microsoft’s driver using a fliter driver.

In most PCs it is on PCI bus 0, device 31, function 0

In order to send IOCTLs requests to Microsoft driver (and from there to my filter), I need GUID.

Thanks,
Zvika

On Sep 2, 2014, at 7:22 PM, Zvi Vered wrote:
>
> My filter is based on the Toaster sample.
> This sample uses the file public.h which contains the following defintion:
> DEFINE_GUID (GUID_DEVINTERFACE_BUSENUM_TOASTER,
> 0xD35F7840, 0x6A0C, 0x11d2, 0xB8, 0x41, 0x00, 0xC0, 0x4F, 0xAD,
> 0x51, 0x71);
>
> The Toaster bus (and filter) uses the same public.h
>
> In my case the bus is a Microsoft driver for which I do not have sources.
> I have to write a filter for Microsoft’s bus driver.
>
> I think I must use the same DEFINE_GUID as used in Microsoft’s bus driver.
> How can I obtain this DEFINE_GUID ?

No, you are still very confused by what the GUIDs are used for.

This GUID in the sample INF identifies the name of the virtual device. It just a set of characters with no meaning:
{b85b7c50-6a01-11d2-b841-00c04fad5171}\MsToaster

The GUID you found in the registry is the Device Class from the INF file
{4d36e97d-e325-11ce-bfc1-08002be10318}\0038
In this case, it is Class=Machine. That only determines where you live in the Device Manager display.

The device interface GUID you show up top is a way for applications or other drivers to find you. Device Interfaces came into being with WDM; older drivers do not use them. The LPC bus is clearly an older driver.

None of those GUIDs are related. In your case, what you need to do is deviance (A) EXACTLY which device you plan to drive, and (B) EXACTLY who will be using your services and how they will find you. The answers to those questions will determine whether you need to use any GUIDs at all.

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Dear Members,

Here are the details on Microsoft’s driver:

Display name: PCI standard ISA bridge
Driver file: msisadrv.sys
Device class guid: {4d36e97d-e325-11ce-bfc1-08002be10318}
Driver key: {4d36e97d-e325-11ce-bfc1-08002be10318}\0051
Bus type guid: {c8ebdfb0-b510-11d0-80e5-00a0c92542e3}

Is it possible to add functionality to this driver ? How ?
If the way to do it is by writing a filter driver, what GUID (if any) should I use ?
Of course I will need a way for user space code to communicate with the filter via IOCTL.

The Toaster filter is using GUID in Toaster\kmdf\inc\public.h

Thank you in advance,
Zvika

>Device Interfaces came into being with WDM; older drivers do not use them. The LPC bus is clearly

an older driver.

LPC aka ISAPnP is an older driver only in terms of Win9x :slight_smile: there was never any NT4 driver of such, since NT4 had no PnP.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

Is there a separate PCI function for GPIO? or separate ISA ports?


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Hello,
>
> The LPC contains (also) GPIO that I have to control.
> The regular driver supplied by microsoft does not handle this.
> So I have to add functionality to Microsoft’s driver using a fliter driver.
>
> In most PCs it is on PCI bus 0, device 31, function 0
>
> In order to send IOCTLs requests to Microsoft driver (and from there to my filter), I need GUID.
>
> Thanks,
> Zvika
>
>

On Sep 3, 2014, at 1:07 AM, > > wrote:

Display name: PCI standard ISA bridge
Driver file: msisadrv.sys
Device class guid: {4d36e97d-e325-11ce-bfc1-08002be10318}
Driver key: {4d36e97d-e325-11ce-bfc1-08002be10318}\0051
Bus type guid: {c8ebdfb0-b510-11d0-80e5-00a0c92542e3}

Is it possible to add functionality to this driver ? How ?
If the way to do it is by writing a filter driver, what GUID (if any) should I use ?
Of course I will need a way for user space code to communicate with the filter via IOCTL.

Device class {4d36e97d-e325-11ce-bfc1-08002be10318} is System, a category a whole bunch of devices belong to. Device in class Systems can have a huge range of functionality. Think if it as the ?Other? device class.

The device key {4d36e97d-e325-11ce-bfc1-08002be10318}\0051 just means it?s instance 51 of some device in class System. There will be some info about the device instance in the associated registry subtree.

The bus type guid, according to a Google search if for PCI bus type. The LPC controller is a PCI device.

None of this tells you anything about what the programatic interfaces are.

You said you need to control some GPIO pins, are those pins on the LPC controller (so might be controlled by bits in the LPC controller BAR)? Or are those pins in a device on the LPC bus (so might have port addresses). LPC busses are addressed like ISA busses, but the electrical implementation is very different.

If the pins are part ot the LPC controller, you may be SOL, as the LPC controller drivers owns it, and there is likely no way to extend the LPC controller driver. If the pins are a device on the LPC bus, it?s a question of how do you detect the device, and after detection you can just write a PnP function driver that will be given ownership of the ports (or whatever).

One of your messages said the GPIO pins where part of the LPC controller and the Microsoft driver didn?t support controlling them, in which case you are SOL, a filter driver won?t help, tell your hardware people they should have spent an extra $0.10 and not tried to use extra but unsupported pins. This is not Linux, you don?t get to change anything in the OS you want. You might also want to give Microsoft/Intel feedback that in Windows 9, you would like to see support for additional functionality in the LPC controller driver, and justify why you think you need it.

If the pins are part of the LPC controller, you can?t make a filter driver that modifies hardware bits owned by the LPC controller driver. A filter driver get?s to modify the IRPs passed down from above. You could make an upper filter of the LPC controller that extracted the resources from the PnP start, and made it?s own mapping of the LPC BARs, and fiddled those bits itself, but there is no guarantee the LPC driver would not do things that conflict with your filter.

For example, say you need to fiddle bit 6 of some LPC controller register that has 31 other bits. The LPC controller driver may just keep a memory copy of what it thinks those bits should be, and when it updates them, it just changes the memory copy and writes it to the device, overwriting any changes you made in you filter to bit 6. This is what we mean when we say the LPC Controller driver owns the device. The LPC driver will almost certainly not read some register, change the bits it wants to change and then write back that register, just in case somebody else is trying to modify the same register.

If you’re asking if the LPC controller driver has a programatic interface, like an ioctl, that let?s you set the state of bit 6, updating it?s memory copy of the registry, then you would need to ask the developer of the LPC controller driver, which I assume is either Intel or Microsoft. If this is what you ned to do, I suggest you clearly define what register in the LPC controller you need to control, and open a support ticket with Microsoft. If they are nice, they will look at the source code, and see if there is a programatic interface to do what you need. Their answer might be no there is no pragmatic interface for what you want, or it might be sorry, not a documented interface, or it might be here is the ioctl to use. You also could carefully debug (since disassembling is against the OS license) the operation of the LPC controller driver, and see if you find any interfaces. Interfaces might be ioctls, or they might be driver QueryInterface style.

If the GPIO bits you need to control are device on the LPC bus, then there is the detection question. Some devices on the LPC bus I believe just have entries in the ACPI bios, and if your dealing with things at the LPC bus level, I?d assume you are a system manufacturer and have control over what?s in the ACPi table.

I?ve pretty much explained the scenario of the GPIO bits are part of the LPC controller, but if it?s the GPIO is a device on the LPC bus scenario, then others here might have some more details about device detection.

The most likely way GUIDs get involved is if there is a QueryInterface style interface to the LPC controller driver. These interfaces are defined in terms of GUIDs. A QueryInterface type interface would be the LPC controller driver makes function calls available to other drivers, and the way it does this is via QueryInterface. You should also not just assume such an interface even exists, but if you have some documentation from Intel or Microsoft saying to use an interface to the LPC controller via some GUID, this might be what it?s talking about. The LPC controller might also register an interface notification for some specific interface GUID. An interface GUID and a QuiryInterface GUID might be totally different or might be the same value. Another driver, it doesn?t have to be a filter, can register to be notified when specific interfaces arrive, and using that arrival you could open the LPC controller instance and send either QueryInterface or ioctl requests to it. Using ioctls, you might be able to communicate directly with an interface from user mode, kernel QueryInterface will have kernel only function addresses, so is not useful directly from user mode.

Jan

>have port addresses). LPC busses are addressed like ISA busses, but the electrical implementation

is very different.

Actually, LPC is 4-wire serial implementation of ISA.

It is like 1-lane PCIe to the old-style PCI.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

If your are filtering msisadrv why not install your filter based on the hardware id of the controller or the hw id of the child device? No need for the device interface guid of the driver, there probably isn’t one since msisadrv doesn’t expect anyone to open a file handle on it

d

Bent from my phone


From: xxxxx@gmail.commailto:xxxxx
Sent: ?9/?3/?2014 1:07 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Obtain GUID of driver supplied by microsoft

Dear Members,

Here are the details on Microsoft’s driver:

Display name: PCI standard ISA bridge
Driver file: msisadrv.sys
Device class guid: {4d36e97d-e325-11ce-bfc1-08002be10318}
Driver key: {4d36e97d-e325-11ce-bfc1-08002be10318}\0051
Bus type guid: {c8ebdfb0-b510-11d0-80e5-00a0c92542e3}

Is it possible to add functionality to this driver ? How ?
If the way to do it is by writing a filter driver, what GUID (if any) should I use ?
Of course I will need a way for user space code to communicate with the filter via IOCTL.

The Toaster filter is using GUID in Toaster\kmdf\inc\public.h

Thank you in advance,
Zvika


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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</mailto:xxxxx></mailto:xxxxx>

Sigh! It’s another one of those “I want to control an LPC device that is/isn’t a separate function” threads.

First: LPC is a connection method, not just a device per se. Are these gpio pins part of, say, the Intel PCH on your system? How are they interacted? Are they controlled by a separate function? You need to give us answers.

There is nothing about ant GUID that I’ll help you solve this problem. You are down the wrong path for sure.

As I’ve written in these threads before, writing a filter may not help at all.

Tell us more about the device/environment and we can help you.

Peter
OSR
@OSRDrivers

xxxxx@gmail.com wrote:

The LPC contains (also) GPIO that I have to control.
The regular driver supplied by microsoft does not handle this.
So I have to add functionality to Microsoft’s driver using a fliter driver.

Not necessarily. If the standard driver offered an internal kernel API
that does what you want to do, then it would make perfect sense to write
a filter driver so you could expose that interface to user mode. But
that’s not the case, is it? What you intend to do is go access these
GPIO pins by force, writing directly to chipset registers, behind the
back and without the knowledge of the standard LPC driver. To do that,
you don’t have to be in the same driver stack at all. You could just as
easily write a legacy driver.

One way to implement something like this is to modify your BIOS to
expose a GPIO pin in the ACPI DSDT. By doing that, your BIOS can create
a fake device that triggers the loading of your driver. The DSDT can
also identify which pin you are supposed to own, and even offer services
to allow you to manipulate the state of the pin in a standard and
controlled manner.

In most PCs it is on PCI bus 0, device 31, function 0

In order to send IOCTLs requests to Microsoft driver (and from there to my filter), I need GUID.

No, you don’t. To attach a filter driver, you need to modify the
device’s registry key in the Enum tree. That’s all. EVEN IF the driver
created a device interface, by adding a filter driver you would
automatically be part of that device interface. The only reason you
would need to know the GUID (assuming there was one, which there isn’t)
is if you had another driver in another device stack that wanted to
offer the same services.

Here are the details on Microsoft’s driver:

Display name: PCI standard ISA bridge
Driver file: msisadrv.sys
Device class guid: {4d36e97d-e325-11ce-bfc1-08002be10318}
Driver key: {4d36e97d-e325-11ce-bfc1-08002be10318}\0051
Bus type guid: {c8ebdfb0-b510-11d0-80e5-00a0c92542e3}

Is it possible to add functionality to this driver ? How ?

Yes, but none of that information is relevant. Go into Device Manager.
Find your LPC controller. Look at the details, under Hardware Ids.
Now, go look in the registry in SYSTEM\CurrentControlSet\Enum\PCI.…
for the key that matches one of those hardware IDs. In that key, you
need to add an UpperFilters value that names your filter’s service. You
won’t be able to change the key in regedit, but the Toaster examples
include an application that show how to use the SetupDi APIs to do it.

THAT’S how you install a filter driver. However, as I said, I don’t
think that’s what you need here at all.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Dear Members,

In all x86 PCs, the chipset contains a south bridge that handles I\O like
I2C and GPIOs.
This bridge also has LPC bus that can be connected to LPC controller.
So I was wrong. The main issue is the bridge, not LPC.

The following link contains the SPEC of this bridge:
http://www.intel.com/content/www/us/en/io/intel-io-controller-hub-8-datasheet.html

In the bridge installed in my PC (for example): vendor=0x8086, device=0x3A18
The GPIOs can be accessed using the PCI configuration space of bus 0, device
31, function 0

Should I use a driver like the one in general\PLX9x5x ?
I added the following line to plx8x5x.inx:
%Pci9656.DRVDESC%= Pci9x5x_Inst, PCI\VEN_8086&DEV_3A18
But how can I install this driver ?
All devices in the device manager has already drivers.

Or should I use a driver like
general\toaster\kmdf\func\simple\objchk_win7_x86\i386 ?
In this case I will replace the class GUID in:
%WdfSimpleDevice.DeviceDesc%=Toaster_Device,
{b85b7c50-6a01-11d2-b841-00c04fad5171}\MsToaster
with the class GUID of the “Intel ICH10 LPC interface controller - 3A18”.

Thanks,
Zvika

-----Original Message-----
From: xxxxx@osr.com
Sent: Wednesday, September 03, 2014 5:57 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Obtain GUID of driver supplied by microsoft

Sigh! It’s another one of those “I want to control an LPC device that
is/isn’t a separate function” threads.

First: LPC is a connection method, not just a device per se. Are these gpio
pins part of, say, the Intel PCH on your system? How are they interacted?
Are they controlled by a separate function? You need to give us answers.

There is nothing about ant GUID that I’ll help you solve this problem. You
are down the wrong path for sure.

As I’ve written in these threads before, writing a filter may not help at
all.

Tell us more about the device/environment and we can help you.

Peter
OSR
@OSRDrivers


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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

OK. Now we’re getting somewhere. Finally.

You have an ICH8. This is a very common platform support chip. You want to manipulate the GPIO registers that are part of the LPC Interface Bridge Register Set within that ICH, that the ICH locates at D31:F0… and there are other “things” within D31:F0 (like the RTC, APIC, Timers, etc).

OK! So, well… now we at least know what you want to do.

IS there currently a Windows driver loaded for this device/function? How does this device show up in Device Manager in your system?

How do you know, for sure, which GPIO lines you can safely manipulate?

How do you know how the GPIO lines will be setup?

Do you have control of the BIOS for this machine?

I can tell you right now: There is *no way* to do what you’re asking in a way that’s sufficiently stable for you to ship it as a commercial product… without having complete control of the platform and changing the BIOS.

So it is entirely likely you are on what we’d call in the States “a fool’s errand”… I don’t know if that translates well.

Peter
OSR
@OSRDrivers

Hi Peter,

The windows driver loaded for this device/function is:
Display name: PCI standard ISA bridge
Driver file: msisadrv.sys

I can manipulate all GPIO lines. No one uses those lines.
I have an Intel’s document (http://www.intel.com/content/www/us/en/io/intel-io-controller-hub-8-datasheet.html) explains how to control GPIO.

I can change BIOS settings but I do not have the BIOS code.

Thanks,
Zvika

Ok, so I looked at the Intel document you referenced. It looks like the field GPIOBASE in the LPC device (D31:F0) sets the GPIO base address and there is a GPIO control register too. There is also a register GPIO Routing Control Register. Assuming the GPIO base is set, there are also a bunch of mode control bits at an offset from that base.

So a few experiments to conduct:

Using windbg, read the config space of the LPC controller and see what the value of the GPIOBASE register is. Do the same for the other GPIO related config space registers. These are at bus 0, device 31 function 0, at the offset in the docs. As a cross check, verify some of the other config space values are what you expect.

The question we are trying to determine is: does the current LPC controller driver, or BIOS, activate and initialize the GPIO registers in the LPC controller. I haven?t decided if it?s good or bad if the GPIO pins are not activated. On the plus side if they are not activated, it is a good sign the current LPC driver and BIOS will not be mucking with them. On the bad side, if they are not already set you will have to figure out how to find a valid range of I/O ports to assign to them.

The Intel docs say there are GPIO pins to do things like read fan tach, control pwm for fan speed, blink leds. These all sound like functions controlled by BIOS/ACPI/UEFI code. So not only do you need to be careful not to conflict with the Windows LPC driver, you need to not conflict with BIOS/ACPI/UEFI.

Reading though the docs some more, it looks like some of the GPIO pins may be controlled by things like BIOS and ACPI code, and not by the driver. Some of these bits may get set from system management mode code.

It looks like each I/O port controls multiple bits, so if anything is already controlling these ports, it may be impossible to determine what might conflict.

Of douse of you find the whole GPIO logic is disabled, which seems unlikely, you might be able to enable it without concern for conflicts.

Once enabled and configured, it looks like it?s just the correct read/write to an I/O port to control the GPIO pins.

If it?s the BIOS that initializes the LPC controller GPIO registers, I?d recommend you get the BIOS people to add an ACPI method to manipulate the GPIO pins you care about, and then make an ACPI device driver that is controlled by user mode, so control would go user mode->acpi device driver->acpi code->LPC device registers.

Jan

On Sep 3, 2014, at 9:46 PM, xxxxx@gmail.commailto:xxxxx wrote:

Hi Peter,

The windows driver loaded for this device/function is:
Display name: PCI standard ISA bridge
Driver file: msisadrv.sys

I can manipulate all GPIO lines. No one uses those lines.
I have an Intel’s document (http://www.intel.com/content/www/us/en/io/intel-io-controller-hub-8-datasheet.html) explains how to control GPIO.

I can change BIOS settings but I do not have the BIOS code.

Thanks,
Zvika


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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</mailto:xxxxx>

Exactly.

This is the problem I was referring to.

OP: No matter how you attack this problem, without being able to change the ACPI BIOS you’re screwed. You have no idea what pins are used for what, how they’re set up, or how or when they’re manipulated by the BIOS.

To repeat myself, something that it seems I have to do a lot on this forum,

>>There is *no way* to do what you’re asking in a way
that’s sufficiently stable for you to ship it as a commercial product… without
having complete control of the platform and changing the BIOS.<<<

You can make it LOOK like it works. You can THINK it works. It might even WORK in MOST CASES. But you cannot write a stable commercial product based on the idea that you’re sharing registers with (a) an arbitrary driver in the OS that you do not control, and (b) sharing registers with the ACPI BIOS that you do not control. You are asking for race conditions and problems.

I hope that’s clear enough.

And because that’s the ultimate answer to your query… I’m out of this thread.

Peter
OSR
@OSRDrivers

Zvi Vered wrote:

In all x86 PCs, the chipset contains a south bridge that handles I\O like
I2C and GPIOs.
This bridge also has LPC bus that can be connected to LPC controller.
So I was wrong. The main issue is the bridge, not LPC.

The following link contains the SPEC of this bridge:
http://www.intel.com/content/www/us/en/io/intel-io-controller-hub-8-datasheet.html

In the bridge installed in my PC (for example): vendor=0x8086, device=0x3A18
The GPIOs can be accessed using the PCI configuration space of bus 0, device
31, function 0

Should I use a driver like the one in general\PLX9x5x ?

Have you read ANY of the excellent advice that has been offered in this
thread? Because it seems to me that you have not changed your approach
in any way.

Let me try to put it succinctly. You do not want to REPLACE the LPC
driver. If you were to do that, you would have to handle ALL of the
functions that the LPC driver now supplies. Since you don’t have a clue
about what services that driver now supplies, it should be clear that
you cannot write a complete replacement.

ALL YOU WANT TO DO is access the resources owned by the current LPC
driver. To do that, you merely need to be in that driver’s stack. That
means you need to be a FILTER driver. Once you are a filter driver, you
can now use the standard system services to access the PCI configuration
space of the device, either using IRP_MN_READ_CONFIG and
IRP_MN_WRITE_CONFIG, or by fetching a BUS_INTERFACE_STANDARD device
interface.

http://msdn.microsoft.com/en-us/library/windows/hardware/ff536890.aspx

Write a filter driver that accepts your custom requests, insert it as an
upper filter to your PCI\VEN_8086&DEV_3A18, and off you go. You will
not use an INF. You will not use a GUID. You will not be present in
Device Manager.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.