From 7ec97df3ee8edfd102fe573eaa61cf4e5c6284cb Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Fri, 27 Sep 2024 22:27:01 -0600 Subject: wip fixes --- cmd/sbc_harness/usb_keyboard.c | 5 +++-- cmd/srv9p/main.c | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'cmd') diff --git a/cmd/sbc_harness/usb_keyboard.c b/cmd/sbc_harness/usb_keyboard.c index 3cf0bb3..5482fdc 100644 --- a/cmd/sbc_harness/usb_keyboard.c +++ b/cmd/sbc_harness/usb_keyboard.c @@ -11,6 +11,8 @@ #include "usb_keyboard.h" +#define UNUSED(name) /* name __attribute__ ((unused)) */ + /** * A USB-HID "Report Descriptor" (see USB-HID 1.11 ยง6.2.2 "Report * Descriptor") describing a keyboard. @@ -107,8 +109,7 @@ uint16_t tud_hid_get_report_cb(uint8_t instance, uint8_t report_id, hid_report_t // Invoked when received SET_REPORT control request or // received data on OUT endpoint ( Report ID = 0, Type = 0 ) -void tud_hid_set_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize) +void tud_hid_set_report_cb(uint8_t UNUSED(instance), uint8_t UNUSED(report_id), hid_report_type_t UNUSED(report_type), uint8_t const *UNUSED(buffer), uint16_t UNUSED(bufsize)) { // TODO not implemented - (void) report_id; } diff --git a/cmd/srv9p/main.c b/cmd/srv9p/main.c index d63c5fb..2c403df 100644 --- a/cmd/srv9p/main.c +++ b/cmd/srv9p/main.c @@ -2,16 +2,27 @@ #include #include +#include #include +#define USE_CONFIG_COROUTINE +#include "config.h" + int main() { int sock = netio_listen(9000); if (sock < 0) error(1, -sock, "netio_listen"); - for (int i = 0; i < 8; i++) - if (!coroutine_add(net9p_cr, &sock)) - error(1, 0, "coroutine_add(net9p_cr, NULL)"); + struct lib9p_srv srv = { + .sockfd = sock, + }; + + for (int i = 0; i < CONFIG_NETIO_NUM_CONNS; i++) + if (!coroutine_add(lib9p_srv_read_cr, &srv)) + error(1, 0, "coroutine_add(lib9p_srv_read_cr, &srv)"); + for (int i = 0; i < 2*CONFIG_NETIO_NUM_CONNS; i++) + if (!coroutine_add(lib9p_srv_write_cr, &srv)) + error(1, 0, "coroutine_add(lib9p_srv_write_cr, &srv)"); coroutine_main(); return 1; -- cgit v1.2.3-2-g168b