Re: Question regarding pci_bus_read_config_byte

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

 




> Then you are not writing a pci driver.  From within a PCI driver, you always have access >to your own pci_dev structure.

Yes this piece of code is just for debugging proposes.
 
> Then I would suggest not doing it from within kernel space :)
> You should be able to do all of this from userspace using libpci, right?
> You don't need to write kernel code to get to PCI config space for any device.

In fact, I tried to do it using libpci  but I found some issues. Some registers (Extended Configuration Space of PCI Express) are not found using libpci (I used the latest). Using libpci, some registers (I'm sure that they exists in the current hw) reported 0xfffffffff values, so they look as there do not exists. That is why I want to access them from the kernel. I was told that those functions rely on the correct low level functions, I mean kernel knows when use cfc/cf8 IO ports and when memory mapped registers (using ACPI  MCFG).


But to answer your question, yes, you can do this.  Look at the pci
hotplug drivers for examples of how to hack things up to get access to
this kind of information.

good luck,

greg k-h

Thanks, I will give it a try.

Jesus


--
Simple Mortal!

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux