Hi
I saw some threads about the same topic but i still have some problem. I need to update PCI register for PCI-to-PCI Express Bridge under windows xp (pci.sys). I wrote pci bus filter driver and trying to implement IRP_MN_QUERY_INTERFACE in order to get the ReadConfig/WriteConfig functions but when i cal IoCallDriver the call comes into my driver and as a result the BusInterface is empty. I’m using NextLayerDriver device object pointer. Any ideas why this is happened? I heard that i may be i’m not handling properly IRP_MN_QUERY_DEVICE_RELATIONS, but what exactly should be there. If somebody can publish some sample code, would be very appreciated.
Thank you Alex
Installing a PCI bus filter is not easy. About one month ago somebody asked such information.Was it you? Don Burn gave some information how you could do it.
When do you initiate IRP_MN_QUERY_INTERFACE? You need to give some time to PCI bus driver to creates PDO of child devices. Probably you call IRP_MN_QUERY_INTERFACE too early.
Could you describe why do you need to call from a filter driver IRP_MN_QUERY_INTERFACE? What kind of information do you need?
Igor Sharovar
Igor Sharovar
Assuming that you have your bus filter driver implemented correctly
(you are attaching to child devices of the bus driver as well as the
pci function devices), it is quite likely that there are multiple
layers of busses and thus your filter is installed beneath itself, so
to speak.
windbg !devnode is usefull for drawing maps of who is connected to whom.
Mark Roddy
On Mon, Oct 12, 2009 at 9:50 PM, wrote:
> Hi
> I saw some threads about the same topic but i still have some problem. I need to update PCI register for PCI-to-PCI Express Bridge under windows xp (pci.sys). I wrote pci bus filter driver and trying to implement IRP_MN_QUERY_INTERFACE in order to get the ReadConfig/WriteConfig functions but when i cal IoCallDriver the call comes into my driver and as a result the BusInterface is empty. I’m using NextLayerDriver device object pointer. Any ideas why this is happened? I heard that i may be i’m not handling properly IRP_MN_QUERY_DEVICE_RELATIONS, but what exactly should be there. If somebody can publish some sample code, would be very appreciated.
> ?Thank you Alex
>
> —
> 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
>
Hi Igor
I didn’t post this question before.
I need to update PCI configuration register for hot-swap feature for pci express extender. First, i need to save the PCI configuration registers and than restore it after turning power back for pci express test board.
I have my driver for the test board but we have PCI-to-PCI express bridge on a test board and it uses pci.sys driver (installed automatically). I need to call QUERY_INTERFACE in order to get ReadConfig/WriteConfig function pointers and use it to ready pci configuration registers.
I had driver for windows nt and i use HalGetBusData/HalSetBusData but first, i’m not supposed to use it under windows xp and second, HalGetBusData function doesn’t work for pci-to-pci express bridges.
- I installed the filter driver and it reports that i need to reboot the system. I don’t know why… If i reboot the machine it crashed during boot. This is probably different problem.
- I skipped it and i load my application that send ioctl call into filter driver. From IRP_MJ_INTERNAL_DEVICE_CONTROL i called IRP_MN_QUERY_INTERFACE. Is it ok? I tried to call it from AddDevice but i got the same result.
Thank you
Alex
Why do you need a bus filter? Just install your driver on the bridge fdo and you should be able to do your magic
d
Sent from my phone with no t9, all spilling mistakes are not intentional.
-----Original Message-----
From: xxxxx@gmail.com
Sent: Monday, October 12, 2009 8:00 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] PCI bus filter driver
Hi Igor
I didn’t post this question before.
I need to update PCI configuration register for hot-swap feature for pci express extender. First, i need to save the PCI configuration registers and than restore it after turning power back for pci express test board.
I have my driver for the test board but we have PCI-to-PCI express bridge on a test board and it uses pci.sys driver (installed automatically). I need to call QUERY_INTERFACE in order to get ReadConfig/WriteConfig function pointers and use it to ready pci configuration registers.
I had driver for windows nt and i use HalGetBusData/HalSetBusData but first, i’m not supposed to use it under windows xp and second, HalGetBusData function doesn’t work for pci-to-pci express bridges.
1. I installed the filter driver and it reports that i need to reboot the system. I don’t know why… If i reboot the machine it crashed during boot. This is probably different problem.
2. I skipped it and i load my application that send ioctl call into filter driver. From IRP_MJ_INTERNAL_DEVICE_CONTROL i called IRP_MN_QUERY_INTERFACE. Is it ok? I tried to call it from AddDevice but i got the same result.
Thank you
Alex
—
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
Hi
This will be the best solution if i don’t need to install two drivers. But how can i found the fdo for the bridge?
Thank you
Alex
Does the bridge have a unique pci hw id that will only show up for your device? If not, can you make it unqiue? If so, you just match on the hw id in your inf
d
Sent from my phone with no t9, all spilling mistakes are not intentional.
-----Original Message-----
From: xxxxx@gmail.com
Sent: Monday, October 12, 2009 8:16 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] PCI bus filter driver
Hi
This will be the best solution if i don’t need to install two drivers. But how can i found the fdo for the bridge?
Thank you
Alex
—
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 don’t need to install driver for pci-to-pci express bridge (it installed automatically by windows-pci.sys).
my inf file is only includes information about pci express chip.
Am i messing something?
Regards,
Alex
Yes, you are missing something. Your override the default match so that pci.sys is the fdo, your driver is an upper or lower filter depending on what you want to do relative to when pci.sys does it
d
Sent from my phone with no t9, all spilling mistakes are not intentional.
-----Original Message-----
From: xxxxx@gmail.com
Sent: Monday, October 12, 2009 8:29 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] PCI bus filter driver
I don’t need to install driver for pci-to-pci express bridge (it installed automatically by windows-pci.sys).
my inf file is only includes information about pci express chip.
Am i messing something?
Regards,
Alex
—
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
Hi
Thank you for your answer.
As i understand, i will still need to driver:
- main driver for pci express chip
- filter driver for pci-to-pci express bridge (only to update pci registers)
Is it possible that the same driver can solve two problems?
Alex
Yes, you can use the same driver for both. The key is figuring out which stack you are in during AddDevice so that you can enable the right functionality (1 or 2). The easiest way is to write a value into the devnode in your INF for #2 and check for that value in AddDevice.
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Monday, October 12, 2009 8:59 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] PCI bus filter driver
Hi
Thank you for your answer.
As i understand, i will still need to driver:
- main driver for pci express chip
- filter driver for pci-to-pci express bridge (only to update pci registers)
Is it possible that the same driver can solve two problems?
Alex
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’ll try to make it one driver. But right now, i cannot get the original solution (two separate drivers) to work.
- Should be the driver installed as UpperFilters or LowerFilters. I tried UpperFilters mode and it didn’t work.
- Do i need to use QUERY_INTERFACE and than ReadConfig/WriteConfig or i just need to send IRP_MN_READ_CONFIG/IRP_MN_WRITE_CONFIG messages?
Thank you
Alex
i was the guy who posted that question. Alex if you wanna filter only particular device then you do not need to write PCI Bus Filter Driver. just attached your fido to particular pdo which you wanna filter and install as upperfilter then after you can do magic things.
hi tried to implement the code in one driver, but AddDevice called only once. I never got a call for UpperFilter device.
this is the inf file:
[version]
signature=“$Windows NT$”
Class=Net
ClassGuide={4d36e972-e325-11ce-bfc1-08002be10318}
Provider=%V_Company%
CatalogFile.nt=ex10winxp.cat
DriverVer=09/30/2009,4.00.01
[SourceDisksNames]
1=%SourceDiskDesc%
[SourceDisksFiles]
ex10winxp.sys = 1
[Manufacturer]
%V_Company%=Company
; **************************
; Company
; **************************
[Company]
; DisplayName Section DeviceID
; ----------- ------- --------
%DeviceDesc.ex10winxp% = ex10winxp, PCI\VEN_1923&DEV_0040&SUBSYS_1100A200&REV_00
;%DeviceDesc.ex10winxp% = ex10winxp, PCI\VEN_1923&DEV_0100&SUBSYS_2310A113&REV_00
%DeviceDesc.ex10winfd% = ex10winfd, PCI\VEN_10b5&DEV_8112
%DeviceDesc.ex10winfd% = ex10winfd, PCI\VEN_10b5&DEV_8111
; *****************************
; ex10win Adapter
; *****************************
[ex10winxp.NT]
Characteristics = 0x4
BusType = 5
AddReg = ex10winxp.reg
CopyFiles = ex10winxp.CopyFiles
DelFiles = ex10winxp.DelFiles
[ex10winfd.NT]
AddReg = ex10winfd.reg
CopyFiles = ex10winxp.CopyFiles
DelFiles = ex10winxp.DelFiles
[ex10winfd.HW]
AddReg = ex10winfd.UpperFilter.reg
[ex10winfd.UpperFilter.reg]
HKR, ,“UpperFilters”, 0x00010008,“ex10winxp”
HKR, , DeviceName, 0, “\Device\EX10WINXP”
;HKR, , DeviceType, 0, “EX10”
[ex10winxp.NT.Services]
AddService = busenum, %SPSVCINST_ASSOCSERVICE%, ex10winxp_Service
[ex10winfd.Services]
AddService = pci, %SPSVCINST_ASSOCSERVICE%, pci_ServiceInstallSection
AddService = ex10winfd,ex10winfd_Service,ex10winfd_eventlog
[pci_ServiceInstallSection]
DisplayName = %pci_svcdesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\pci.sys
LoadOrderGroup = “Bus Extender”
[ex10winxp_Service]
DisplayName = %DeviceDesc.ex10winxp%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\ex10winxp.sys
[ex10winxp.reg]
HKR, Ndi, Service, 0, “EX10WINXP”
HKR, NDI\Interfaces, DefUpper, 0, “noupper”
HKR, NDI\Interfaces, DefLower, 0, “nolower”
HKR, NDI\Interfaces, UpperRange, 0, “noupper”
HKR, NDI\Interfaces, LowerRange, 0, “nolower”
HKR, , DeviceName, 0, “\Device\EX10WINXP”
HKR, , DeviceType, 0, “EX10”
; *******************************************
; Common install section for Sangoma Adapters
; *******************************************
[ex10winxp.CopyFiles]
ex10winxp.sys,2
[ex10winxp.DelFiles]
ex10winxp.sys
[DestinationDirs]
DefaultDestDir = 12
ex10winxp.CopyFiles = 12
[strings]
; Provider & Manufacturer
SPSVCINST_ASSOCSERVICE = 0x00000002
V_Company = “Company”
DeviceDesc.ex10winxp = “ex10winxp”
DeviceDesc.ex10winfd = “ex10winfd”
SourceDiskDesc = “Installation Disk”
Do you see any errors?
Thank you
Alex
Alex,
You could look at
http://www.osronline.com/showThread.cfm?link=163708
This should help you.
Igor Sharovar
You should probably have 2 INFs, you don’t want the bridge to be installed in the NET class, you want it to stay in the system class. PCI\VEN_10b5&DEV_8112 and PCI\VEN_10b5&DEV_8111 are 2 part IDs, I don’t think these are specific enough just so that your filter installs only on your device’s bridge. My guess is that this is a generic chip that other devices will also use. Does the device have a 4 part ID?
Did you manually install the INF on the bridge device node? Since the system INF for the bridge device node is a better match than your INF, I am guessing you need to manually pick your INF in the update hw wizard
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, October 13, 2009 9:41 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] PCI bus filter driver
hi tried to implement the code in one driver, but AddDevice called only once. I never got a call for UpperFilter device.
this is the inf file:
[version]
signature=“$Windows NT$”
Class=Net
ClassGuide={4d36e972-e325-11ce-bfc1-08002be10318}
Provider=%V_Company%
CatalogFile.nt=ex10winxp.cat
DriverVer=09/30/2009,4.00.01
[SourceDisksNames]
1=%SourceDiskDesc%
[SourceDisksFiles]
ex10winxp.sys = 1
[Manufacturer]
%V_Company%=Company
; **************************
; Company
; **************************
[Company]
; DisplayName Section DeviceID
; ----------- ------- --------
%DeviceDesc.ex10winxp% = ex10winxp, PCI\VEN_1923&DEV_0040&SUBSYS_1100A200&REV_00
;%DeviceDesc.ex10winxp% = ex10winxp, PCI\VEN_1923&DEV_0100&SUBSYS_2310A113&REV_00
%DeviceDesc.ex10winfd% = ex10winfd, PCI\VEN_10b5&DEV_8112
%DeviceDesc.ex10winfd% = ex10winfd, PCI\VEN_10b5&DEV_8111
; *****************************
; ex10win Adapter
; *****************************
[ex10winxp.NT]
Characteristics = 0x4
BusType = 5
AddReg = ex10winxp.reg
CopyFiles = ex10winxp.CopyFiles
DelFiles = ex10winxp.DelFiles
[ex10winfd.NT]
AddReg = ex10winfd.reg
CopyFiles = ex10winxp.CopyFiles
DelFiles = ex10winxp.DelFiles
[ex10winfd.HW]
AddReg = ex10winfd.UpperFilter.reg
[ex10winfd.UpperFilter.reg]
HKR, ,“UpperFilters”, 0x00010008,“ex10winxp”
HKR, , DeviceName, 0, “\Device\EX10WINXP”
;HKR, , DeviceType, 0, “EX10”
[ex10winxp.NT.Services]
AddService = busenum, %SPSVCINST_ASSOCSERVICE%, ex10winxp_Service
[ex10winfd.Services]
AddService = pci, %SPSVCINST_ASSOCSERVICE%, pci_ServiceInstallSection
AddService = ex10winfd,ex10winfd_Service,ex10winfd_eventlog
[pci_ServiceInstallSection]
DisplayName = %pci_svcdesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\pci.sys
LoadOrderGroup = “Bus Extender”
[ex10winxp_Service]
DisplayName = %DeviceDesc.ex10winxp%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\ex10winxp.sys
[ex10winxp.reg]
HKR, Ndi, Service, 0, “EX10WINXP”
HKR, NDI\Interfaces, DefUpper, 0, “noupper”
HKR, NDI\Interfaces, DefLower, 0, “nolower”
HKR, NDI\Interfaces, UpperRange, 0, “noupper”
HKR, NDI\Interfaces, LowerRange, 0, “nolower”
HKR, , DeviceName, 0, “\Device\EX10WINXP”
HKR, , DeviceType, 0, “EX10”
; *******************************************
; Common install section for Sangoma Adapters
; *******************************************
[ex10winxp.CopyFiles]
ex10winxp.sys,2
[ex10winxp.DelFiles]
ex10winxp.sys
[DestinationDirs]
DefaultDestDir = 12
ex10winxp.CopyFiles = 12
[strings]
; Provider & Manufacturer
SPSVCINST_ASSOCSERVICE = 0x00000002
V_Company = “Company”
DeviceDesc.ex10winxp = “ex10winxp”
DeviceDesc.ex10winfd = “ex10winfd”
SourceDiskDesc = “Installation Disk”
Do you see any errors?
Thank you
Alex
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
Hi
You should probably have 2 INFs,
i think it interesting idea. I’ll try to use 2 inf file but one driver. I’ll let you know how it will go.
Also, i will change to system class.
PCI\VEN_10b5&DEV_8112 and PCI\VEN_10b5&DEV_8111 are 2 part IDs, I don’t think these are >specific enough just so that your filter installs only on your device’s bridge. My guess is that this is a >generic chip that other devices will also use. Does the device have a 4 part ID? Did you manually >install the INF on the bridge device node? Since the system INF for the bridge device node is a better >match than your INF, I am guessing you need to manually pick your INF in the update hw wizard
i used 2 parts id when i tried to install using 2 driver and 2 inf files.
Let me split inf files and will try it again.
Thank you
Alex
Hi
I’m still working on single driver solution for pci nodes.
But i have common questions: When i install pci bus filter driver to PCI-to-PCI express bridge, it replace the name in Device Manager to name that i specified in INF file. So, original “PCI standard PCI-to-PCI bridge” and now it has “ex10winfd” and driver details shows both my driver and original pci.sys. Is it how it suppose to be? I though i should see my device “ex10winfd” connected to “PCI standard PCI-to-PCI bridge”.
Thank you
Alex
Yes, that is how it is supposed to be. since you installed your inf, you override all of the settings on the device node, including the name in the UI. If you want the UI name to be the same as before, use the old name
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, October 14, 2009 10:51 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] PCI bus filter driver
Hi
I’m still working on single driver solution for pci nodes.
But i have common questions: When i install pci bus filter driver to PCI-to-PCI express bridge, it replace the name in Device Manager to name that i specified in INF file. So, original “PCI standard PCI-to-PCI bridge” and now it has “ex10winfd” and driver details shows both my driver and original pci.sys. Is it how it suppose to be? I though i should see my device “ex10winfd” connected to “PCI standard PCI-to-PCI bridge”.
Thank you
Alex
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
Hi
I ask this questios before, but didn’t get answer.
When i install filter driver, it ask me to reboot the system. i don’t know why.
When i reboot the system, it crashed right at the beginning. Any ideas what can be wrong?
At the end, i don’t want these driver installed automatically. Only when i need to update the register.
Thank you
Alex