跳轉到內容

Linux 核心中的 PCI 匯流排支援

來自 Wikibooks,開放世界中的開放書籍


⚲ 最常用 API

[編輯 | 編輯原始碼]

🗝️ 縮略語

  • ACPI - 高階配置和電源介面
  • ACS - 訪問控制服務
  • AER - 高階錯誤報告埠服務
  • ASPM - 活動狀態電源管理
  • EDR - 錯誤斷開恢復
  • FLR - 功能級重置
  • HT - 超傳輸
  • BAR - 基地址暫存器
  • BW - 頻寬
  • DPC - 下游埠包含埠服務
  • EP - 端點
  • mmrbc - 最大記憶體讀取位元組數
  • mps - 最大有效負載大小
  • MWI - 記憶體寫入無效
  • PM - 電源管理
  • PMC - ... ... 控制器
  • PME - ... ... 事件,埠服務
  • SR-IOV - 單根輸入/輸出虛擬化
  • VF - 虛擬函式


⚲ 使用者空間 API

從 shell 中查詢資訊


⚲ 核心空間 API

👁 示例

⚙️ 內部結構

[編輯 | 編輯原始碼]

linux/pci_ids.hinc
drivers/pcisrc
pci_opsid

📚 主線文件

[編輯 | 編輯原始碼]
PCI 驅動程式 API doc
PCI 支援庫 doc
PCI 熱插拔支援庫 doc
PCI 點對點 DMA 支援 doc

📚 PCI 子系統文件

[編輯 | 編輯原始碼]

PCI 子系統 doc,較新的在上面


引導中斷重新路由 doc

X86_REROUTE_FOR_BROKEN_BOOT_IRQS

核心引數 docpci=ioapicreroute


EP - 端點框架 doc

從 shell 中查詢資訊

find /sys/kernel/config/pci_ep/


EPC - EP 控制器

linux/pci-epc.h inc pci_epc_create id, devm_pci_epc_create id

EPF - EP 功能

linux/pci-epf.h inc pci_epf_create id

內部結構: drivers/pci/endpoint/ src

測試端點功能的驅動程式: drivers/pci/endpoint/functions/pci-epf-test.c src

PCIe 虛擬化,SR-IOV doc, 2009

API: pci_enable_sriov id, pci_disable_sriov id, sriov_configure id

MSI - 訊息訊號中斷 doc, 2008

MSI 示例

vectors = pci_alloc_irq_vectors id(pci_dev, 1, 1, PCI_IRQ_MSI | PCI_IRQ_MSIX);
irq = pci_irq_vector id(pci_dev, 0);


AER - 高階錯誤報告 文件, 2006

API: linux/aer.h 包含檔案, pci_enable_pcie_error_reporting 識別符號, pci_disable_pcie_error_reporting 識別符號, pci_aer_clear_nonfatal_status 識別符號

ERS - 錯誤恢復系統 文件:

API: pci_error_handlers 識別符號, pci_ers_result 識別符號, pci_channel_state_t 識別符號

PCIe - PCI Express 埠匯流排驅動程式 文件, 2004

API: pcie_port_service_driver 識別符號,pcie_port_service_register 識別符號, pcie_port_service_unregister 識別符號


舊的 PCI API 手冊 文件

pci_get_device 識別符號, pci_get_class 識別符號, pci_get_subsys 識別符號, pci_dev_put 識別符號


💾 歷史記錄

📚 參考資料

華夏公益教科書