PCI cleanup and better BAR handling
[akaros.git] / kern / drivers / net / rl8168.c
index 924d3ce..4e6d6ac 100644 (file)
@@ -145,11 +145,11 @@ int rl8168_scan_pci() {
                        if (result == 0) // (0 denotes no valid data)
                                continue;
                        // Read the bottom bit of the BAR. 
-                       if (result & PCI_BAR_IO_MASK) {
-                               result = result & PCI_IO_MASK;
+                       if (result & PCI_BAR_IO) {
+                               result = result & PCI_BAR_IO_MASK;
                                rl8168_debug("-->BAR%u: %s --> %x\n", k, "IO", result);
                        } else {
-                               result = result & PCI_MEM_MASK;
+                               result = result & PCI_BAR_MEM_MASK;
                                rl8168_debug("-->BAR%u: %s --> %x\n", k, "MEM", result);
                        }
                        // TODO Switch to memory mapped instead of IO?