kernel-space ioctl equivalent

From: Lee MATTHEWS <>
Date: Thu, 12 Jan 2023 10:36:54 UTC

I'd like to obtain a list of all pci devices from the pci driver from another driver that I'm working on.

I note that in the userland tool 'pciconf', this is obtained via the ioctl "ioctl(fd, PCIOCGETCONF, &pc)".

I'd like to know if there is a way of obtaining the same information but directly in kernel space, rather than user space.

Is there an equivalent of ioctl that I can use in my driver to get the output from the request PCIOCGETCONF from the pci driver?

Thanks in advance.

Best wishes,

Lee Matthews