summaryrefslogtreecommitdiff
path: root/cmd/sbc_harness/hw/w5500.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-16 19:41:10 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-16 19:41:10 -0600
commit46a33d3304ff01f431122a2849e86837c8f6d87d (patch)
tree49325705964d043dc247d715a88bedaafe218b4e /cmd/sbc_harness/hw/w5500.c
parente0085b57347bb3eec06f84abf37be3ae590e75f7 (diff)
wip w5500
Diffstat (limited to 'cmd/sbc_harness/hw/w5500.c')
-rw-r--r--cmd/sbc_harness/hw/w5500.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/cmd/sbc_harness/hw/w5500.c b/cmd/sbc_harness/hw/w5500.c
index d896480..7bb9895 100644
--- a/cmd/sbc_harness/hw/w5500.c
+++ b/cmd/sbc_harness/hw/w5500.c
@@ -56,10 +56,10 @@
/* Part 1: Block ID. */
#define CTL_MASK_BLOCK 0b11111000
-#define _CTL_BLOCK_RES (0b00000)
-#define _CTL_BLOCK_REG (0b01000)
-#define _CTL_BLOCK_TX (0b10000)
-#define _CTL_BLOCK_RX (0b11000)
+#define _CTL_BLOCK_RES 0b00000
+#define _CTL_BLOCK_REG 0b01000
+#define _CTL_BLOCK_TX 0b10000
+#define _CTL_BLOCK_RX 0b11000
#define CTL_BLOCK_SOCK(n,part) (((n)<<5)|(_CTL_BLOCK_##part))
#define CTL_BLOCK_COMMON_REG CTL_BLOCK_SOCK(0,RES)
@@ -431,14 +431,14 @@ struct libnet_listener *w5500_listen(struct w5500 *chip, uint8_t socknum, uint16
/* accept() *******************************************************************/
-#define ASSERT_LISTENER() \
+#define ASSERT_LISTENER() \
struct _w5500_listener *self = (struct _w5500_listener *)_self; \
- assert(self); \
- \
- struct w5500 *chip = self->chip; \
- uint8_t socknum = self->socknum; \
- assert(chip); \
- assert(socknum < 8) \
+ assert(self); \
+ \
+ struct w5500 *chip = self->chip; \
+ uint8_t socknum = self->socknum; \
+ assert(chip); \
+ assert(socknum < 8)
static struct libnet_conn *w5500_accept(struct libnet_listener *_self) {
ASSERT_LISTENER();
@@ -470,7 +470,6 @@ static struct libnet_conn *w5500_accept(struct libnet_listener *_self) {
assert(chip); \
assert(socknum < 8)
-
static ssize_t w5500_write(struct libnet_conn *_self, void *buf, size_t count) {
ASSERT_CONN();
assert(buf);