Ticket #1853: RTL8169 - Offset Bug.diff

File RTL8169 - Offset Bug.diff, 777 bytes (added by anxiety, 16 years ago)

Tracked down the problem to the wrong offset being read from the pci config. Now matches Realtek's Linux driver. I couldn't find why it worked before as the value hasn't changed since the original version added to the repository. This is only verified with my own 8168 but I found no special logic in other drivers for 8167 or 8169. (Working)

  • src/add-ons/kernel/drivers/network/rtl8169/device.c

     
    499499    }
    500500
    501501    TRACE("IRQ %d\n", device->irq);
    502    
     502
    503503    // map registers into memory
    504     val = gPci->read_pci_config(device->pciInfo->bus, device->pciInfo->device, device->pciInfo->function, 0x14, 4);
     504    val = gPci->read_pci_config(device->pciInfo->bus, device->pciInfo->device, device->pciInfo->function, 0x18, 4);
    505505    val &= PCI_address_memory_32_mask;
    506506    TRACE("hardware register address %p\n", (void *) val);
    507507    device->regArea = map_mem(&device->regAddr, (void *)val, 256, 0, "rtl8169 register");