From 468ef8f1d57527af3fe8b67bbc73813e951a0ec5 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 17 Aug 2024 01:57:04 +0200 Subject: kernel: split the kernel/user inputs in VfsReq I think I've done this refactor in the opposite direction a few years ago. This is mostly meant to prepare me for setxattr, which requires two inputs - coincidentally, one is already going to be a kernel input, and the other will be an user input, so it works out. I also just didn't like the previous way it worked, this feels cleaner. --- src/kernel/arch/amd64/driver/rtl8139.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/kernel/arch/amd64/driver/rtl8139.c') diff --git a/src/kernel/arch/amd64/driver/rtl8139.c b/src/kernel/arch/amd64/driver/rtl8139.c index c952d8a..c739527 100644 --- a/src/kernel/arch/amd64/driver/rtl8139.c +++ b/src/kernel/arch/amd64/driver/rtl8139.c @@ -204,7 +204,7 @@ static void accept(VfsReq *req) { ret = req_readcopy(req, data, sizeof data); vfsreq_finish_short(req, ret); } else if (id == HandleNet) { - ret = try_rx(req->caller, req->output.buf, req->output.len); + ret = try_rx(req->caller, req->out, req->outlen); if (ret == WAIT) { reqqueue_join(&blocked_on, req); rx_irq_enable(true); @@ -218,8 +218,7 @@ static void accept(VfsReq *req) { break; case VFSOP_WRITE: if (id == HandleNet) { - assert(!req->input.kern); - vfsreq_finish_short(req, try_tx(req->caller, req->input.buf, req->input.len)); + vfsreq_finish_short(req, try_tx(req->caller, req->uin, req->uinlen)); } else { vfsreq_finish_short(req, -ENOSYS); } -- cgit v1.2.3