accessing pci_dev
My apologies if this is inappropriate, but I really don't know where to go for asking this (eventually, I'd be pleased to be addressed to valuable forums or documents).
Question:
Is there any way to access to the struct pci_dev without registering any driver?
Thanks!
Quoted 6 lines · Paolo
My apologies if this is inappropriate, but I really don't know where to go for asking this (eventually, I'd be pleased to be addressed to valuable forums or documents).
Question:
Is there any way to access to the structpci_devwithout registering any driver?
Yes, but why would you?
What problem are you trying to solve?
greg k-h
Quoted 5 lines · Greg KH <gregkh <at> linuxfoundation.org> writes:
Yes, but why would you?
What problem are you trying to solve?
Thanks for responding!
Basically, I want to check the config registers before and after the driver registration in order to make sure that the driver is not contaminating them.
And, yes, it's the very first time I'm dealing with kernel & drivers.
Bjorn Helgaas
maintainerQuoted 2 lines · Paolo
Basically, I want to check the config registers before and after the driver registration in order to make sure that the driver is not contaminating them.
The user command "lspci -x" is a good way to see raw config space.
If you don't need the driver for boot, you can build it as a module, make sure it isn't automatically loaded (e.g., rename it temporarily), reboot, run lspci once, load the driver module by hand, and then run lspci again.
If you're on x86, you can also boot with the kernel option "pci=earlydump" to see config space before any drivers touch it, even if they're built into the kernel.
Bjorn
Quoted 2 lines · Bjorn Helgaas <bhelgaas <at> google.com> writes:
The user command "lspci -x" is a good way to see raw config space.
Sure, Thanks. But I need & want to do everything with the functions pci_read_config_...
They need the struct pci_dev whose pointer is returned by the BIOS (or Kernel?) as parameter of the probe function in the struct pci_driver
There must be a way to get access to each and every pci_dev without resorting to the probe function.
That's what I'm looking fwd to know.
Regards
Bjorn Helgaas
maintainerQuoted 4 lines · Paolo
Quoted 2 lines · Bjorn Helgaas <bhelgaas <at> google.com> writes:
The user command "lspci -x" is a good way to see raw config space.
Quoted 8 lines
Sure, Thanks. But I need & want to do everything with the functions
pci_read_config_...They need the struct
pci_devwhose pointer is returned by the BIOS (or Kernel?) as parameter of the probe function in the structpci_driverThere must be a way to get access to each and every
pci_devwithout resorting to the probe function.
pci_get_device(). In arch/mn10300/unit-asb2305/pci-irq.c, pcibios_fixup_irqs() does something similar to what you're asking for.
Quoted 3 lines · Bjorn Helgaas <bhelgaas <at> google.com> writes:
pci_get_device(). Inarch/mn10300/unit-asb2305/pci-irq.c,pcibios_fixup_irqs()does something similar to what you're asking for.
Thanks so much!!