summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/sbc_harness/hw/w5500.c22
-rw-r--r--cmd/sbc_harness/hw/w5500_ll.h2
-rw-r--r--cmd/srv9p/gnet.c14
-rw-r--r--cmd/srv9p/main.c10
4 files changed, 25 insertions, 23 deletions
diff --git a/cmd/sbc_harness/hw/w5500.c b/cmd/sbc_harness/hw/w5500.c
index 6b90b99..a6cdc8b 100644
--- a/cmd/sbc_harness/hw/w5500.c
+++ b/cmd/sbc_harness/hw/w5500.c
@@ -84,14 +84,15 @@
* net.ipv4.ip_local_port_range, so I figure they're probably good
* values to use. */
#ifndef CONFIG_W5500_LOCAL_PORT_MIN
-# define CONFIG_W5500_LOCAL_PORT_MIN 32768
+ #define CONFIG_W5500_LOCAL_PORT_MIN 32768
#endif
+
#ifndef CONFIG_W5500_LOCAL_PORT_MAX
-# define CONFIG_W5500_LOCAL_PORT_MAX 60999
+ #define CONFIG_W5500_LOCAL_PORT_MAX 60999
#endif
#ifndef CONFIG_W5500_NUM
-# error config.h must define CONFIG_W5500_NUM
+ #error config.h must define CONFIG_W5500_NUM
#endif
/* C language *****************************************************************/
@@ -101,13 +102,14 @@
/* mid-level utilities ********************************************************/
-/*static uint16_t w5500_get_local_port(struct w5500 *self) {
- * uint16_t ret = self->next_local_port++;
- * if (self->next_local_port > CONFIG_W5500_LOCAL_PORT_MAX)
- * self->next_local_port = CONFIG_W5500_LOCAL_PORT_MIN;
- * return ret;
- *}
- */
+#if 0
+static uint16_t w5500_get_local_port(struct w5500 *self) {
+ uint16_t ret = self->next_local_port++;
+ if (self->next_local_port > CONFIG_W5500_LOCAL_PORT_MAX)
+ self->next_local_port = CONFIG_W5500_LOCAL_PORT_MIN;
+ return ret;
+}
+#endif
static COROUTINE w5500_irq_cr(void *_chip) {
struct w5500 *chip = _chip;
diff --git a/cmd/sbc_harness/hw/w5500_ll.h b/cmd/sbc_harness/hw/w5500_ll.h
index 7c57ce8..4cc3b11 100644
--- a/cmd/sbc_harness/hw/w5500_ll.h
+++ b/cmd/sbc_harness/hw/w5500_ll.h
@@ -236,7 +236,7 @@ static_assert(sizeof(struct w5500ll_block_sock_reg) == 0x30);
*
* TCP state diagram, showing the flow of │ CLOSED │ ━━ role separator ┌───────┐
* SYN, FIN, and their assocaited ACKs. └────────┘ ══ state transition │ state │
- * V ┈┈ packet flow └───────┘
+ * V ┈┈ packet flow └───────┘
* (CMD_OPEN) ║
* V (action/event)
* ┌────────┐
diff --git a/cmd/srv9p/gnet.c b/cmd/srv9p/gnet.c
index 39ad9b2..699deaf 100644
--- a/cmd/srv9p/gnet.c
+++ b/cmd/srv9p/gnet.c
@@ -50,14 +50,14 @@ static void gnet_init(void) {
error(1, errno, "sigaction");
}
-#define WAKE_COROUTINE(args) do { \
- int r; \
- union sigval val = {0}; \
- val.sival_int = (int)((args)->cr_coroutine); \
- do { \
+#define WAKE_COROUTINE(args) do { \
+ int r; \
+ union sigval val = {0}; \
+ val.sival_int = (int)((args)->cr_coroutine); \
+ do { \
r = pthread_sigqueue((args)->cr_thread, gnet_sig_io, val); \
- assert(r == 0 || r == EAGAIN); \
- } while (r == EAGAIN); \
+ assert(r == 0 || r == EAGAIN); \
+ } while (r == EAGAIN); \
} while (0)
static inline bool RUN_PTHREAD(void *(*fn)(void *), void *args) {
diff --git a/cmd/srv9p/main.c b/cmd/srv9p/main.c
index 7ed985f..a2b437e 100644
--- a/cmd/srv9p/main.c
+++ b/cmd/srv9p/main.c
@@ -20,7 +20,7 @@
#include "config.h"
#ifndef CONFIG_NETIO_NUM_CONNS
-# error config.h must define CONFIG_NETIO_NUM_CONNS
+ #error config.h must define CONFIG_NETIO_NUM_CONNS
#endif
/* implementation *************************************************************/
@@ -31,11 +31,11 @@
#define FILE_COMMON(NAME) { \
.vtable = &static_file_vtable, \
- \
+ \
.u_name = "root", .u_num = 0, /* owner user */ \
.g_name = "root", .g_num = 0, /* owner group */ \
.m_name = "root", .m_num = 0, /* last-modified-by user */ \
- \
+ \
.pathnum = __COUNTER__, \
.name = NAME, \
.perm = 0444, \
@@ -45,11 +45,11 @@
#define DIR_COMMON(NAME) { \
.vtable = &static_dir_vtable, \
- \
+ \
.u_name = "root", .u_num = 0, /* owner user */ \
.g_name = "root", .g_num = 0, /* owner group */ \
.m_name = "root", .m_num = 0, /* last-modified-by user */ \
- \
+ \
.pathnum = __COUNTER__, \
.name = NAME, \
.perm = 0555, \