From 06eed899486daeec8ad2718c74d70f91fa0dbb25 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sun, 2 Feb 2025 02:01:30 -0700 Subject: libhw_generic: net: Use libobj instead of vcall.h --- cmd/sbc_harness/main.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'cmd/sbc_harness/main.c') diff --git a/cmd/sbc_harness/main.c b/cmd/sbc_harness/main.c index 7b1d5c5..ce80711 100644 --- a/cmd/sbc_harness/main.c +++ b/cmd/sbc_harness/main.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -43,15 +42,6 @@ static COROUTINE hello_world_cr(void *_chan) { cr_end(); } -static COROUTINE dhcp_cr(void *_chip) { - struct w5500 *chip = _chip; - cr_begin(); - - dhcp_client_main(chip, "harness"); - - cr_end(); -} - struct { struct rp2040_hwspi dev_spi; struct w5500 dev_w5500; @@ -60,11 +50,19 @@ struct { struct lib9p_srv srv; } globals; +static COROUTINE dhcp_cr(void *) { + cr_begin(); + + dhcp_client_main(lo_box_w5500_if_as_net_iface(&globals.dev_w5500), "harness"); + + cr_end(); +} + static COROUTINE read9p_cr(void *) { cr_begin(); lib9p_srv_read_cr(&globals.srv, - VCALL(&globals.dev_w5500, tcp_listen, CONFIG_9P_PORT)); + LO_CALL(lo_box_w5500_if_as_net_iface(&globals.dev_w5500), tcp_listen, CONFIG_9P_PORT)); cr_end(); } @@ -120,7 +118,7 @@ COROUTINE init_cr(void *) { coroutine_add("usb_common", usb_common_cr, NULL); coroutine_add("usb_keyboard", usb_keyboard_cr, &globals.keyboard_chan); coroutine_add("hello_world", hello_world_cr, &globals.keyboard_chan); - coroutine_add_with_stack_size(4*1024, "dhcp", dhcp_cr, &globals.dev_w5500); + coroutine_add_with_stack_size(4*1024, "dhcp", dhcp_cr, NULL); for (int i = 0; i < _CONFIG_9P_NUM_SOCKS; i++) { char name[] = {'r', 'e', 'a', 'd', '-', hexdig[i], '\0'}; coroutine_add(name, read9p_cr, NULL); -- cgit v1.2.3-2-g168b