Storport MSI (Message Signaled Interrupts)

來源:互聯網
上載者:User

     最近在學習storport miniport Driver,在看到interrupt時,發現有兩種方式,一種是通過HW_INITIALIZATION_DATA (Storport)中的HwInterrupt函數來響應,支援line-based interrupts和message-based interrupts;另外一種是通過PORT_CONFIGURATION_INFORMATION (Storport)中的HwMSInterruptRoutine來響應,只能響應message-based
interrupts。

    這兩種方式都有嘗試過,目前為止上不清楚他們的區別,如那位大蝦知道,還請不吝賜教~

    第一種方式,通過HW_INITIALIZATION_DATA中的HwInterrupt函數來響應,相對比較簡單,只需要在DriverEntry中設定對應的Function即可。看起來可以響應全部的interrupts,筆者在處理過程中發現了很多非本device的interrupt。

    第二種方式,則相對複雜一些,需要在HwFindAdatper中設定PORT_CONFIGURATION_INFORMATION 中的參數:

PHW_MESSAGE_SIGNALED_INTERRUPT_ROUTINE  HwMSInterruptRoutine;
INTERRUPT_SYNCHRONIZATION_MODE  InterruptSynchronizationMode;
其中 HwMSInterruptRountine 為MSI響應函數,InterruptSynchronizationMode為Miniport所支援的 MSI 同步模式,取值如下:

typedef enum _INTERRUPT_SYNCHRONIZATION_MODE {
  InterruptSupportNone,
  InterruptSynchronizeAll,
  InterruptSynchronizePerMessage
} INTERRUPT_SYNCHRONIZATION_MODE;
可以根據需要進行取值,筆者只嘗試了InterruptSynchronizeAll方式。

    除此之外,還需要在安裝檔案 *.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支援MSI方式,否則系統不認為你的miniport支援MSI,你的 HwMSInterruptRountine 也就不會被調用。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.