Btw these files only saw really small changes after 2016 in which year 16.04 was coming out:
(click "history")
But the pci.c (in which the capability query function is) has been changed a whole lot of times:
(click "history")
Also there is a separate PCI express and AGP capability, but that does not rule out that one is the subset of the other or things like that, just I pay attention to it.
Also now I see that I cannot ignore this function, because it returns some pointer that the code needs afterwards so ignoring it will just likely lead to a segmentation fault or bigger errors and nothing else. It is not just a check. At this point I am a bit hopeless now, because I have no idea about the code here (or anywhere in the kernel nevertheless).
Maybe a good idea for me is to look for a very old, 2016-ish version of this file from the git history just to compare it with the one I am having and see if any changes make sense for my case....
(click "history")
But the pci.c (in which the capability query function is) has been changed a whole lot of times:
(click "history")
Also there is a separate PCI express and AGP capability, but that does not rule out that one is the subset of the other or things like that, just I pay attention to it.
Code:
/** * pci_find_capability - query for devices' capabilities * @dev: PCI device to query * @cap: capability code * * Tell if a device supports a given PCI capability. * Returns the address of the requested capability structure within the * device's PCI configuration space or 0 in case the device does not * support it. Possible values for @cap: * * %PCI_CAP_ID_PM Power Management * %PCI_CAP_ID_AGP Accelerated Graphics Port * %PCI_CAP_ID_VPD Vital Product Data * %PCI_CAP_ID_SLOTID Slot Identification * %PCI_CAP_ID_MSI Message Signalled Interrupts * %PCI_CAP_ID_CHSWP CompactPCI HotSwap * %PCI_CAP_ID_PCIX PCI-X * %PCI_CAP_ID_EXP PCI Express */ int pci_find_capability(struct pci_dev *dev, int cap) { int pos; pos = __pci_bus_find_cap_start(dev->bus, dev->devfn, dev->hdr_type); if (pos) pos = __pci_find_next_cap(dev->bus, dev->devfn, pos, cap); return pos; } EXPORT_SYMBOL(pci_find_capability);
Maybe a good idea for me is to look for a very old, 2016-ish version of this file from the git history just to compare it with the one I am having and see if any changes make sense for my case....
Comment