]> Joshua Wise's Git repositories - netwatch.git/blobdiff - pci/pci-raw.c
Fix PCI probe. Fix bothering. Fix the all. Fix outw order for 3cxxx.
[netwatch.git] / pci / pci-raw.c
index 1d59208981e263cadc22345f3b22b5e4b2f100c3..f6448b8ccbc9bd65114a2c1a114f8bb95400d46a 100644 (file)
@@ -4,7 +4,7 @@
 
 static void __pci_config(int bus, int slot, int fn, int addr)
 {
-       outl(0xCF8, 0x80000000ULL | (bus << 16) | (slot << 11) | (fn << 8) | addr);
+       outl(0xCF8, 0x80000000ULL | (bus << 16) | (slot << 11) | (fn << 8) | (addr & ~3));
 }
 
 void pci_write32(int bus, int slot, int fn, int addr, uint32_t data)
@@ -34,11 +34,11 @@ uint32_t pci_read32(int bus, int slot, int fn, int addr)
 uint16_t pci_read16(int bus, int slot, int fn, int addr)
 {
        __pci_config(bus, slot, fn, addr);
-       return inw(0xCFC);
+       return inw(0xCFC + (addr & 2));
 }
 
 uint8_t pci_read8(int bus, int slot, int fn, int addr)
 {
        __pci_config(bus, slot, fn, addr);
-       return inb(0xCFC);
+       return inb(0xCFC + (addr & 3));
 }
This page took 0.022727 seconds and 4 git commands to generate.