diff options
author | Anton Kling <anton@kling.gg> | 2024-06-27 22:57:00 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-06-27 22:57:00 +0200 |
commit | 1a51d1d1158fc1b5367452eb0622ab1fd05e80bd (patch) | |
tree | df02c798a06c687da9c401198b05f7dce1370164 /kernel/drivers/rtl8139.c | |
parent | f7b07eabcb33ebf9938907edd2df7f1e9dc46c88 (diff) |
RTL8139: Masking "Transmit OK" interrupts
Diffstat (limited to 'kernel/drivers/rtl8139.c')
-rw-r--r-- | kernel/drivers/rtl8139.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/kernel/drivers/rtl8139.c b/kernel/drivers/rtl8139.c index ff22041..9c163e7 100644 --- a/kernel/drivers/rtl8139.c +++ b/kernel/drivers/rtl8139.c @@ -181,15 +181,22 @@ void rtl8139_init(void) { outl(base_address + RBSTART, rx_buffer); // Set IMR + ISR - // outw(base_address + IMR, (1 << 2) | (1 << 3) | (1 << 0)); - outw(base_address + IMR, (1 << 2) | (1 << 0)); + outw(base_address + IMR, (1 << 0)); // Set transmit and reciever enable outb(base_address + 0x37, (1 << 2) | (1 << 3)); + // TODO: Test these later as I believe they can have performance + // implications but currently the OS seems to be bottlenecked by other + // things. + u8 fifo_threshold = 0; + u8 dma_burst = 0; + + u8 packet_accept = 0xe; // 0xe is AB+AM+APM + // Configure the recieve buffer - outl(base_address + 0x44, - 0xf | ((RTL8139_CHOSEN_BUFFER) << 11)); // 0xf is AB+AM+APM+AAP + outl(base_address + 0x44, packet_accept | ((RTL8139_CHOSEN_BUFFER) << 11) | + (fifo_threshold << 13) | (dma_burst << 8)); install_handler((interrupt_handler)rtl8139_handler, INT_32_INTERRUPT_GATE(0x3), 0x20 + interrupt_line); |