PCI Driver - Read/Write to Base Address
- From: elliotng.ee@xxxxxxxxx
- Date: 22 Aug 2006 05:36:15 -0700
Hey everyone,
I am trying to read and write to a PCI Base Address. Right now, I have:
static int rpm_probe(struct pci_dev *dev, const struct pci_device_id
*id)
{
pci_enable_device(dev);
u32 BaseAddress0;
pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &BaseAddress0);
printk(KERN_ALERT "PCI_BASE_ADDRESS_0: %x\n", BaseAddress0);
}
To read/write to that particular base address, do we just need to add
the following lines:
u32 BaseAddress0data;
pci_read_config_dword(dev, BaseAddress0, &BaseAddress0data);
pci_write_config_dword(dev, BaseAddress0, 0xFF000000);
or is there another pci function that I should use?
.
- Follow-Ups:
- Re: PCI Driver - Read/Write to Base Address
- From: gil_hamilton@xxxxxxxxxxx
- Re: PCI Driver - Read/Write to Base Address
- Prev by Date: PCI IRQ number reported by scanpci and lspci are different.
- Next by Date: socket communication and DNS
- Previous by thread: PCI IRQ number reported by scanpci and lspci are different.
- Next by thread: Re: PCI Driver - Read/Write to Base Address
- Index(es):