https://elixir.bootlin.com/linux/latest/source/include/linux/pci.h#L286
在
struct pci_dev,
我只能看到总线和功能:
struct pci_bus *bus;
和
unsigned int devfn;
好像没有设备(B/D/F)信息?
和
struct pci_slot *slot;
在我的测试中,*slot 指向 NULL,为什么?
最佳答案
我发现:
device = PCI_SLOT(pdev->devfn);
fn = PCI_FUNC(pdev->devfn);
https://elixir.bootlin.com/linux/v3.5/source/include/linux/pci.h#L31
关于linux - 如何从 struct pci_dev 获取总线/设备/编号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53809842/