diff options
Diffstat (limited to 'src/kernel/arch')
-rw-r--r-- | src/kernel/arch/amd64/driver/rtl8139.c | 6 | ||||
-rw-r--r-- | src/kernel/arch/amd64/pci.c | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/kernel/arch/amd64/driver/rtl8139.c b/src/kernel/arch/amd64/driver/rtl8139.c index 5b09027..428d675 100644 --- a/src/kernel/arch/amd64/driver/rtl8139.c +++ b/src/kernel/arch/amd64/driver/rtl8139.c @@ -39,7 +39,7 @@ static size_t rxpos; static char txbuf[4][txbuf_len]; static void rx_irq_enable(bool v) { - uint16_t mask = 1 | 4; /* rx/tx ok */ + uint16_t mask = 1; /* rx ok */ port_out16(iobase + INTRMASK, v ? mask : 0); } @@ -85,11 +85,11 @@ void rtl8139_init(uint32_t bdf) { void rtl8139_irq(void) { uint16_t status = port_in16(iobase + INTRSTATUS); - if (status != 1) { + if (!(status & 1)) { kprintf("bad rtl8139 status 0x%x\n", status); panic_unimplemented(); } - // TODO don't assume this is an rx irq + status &= 1; do { if (blocked_on) { diff --git a/src/kernel/arch/amd64/pci.c b/src/kernel/arch/amd64/pci.c index 93fffec..92e2697 100644 --- a/src/kernel/arch/amd64/pci.c +++ b/src/kernel/arch/amd64/pci.c @@ -60,9 +60,7 @@ static void scan_bus(uint32_t bus) { } if (id == 0x813910ec) { - kprintf("rtl irq %u\n", pcicfg_r8(bdf, 0x3C)); pcicfg_w32(bdf, 0x3C, IRQ_RTL8139); - kprintf("rtl irq %u\n", pcicfg_r8(bdf, 0x3C)); rtl8139_init(bdf); } } |