summaryrefslogtreecommitdiff
path: root/src/kernel/arch
diff options
context:
space:
mode:
authordzwdz2022-08-17 18:05:43 +0200
committerdzwdz2022-08-17 18:05:43 +0200
commit5abcc66cb6e83f02b5218802d3eca74c0d29bebf (patch)
treeaba71091a8ef27723c7bd3c013331fc4970f9f9e /src/kernel/arch
parente05938ac4acd42d8acac123a880cae9582a93611 (diff)
user/net: answer to ARP
Diffstat (limited to 'src/kernel/arch')
-rw-r--r--src/kernel/arch/amd64/driver/rtl8139.c6
-rw-r--r--src/kernel/arch/amd64/pci.c2
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);
}
}