79552345

Date: 2025-04-03 08:19:52
Score: 1.5
Natty:
Report link

Seems like I found a way. Assuming the network driver creating the net_device does SET_NETDEV_DEV(), then it's possible to get the associated struct pci_dev *pdev = to_pci_dev(netdev->dev.parent) and with that pdev->bus->number which is the PCI bus id, and PCI_SLOT(pdev->devfn) which is the PCI device id.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: pa5h1nh0