diff options
| author | Miguel <m.i@gmx.at> | 2018-09-25 02:45:57 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-25 02:45:57 +0200 |
| commit | 90c3c74107e9a1e15ea8524057c1e1c48d401da9 (patch) | |
| tree | 9778fa9087cddaa11ef9904c8b37bc46d0495763 /driver/pci.c | |
| parent | 0738f270da6c075b6c48d1b7aa929299ec178f2e (diff) | |
after a long struggle our e1000 can receive and send packets, yeah!
Diffstat (limited to 'driver/pci.c')
| -rw-r--r-- | driver/pci.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/driver/pci.c b/driver/pci.c index b5e5791..79f3e24 100644 --- a/driver/pci.c +++ b/driver/pci.c @@ -98,6 +98,7 @@ uint16_t pciCheck(uint8_t bus, uint8_t slot) irq = pciConfigReadWord(bus,slot,0,0x3c); uint8_t header = pciConfigReadWord(bus,slot,0,0xd)&0xff; + klog("[%d,%d]: vendor: 0x%x / device: 0x%x",bus,slot,vendor,device); klog("header_typ=%x, %d,pin=%d , irq=%d",header,irq,irq&0xFf00,irq&0xFf); @@ -105,6 +106,11 @@ uint16_t pciCheck(uint8_t bus, uint8_t slot) // check for: E1000 (82540EM). PCI Ethernet Controller if(vendor==0x8086&&device==0x100e) { + uint16_t command = pciConfigReadWord(bus,slot,0,0x04); + pciConfigSet(bus,slot,0,0x04,command|1<<2); + command = pciConfigReadWord(bus,slot,0,0x04); + + klog("enable busmastering / command register: %04X",command); // uint16_t irq=pciConfigReadWord(bus,slot,0,0x3C); // uint16_t irq2=pciConfigReadWord(bus,slot,0,0x3E); // |
