WKern
Loading...
Searching...
No Matches
virtnetirq.c
Go to the documentation of this file.
1#include <idt/idtirq.h> // Your IDT and IRQ helper headers
2#include <io/kio.h>
3#include <mem/kmem.h>
4#include <net/virtnet.h>
5#include <pci/pci.h>
6#include <types/nums.h>
7
8static u32
9 virtio_iob; // Store BAR0 base I/O address globally or pass appropriately
10
12 // Read ISR to acKnowledge interrupt from VirtIO device
13 u8 isr = Inb(virtio_iob + 0x13);
14
15 if (isr & 0x1) {
16 // Call your pacKet handler to process used buffers
17 NetStq(virtio_iob);
18 }
19}
u8 Inb(u16 port)
Read a byte from the specified I/O port.
Definition asm.c:40
unsigned int u32
32-Bit Unsigned Int
Definition nums.h:30
unsigned char u8
8-Bit Unsigned Int
Definition nums.h:32
void NetStq(u32 iob)
Processes received packets from the VirtIO queue.
Definition virtio.c:138
void VirtnetIrqHandler()
Definition virtnetirq.c:11