Re: kernel-space ioctl equivalent

From: Warner Losh <imp_at_bsdimp.com>
Date: Thu, 12 Jan 2023 17:19:35 UTC
On Thu, Jan 12, 2023 at 3:37 AM Lee MATTHEWS <
Lee.MATTHEWS.external@stormshield.eu> wrote:

> Hi,
>
>
> 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?
>

I have to ask... what's your goal in getting this information? Why do you
need it?

Warner