I recently learned storport miniport driver. When I saw interrupt, I found two methods: one is to respond through the hwinterrupt function in hw_initialization_data (storport, line-based interrupts and message-based interrupts are supported. The other is to respond through hwmsinterruptroutine in port_configuration_information (storport), and only message-based
Interrupts.
Both methods have been tried. So far they are not clear about their differences. For example, if the prawn knows, please kindly advise me ~
The first method is to use the hwinterrupt function in hw_initialization_data to respond. It is relatively simple. You only need to set the corresponding function in DriverEntry. It seems that all interrupts can be responded. During the processing, I found many non-local device interrupts.
The second method is more complex. You need to set the parameters in port_configuration_information in hwfindadatper:
Phw_message_signaled_interrupt_routine hwmsinterruptroutine;
Interrupt_synchronization_mode interruptsynchronizationmode;
Hwmsinterruptrountine is the MSI response function, and interruptsynchronizationmode is the MSI synchronization mode supported by miniport. The values are as follows:
Typedef Enum _ interrupt_synchronization_mode {
Interruptsupportnone,
Interruptsynchronizeall,
Interruptsynchronizepermessage
} Interrupt_synchronization_mode;
You can set the value as needed. I only tried the interruptsynchronizeall method.
In addition, you must add the following items to the installation file *. inf:
// This will create entries under:// HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\VEN_xxxx&// DEV_yyyy&SUBSYS_zzzzvvvv&REV_xx\3&61aaa01&0&FA\Device// Parameters\Interrupt Management\MessageSignaledInterruptProperties[XYZdriver_Inst.nt.HW]AddReg = MsiEnable_addreg[MsiEnable_addreg]HKR, Interrupt Management\MessageSignaledInterruptProperties, 0x00000010HKR, Interrupt Management\MessageSignaledInterruptProperties, MSISupported, 0x00010001, 1// This code courtesy of Adaptec Corporation
Miniport supports the MSI method. Otherwise, your hwmsinterruptrountine will not be called because the system does not think that your miniport supports MSI.