linux怎麼查看pci設備?l Pci驅動注冊Pci_register_driver(struct pci_driver *drv),今天小編就來說說關于linux怎麼查看pci設備?下面更多詳細答案一起來看看吧!
l Pci驅動注冊
Pci_register_driver(struct pci_driver *drv)
Static struct pci_driver pci_driver= {
.name = DRV_NAME,
.id_table = pci_pci_tbl,
.probe = pci_init_one,
.remove = _devexit_p(pci_remove_one),
};
l Pci配置空間
Pci_read_config_byte/word/dword(struct pci_dev *pdev,int offset,int *value)
Pci_write_config_byte/word/dword(struct pci_dev *pdev,int offset,int *value)
l Pci的I/O和内存空間
Pci_resource_start(struct pci_dev *dev,int bar) bar的範圍0-5;功能:從配置區相應寄存器得到I/O區域的基址
Pci_resource_length(struct pci_dev *dev,int bar)bar的範圍0-5;功能:從配置區相應寄存器得到I/O區域的内存區域長度
Request_mem_fegion(io_base,length,name)申請I/O端口
Request_mem_region(io_base,length,name)釋放I/O端口
Pci_enable_device啟用設備的I/O
Pci_set_master設定設備工作在總線主設備模式
,更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!