none
can any one tell me the interrupt flow in a WDF drivers. RRS feed

  • Question

  • when the device raised the interrupt how it comes to the functional driver through the bus driver and the sequence of steps that takes place in the driver to handle the interrupt when the 

    evtinterruptisr and evtinterruptdpc is registered.


    sunil45

    Thursday, May 16, 2013 1:45 PM

Answers

  • First it does not come through the bus driver at all.  The OS calls the interrupt service routine, which in KMDF results in EvtInterruptIsr to be called.  This routine is responsible for determining whether the interrupt is from the device supported by the driver, if not it should quickly return with a value of FALSE.  If the device is correct, the driver may decide it can quickly handle the interrupt, if so it does its work.  If not the EvtInterruptIsr routine can call WdfInterruptQueueDpcForIsr to invoke the DPC routine for additional work.

    Typically as part of EvtInterruptIsr the hardware's interrupt is disabled by code in this routine.  If there is an EvtInterruptDPC routine this is typically where the hardware's interrupt is renabled.  Again this is dependant on the design of the device and the driver.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Thursday, May 16, 2013 1:54 PM

All replies

  • First it does not come through the bus driver at all.  The OS calls the interrupt service routine, which in KMDF results in EvtInterruptIsr to be called.  This routine is responsible for determining whether the interrupt is from the device supported by the driver, if not it should quickly return with a value of FALSE.  If the device is correct, the driver may decide it can quickly handle the interrupt, if so it does its work.  If not the EvtInterruptIsr routine can call WdfInterruptQueueDpcForIsr to invoke the DPC routine for additional work.

    Typically as part of EvtInterruptIsr the hardware's interrupt is disabled by code in this routine.  If there is an EvtInterruptDPC routine this is typically where the hardware's interrupt is renabled.  Again this is dependant on the design of the device and the driver.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Thursday, May 16, 2013 1:54 PM
  • can you tel me how the interrupt lines of a devices are mapped to the driver.

    sunil45

    Monday, May 20, 2013 7:32 AM
  • The interrupt is a resource handed to the driver as part of IRP_MJ_PNP/IRP_MN_START_DEVICE or for KMDF EvtPrepareHardware.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Monday, May 20, 2013 11:02 AM
  • can you provide more info about this interrupt line mapping or provide me some link where i get details about this.

    sunil45

    Monday, May 20, 2013 11:52 AM
  • The actual mapping is internal to the OS and undocumented, it has changed over the years.  Basically, Plug and Play will assign the interrupt and your driver takes what it is given.

    What problem are you trying to solve that makes you think you need to know more?


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Monday, May 20, 2013 12:30 PM
  • how does the OS knows that when you install a driver that this driver is for so and so devices.

    sunil45

    Tuesday, May 21, 2013 8:03 AM
  • That is where the INF file comes in.  It matches the plug and play ID of the device to a specific driver.  I recommend you buy a copy of the latest "Windows Internals" book by Microsoft Press.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Tuesday, May 21, 2013 11:11 AM