Re: How does the "/sys/bus/pci/drivers/*/*" interface work?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 13, 2021 at 03:25:50PM +0000, linux.enthusiast wrote:
> > Documentation/ABI/testing/sysfs-bus-pci.
> Thank you, that was incredibly helpful!
> 
> There's just one thing that I couldn't find an answer to and that is how to list the current device IDs of a given PCI device driver.
> 
> I mean I understand there are default ones and that I can use `new_id` to add dynamic ones, but I don't know how to list any of these in order to know if a `new_id` call would even make sense.

Run 'modinfo <name-of-driver>'. For pci drivers, each "alias" line will
show some kind of pci information that the driver binds to. For example:

  # modinfo nvme
  filename: /lib/modules/5.12.0+/kernel/drivers/nvme/host/nvme.ko
  <...>
  alias:          pci:v*d*sv*sd*bc01sc08i02*
  alias:          pci:v0000106Bd00002005sv*sd*bc*sc*i*
  alias:          pci:v0000106Bd00002003sv*sd*bc*sc*i*
  alias:          pci:v0000106Bd00002001sv*sd*bc*sc*i*
  alias:          pci:v00001D0Fd0000CD02sv*sd*bc*sc*i*
  <...>

The first "alias" binds to any vendor device that has a matching class
code. The remaining lines show a specific vendor:device identifier.



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux