Hi all,
Thank you very much in advance.

my PCI device have 7 subsystems. each one have read write and IOCTRL
functionality. 3 of them use interrupts.

therefore I have to write 7 separate drivers for each subsystems.
I do not want to install this drivers. they may be work simultaneously.

I have problem to register interrupts. How should get information to
register interrupts(interrupt vector and level).
(I have to use WDM model )

Re: register interrupts by Don

Don
Tue Oct 16 05:16:16 PDT 2007

Are the subsystems independant? I.E. are they seperate functions as defined
by the PCI spec or do they share registers or interrupts? If they are
seperate just write 7 drivers, if the hardware is shared you need to write a
bus driver if you truly want 7 drivers.

Interrupts are provided to you in IRP_MN_START_DEVICE like the other
hardware resources.

I am curious why you state you have to use the WDM model? What OS are you
trying to support that does not support KMDF?


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


"Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
news:CAD8BAAB-AC68-48A8-ACAF-64BA02C88450@microsoft.com...
> Hi all,
> Thank you very much in advance.
>
> my PCI device have 7 subsystems. each one have read write and IOCTRL
> functionality. 3 of them use interrupts.
>
> therefore I have to write 7 separate drivers for each subsystems.
> I do not want to install this drivers. they may be work simultaneously.
>
> I have problem to register interrupts. How should get information to
> register interrupts(interrupt vector and level).
> (I have to use WDM model )



Re: register interrupts by Hasitha

Hasitha
Tue Oct 16 20:51:00 PDT 2007

Thanks for the answers.

>Are the subsystems independant?
yes

> If they are separate just write 7 drivers, if the hardware is shared you need to >write a bus driver if you truly want 7 drivers.
where can i find a good example for it.

> Interrupts are provided to you in IRP_MN_START_DEVICE like the other
> hardware resources.
When it is called. Is it call after DriverEntry.

> I am curious why you state you have to use the WDM model? What OS are you
> trying to support that does not support KMDF?
WindowsXP . it is a customer requirement .

"Don Burn" wrote:

> Are the subsystems independant? I.E. are they seperate functions as defined
> by the PCI spec or do they share registers or interrupts? If they are
> seperate just write 7 drivers, if the hardware is shared you need to write a
> bus driver if you truly want 7 drivers.
>
> Interrupts are provided to you in IRP_MN_START_DEVICE like the other
> hardware resources.
>
> I am curious why you state you have to use the WDM model? What OS are you
> trying to support that does not support KMDF?
>
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
>
> "Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
> news:CAD8BAAB-AC68-48A8-ACAF-64BA02C88450@microsoft.com...
> > Hi all,
> > Thank you very much in advance.
> >
> > my PCI device have 7 subsystems. each one have read write and IOCTRL
> > functionality. 3 of them use interrupts.
> >
> > therefore I have to write 7 separate drivers for each subsystems.
> > I do not want to install this drivers. they may be work simultaneously.
> >
> > I have problem to register interrupts. How should get information to
> > register interrupts(interrupt vector and level).
> > (I have to use WDM model )
>
>
>

Re: register interrupts by Don

Don
Wed Oct 17 04:32:54 PDT 2007


"Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
news:863018F5-E624-4BE9-9848-1D939D42B69D@microsoft.com...
> Thanks for the answers.
>
> >Are the subsystems independant?
> yes

Then you do not need a bus driver, just describe the functions as devices.

>> If they are separate just write 7 drivers, if the hardware is shared you
>> need to >write a bus driver if you truly want 7 drivers.
> where can i find a good example for it.
>
>> Interrupts are provided to you in IRP_MN_START_DEVICE like the other
>> hardware resources.
> When it is called. Is it call after DriverEntry.

After DriverEntry and an AddDevice as part of the IRP_MJ_PNP

>> I am curious why you state you have to use the WDM model? What OS are you
>> trying to support that does not support KMDF?
> WindowsXP . it is a customer requirement .

Is that Windows XP or Windows XP SP2 if the latter KMDF works fine.


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




Re: register interrupts by Hasitha

Hasitha
Wed Oct 17 05:06:01 PDT 2007

> After DriverEntry and an AddDevice as part of the IRP_MJ_PNP
In my code says as bellow
pDriverObject->MajorFunction[IRP_MJ_PNP]= PciDrvDispatchPnp;
pDriverObject->MajorFunction[IRP_MJ_CREATE]= create;
pDriverObject->MajorFunction[IRP_MJ_CLOSE]= close;
pDriverObject->MajorFunction[IRP_MJ_READ]= read;
pDriverObject->MajorFunction[IRP_MJ_WRITE]= write;
pDriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL]= ioControl;
pDriverObject->DriverUnload= unload;
pDriverObject->DriverExtension->AddDevice= PciDrvAddDevice;

then try to open driver using
hdriver = CreateFile(DRIVER_FILE_NAME,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
and start service
but
PciDrvDispatchPnp or PciDrvAddDevice did not call.
what would be the reason. Do i have to write PNP driver.
Is there any method dispatch IRP_MJ_PNP manually.

"Don Burn" wrote:

>
> "Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
> news:863018F5-E624-4BE9-9848-1D939D42B69D@microsoft.com...
> > Thanks for the answers.
> >
> > >Are the subsystems independant?
> > yes
>
> Then you do not need a bus driver, just describe the functions as devices.
>
> >> If they are separate just write 7 drivers, if the hardware is shared you
> >> need to >write a bus driver if you truly want 7 drivers.
> > where can i find a good example for it.
> >
> >> Interrupts are provided to you in IRP_MN_START_DEVICE like the other
> >> hardware resources.
> > When it is called. Is it call after DriverEntry.
>
> After DriverEntry and an AddDevice as part of the IRP_MJ_PNP
>
> >> I am curious why you state you have to use the WDM model? What OS are you
> >> trying to support that does not support KMDF?
> > WindowsXP . it is a customer requirement .
>
> Is that Windows XP or Windows XP SP2 if the latter KMDF works fine.
>
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
>
>
>

Re: register interrupts by Don

Don
Wed Oct 17 05:13:53 PDT 2007

How did you install the device? You need an INF file that descrives the
particular function you are managing. If you install the driver with
StartService you will get the behavior you described.

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


"Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
news:8269D352-6395-4EA1-85E5-2EBEA874ECB1@microsoft.com...
>> After DriverEntry and an AddDevice as part of the IRP_MJ_PNP
> In my code says as bellow
> pDriverObject->MajorFunction[IRP_MJ_PNP]= PciDrvDispatchPnp;
> pDriverObject->MajorFunction[IRP_MJ_CREATE]= create;
> pDriverObject->MajorFunction[IRP_MJ_CLOSE]= close;
> pDriverObject->MajorFunction[IRP_MJ_READ]= read;
> pDriverObject->MajorFunction[IRP_MJ_WRITE]= write;
> pDriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL]= ioControl;
> pDriverObject->DriverUnload= unload;
> pDriverObject->DriverExtension->AddDevice= PciDrvAddDevice;
>
> then try to open driver using
> hdriver = CreateFile(DRIVER_FILE_NAME,
> GENERIC_READ | GENERIC_WRITE,
> 0,
> NULL,
> OPEN_EXISTING,
> FILE_ATTRIBUTE_NORMAL,
> NULL);
> and start service
> but
> PciDrvDispatchPnp or PciDrvAddDevice did not call.
> what would be the reason. Do i have to write PNP driver.
> Is there any method dispatch IRP_MJ_PNP manually.
>
> "Don Burn" wrote:
>
>>
>> "Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
>> news:863018F5-E624-4BE9-9848-1D939D42B69D@microsoft.com...
>> > Thanks for the answers.
>> >
>> > >Are the subsystems independant?
>> > yes
>>
>> Then you do not need a bus driver, just describe the functions as
>> devices.
>>
>> >> If they are separate just write 7 drivers, if the hardware is shared
>> >> you
>> >> need to >write a bus driver if you truly want 7 drivers.
>> > where can i find a good example for it.
>> >
>> >> Interrupts are provided to you in IRP_MN_START_DEVICE like the other
>> >> hardware resources.
>> > When it is called. Is it call after DriverEntry.
>>
>> After DriverEntry and an AddDevice as part of the IRP_MJ_PNP
>>
>> >> I am curious why you state you have to use the WDM model? What OS are
>> >> you
>> >> trying to support that does not support KMDF?
>> > WindowsXP . it is a customer requirement .
>>
>> Is that Windows XP or Windows XP SP2 if the latter KMDF works fine.
>>
>>
>> --
>> Don Burn (MVP, Windows DDK)
>> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>> Website: http://www.windrvr.com
>> Blog: http://msmvps.com/blogs/WinDrvr
>> Remove StopSpam to reply
>>
>>
>>
>>



Re: register interrupts by Hasitha

Hasitha
Wed Oct 17 05:30:01 PDT 2007

Some time it become a stupid question, but i have to ask.
I do not need to install this drivers . because my device have more then one
drivers. Is there any other method to register interrupts. I have three
drivers with interrupts.




"Don Burn" wrote:

> How did you install the device? You need an INF file that descrives the
> particular function you are managing. If you install the driver with
> StartService you will get the behavior you described.
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
>
>

Re: register interrupts by Don

Don
Wed Oct 17 05:39:39 PDT 2007

You have to install the driver. More importantly the install with an INF
file is the mechanism for associating the driver with the device, without
this you have no way of having the OS call your driver when it finds your
device.

Also, you did not answer does your client require XP prior to SP2? If not
consider KMDF this will be much easier.


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


"Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
news:39408FC5-9CC3-41AF-BB07-C21AB484EA42@microsoft.com...
> Some time it become a stupid question, but i have to ask.
> I do not need to install this drivers . because my device have more then
> one
> drivers. Is there any other method to register interrupts. I have three
> drivers with interrupts.
>
>
>
>
> "Don Burn" wrote:
>
>> How did you install the device? You need an INF file that descrives the
>> particular function you are managing. If you install the driver with
>> StartService you will get the behavior you described.
>>
>> --
>> Don Burn (MVP, Windows DDK)
>> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>> Website: http://www.windrvr.com
>> Blog: http://msmvps.com/blogs/WinDrvr
>> Remove StopSpam to reply
>>
>>
>>



Re: register interrupts by Hasitha

Hasitha
Wed Oct 17 06:01:03 PDT 2007

> You have to install the driver. More importantly the install with an INF
> file is the mechanism for associating the driver with the device, without
> this you have no way of having the OS call your driver when it finds your
> device.
Thanks . I got it.
That means i must write to PNP driver and install it.
So can i install more than one driver for one device.


> Also, you did not answer does your client require XP prior to SP2? If not
> consider KMDF this will be much easier.
Yes I cannot use KMDF.


"Don Burn" wrote:

> You have to install the driver. More importantly the install with an INF
> file is the mechanism for associating the driver with the device, without
> this you have no way of having the OS call your driver when it finds your
> device.
>
> Also, you did not answer does your client require XP prior to SP2? If not
> consider KMDF this will be much easier.
>
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
>
> "Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
> news:39408FC5-9CC3-41AF-BB07-C21AB484EA42@microsoft.com...
> > Some time it become a stupid question, but i have to ask.
> > I do not need to install this drivers . because my device have more then
> > one
> > drivers. Is there any other method to register interrupts. I have three
> > drivers with interrupts.
> >
> >
> >
> >
> > "Don Burn" wrote:
> >
> >> How did you install the device? You need an INF file that descrives the
> >> particular function you are managing. If you install the driver with
> >> StartService you will get the behavior you described.
> >>
> >> --
> >> Don Burn (MVP, Windows DDK)
> >> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> >> Website: http://www.windrvr.com
> >> Blog: http://msmvps.com/blogs/WinDrvr
> >> Remove StopSpam to reply
> >>
> >>
> >>
>
>
>

Re: register interrupts by Don

Don
Wed Oct 17 06:07:14 PDT 2007


"Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
news:E3AF7952-40FC-4EE3-BCBA-4DEDDB0A52DE@microsoft.com...
> That means i must write to PNP driver and install it.
> So can i install more than one driver for one device.
>
You can install one driver per function, you need to have your descriptors
cover the specific device ids from the configuration space for each
function.


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



Re: register interrupts by Hasitha

Hasitha
Wed Oct 17 06:20:02 PDT 2007

> You can install one driver per function, you need to have your descriptors
> cover the specific device ids from the configuration space for each
> function.
I am thankful if you can give me a good site which have examples to get
knowledge about this area.

"Don Burn" wrote:

>
> "Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
> news:E3AF7952-40FC-4EE3-BCBA-4DEDDB0A52DE@microsoft.com...
> > That means i must write to PNP driver and install it.
> > So can i install more than one driver for one device.
> >
> You can install one driver per function, you need to have your descriptors
> cover the specific device ids from the configuration space for each
> function.
>
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
>
>

Re: register interrupts by Doron

Doron
Wed Oct 17 10:34:16 PDT 2007

KMDF works on XP gold or XP SP2, the SP does not matter.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Don Burn" <burn@stopspam.windrvr.com> wrote in message
news:OwPOMrLEIHA.3940@TK2MSFTNGP05.phx.gbl...
> You have to install the driver. More importantly the install with an INF
> file is the mechanism for associating the driver with the device, without
> this you have no way of having the OS call your driver when it finds your
> device.
>
> Also, you did not answer does your client require XP prior to SP2? If not
> consider KMDF this will be much easier.
>
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
>
> "Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
> news:39408FC5-9CC3-41AF-BB07-C21AB484EA42@microsoft.com...
>> Some time it become a stupid question, but i have to ask.
>> I do not need to install this drivers . because my device have more then
>> one
>> drivers. Is there any other method to register interrupts. I have three
>> drivers with interrupts.
>>
>>
>>
>>
>> "Don Burn" wrote:
>>
>>> How did you install the device? You need an INF file that descrives the
>>> particular function you are managing. If you install the driver with
>>> StartService you will get the behavior you described.
>>>
>>> --
>>> Don Burn (MVP, Windows DDK)
>>> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>>> Website: http://www.windrvr.com
>>> Blog: http://msmvps.com/blogs/WinDrvr
>>> Remove StopSpam to reply
>>>
>>>
>>>
>
>


Re: register interrupts by Doron

Doron
Wed Oct 17 10:34:39 PDT 2007

any specific reason that you can share why you cannot use KMDF?

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
news:E3AF7952-40FC-4EE3-BCBA-4DEDDB0A52DE@microsoft.com...
>> You have to install the driver. More importantly the install with an INF
>> file is the mechanism for associating the driver with the device, without
>> this you have no way of having the OS call your driver when it finds your
>> device.
> Thanks . I got it.
> That means i must write to PNP driver and install it.
> So can i install more than one driver for one device.
>
>
>> Also, you did not answer does your client require XP prior to SP2? If
>> not
>> consider KMDF this will be much easier.
> Yes I cannot use KMDF.
>
>
> "Don Burn" wrote:
>
>> You have to install the driver. More importantly the install with an INF
>> file is the mechanism for associating the driver with the device, without
>> this you have no way of having the OS call your driver when it finds your
>> device.
>>
>> Also, you did not answer does your client require XP prior to SP2? If
>> not
>> consider KMDF this will be much easier.
>>
>>
>> --
>> Don Burn (MVP, Windows DDK)
>> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>> Website: http://www.windrvr.com
>> Blog: http://msmvps.com/blogs/WinDrvr
>> Remove StopSpam to reply
>>
>>
>> "Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
>> news:39408FC5-9CC3-41AF-BB07-C21AB484EA42@microsoft.com...
>> > Some time it become a stupid question, but i have to ask.
>> > I do not need to install this drivers . because my device have more
>> > then
>> > one
>> > drivers. Is there any other method to register interrupts. I have three
>> > drivers with interrupts.
>> >
>> >
>> >
>> >
>> > "Don Burn" wrote:
>> >
>> >> How did you install the device? You need an INF file that descrives
>> >> the
>> >> particular function you are managing. If you install the driver with
>> >> StartService you will get the behavior you described.
>> >>
>> >> --
>> >> Don Burn (MVP, Windows DDK)
>> >> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>> >> Website: http://www.windrvr.com
>> >> Blog: http://msmvps.com/blogs/WinDrvr
>> >> Remove StopSpam to reply
>> >>
>> >>
>> >>
>>
>>
>>


Re: register interrupts by Hasitha

Hasitha
Tue Oct 23 07:35:04 PDT 2007

Its a customer requirements. They gave a permission to use KDMF.
thankx.


"Doron Holan [MSFT]" wrote:

> any specific reason that you can share why you cannot use KMDF?
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> "Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
> news:E3AF7952-40FC-4EE3-BCBA-4DEDDB0A52DE@microsoft.com...
> >> You have to install the driver. More importantly the install with an INF
> >> file is the mechanism for associating the driver with the device, without
> >> this you have no way of having the OS call your driver when it finds your
> >> device.
> > Thanks . I got it.
> > That means i must write to PNP driver and install it.
> > So can i install more than one driver for one device.
> >
> >
> >> Also, you did not answer does your client require XP prior to SP2? If
> >> not
> >> consider KMDF this will be much easier.
> > Yes I cannot use KMDF.
> >
> >
> > "Don Burn" wrote:
> >
> >> You have to install the driver. More importantly the install with an INF
> >> file is the mechanism for associating the driver with the device, without
> >> this you have no way of having the OS call your driver when it finds your
> >> device.
> >>
> >> Also, you did not answer does your client require XP prior to SP2? If
> >> not
> >> consider KMDF this will be much easier.
> >>
> >>
> >> --
> >> Don Burn (MVP, Windows DDK)
> >> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> >> Website: http://www.windrvr.com
> >> Blog: http://msmvps.com/blogs/WinDrvr
> >> Remove StopSpam to reply
> >>
> >>
> >> "Hasitha" <Hasitha@discussions.microsoft.com> wrote in message
> >> news:39408FC5-9CC3-41AF-BB07-C21AB484EA42@microsoft.com...
> >> > Some time it become a stupid question, but i have to ask.
> >> > I do not need to install this drivers . because my device have more
> >> > then
> >> > one
> >> > drivers. Is there any other method to register interrupts. I have three
> >> > drivers with interrupts.
> >> >
> >> >
> >> >
> >> >
> >> > "Don Burn" wrote:
> >> >
> >> >> How did you install the device? You need an INF file that descrives
> >> >> the
> >> >> particular function you are managing. If you install the driver with
> >> >> StartService you will get the behavior you described.
> >> >>
> >> >> --
> >> >> Don Burn (MVP, Windows DDK)
> >> >> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> >> >> Website: http://www.windrvr.com
> >> >> Blog: http://msmvps.com/blogs/WinDrvr
> >> >> Remove StopSpam to reply
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>