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
8
static
u32
9
virtio_iob;
// Store BAR0 base I/O address globally or pass appropriately
10
11
void
VirtnetIrqHandler
() {
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
}
Inb
u8 Inb(u16 port)
Read a byte from the specified I/O port.
Definition
asm.c:40
idtirq.h
kio.h
kmem.h
nums.h
u32
unsigned int u32
32-Bit Unsigned Int
Definition
nums.h:30
u8
unsigned char u8
8-Bit Unsigned Int
Definition
nums.h:32
pci.h
NetStq
void NetStq(u32 iob)
Processes received packets from the VirtIO queue.
Definition
virtio.c:138
virtnet.h
VirtnetIrqHandler
void VirtnetIrqHandler()
Definition
virtnetirq.c:11
src
idt
handlers
virtnetirq.c
Generated on
for WKern by
1.14.0