summaryrefslogtreecommitdiff
path: root/src/kernel/arch/amd64/driver/rtl8139.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/arch/amd64/driver/rtl8139.c')
-rw-r--r--src/kernel/arch/amd64/driver/rtl8139.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/kernel/arch/amd64/driver/rtl8139.c b/src/kernel/arch/amd64/driver/rtl8139.c
index a005df5..bce1071 100644
--- a/src/kernel/arch/amd64/driver/rtl8139.c
+++ b/src/kernel/arch/amd64/driver/rtl8139.c
@@ -13,7 +13,7 @@
static void accept(VfsReq *req);
static void rtl8139_irq(void);
-static VfsReq *blocked_on = NULL;
+static ReqQueue blocked_on;
enum {
@@ -86,6 +86,8 @@ void rtl8139_init(uint32_t bdf) {
mac[i] = port_in8(iobase + Mac + i);
}
+ postqueue_init(&blocked_on);
+
vfs_root_register("/dev/eth/", accept);
}
@@ -100,7 +102,10 @@ static void rtl8139_irq(void) {
/* bit 0 of cmd - Rx Buffer Empty
* not a do while() because sometimes the bit is empty on IRQ. no clue why. */
while (!(port_in8(iobase + Cmd) & 1)) {
- if (!postqueue_pop(&blocked_on, accept)) {
+ VfsReq *req = postqueue_pop(&blocked_on);
+ if (req) {
+ accept(req);
+ } else {
rx_irq_enable(false);
break;
}