summaryrefslogtreecommitdiff
path: root/cmd/sbc_harness/hw/w5500.h
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-17 22:33:58 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-17 22:33:58 -0600
commitfcc4852960d3f92b3aa55cc98e627ae8e648d625 (patch)
tree7b66efc17f3febd9be60adeee1a2e8443919b5c4 /cmd/sbc_harness/hw/w5500.h
parentf132dab76a07473d41e14f5f4fb1857a3229ec6a (diff)
wip w5500
Diffstat (limited to 'cmd/sbc_harness/hw/w5500.h')
-rw-r--r--cmd/sbc_harness/hw/w5500.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/cmd/sbc_harness/hw/w5500.h b/cmd/sbc_harness/hw/w5500.h
index 4ec6edd..f8a7034 100644
--- a/cmd/sbc_harness/hw/w5500.h
+++ b/cmd/sbc_harness/hw/w5500.h
@@ -14,25 +14,28 @@
struct _w5500_listener;
struct _w5500_conn {
+ /* const-after-init */
implements_net_conn;
-
- struct _w5500_listener *parent_listener;
};
struct _w5500_listener {
+ /* const-after-init */
implements_net_listener;
-
- struct w5500 *chip;
uint8_t socknum;
struct _w5500_conn active_conn;
+
+ /* mutable */
+ uint16_t port;
};
struct w5500 {
+ /* const-after-init */
struct spi *spidev;
uint pin_reset;
- struct _w5500_listener _listeners[8];
- uint16_t _next_local_port;
+ /* mutable */
+ uint16_t next_local_port;
+ struct _w5500_listener listeners[8];
};
/**
@@ -61,7 +64,7 @@ void _w5500_init(struct w5500 *self,
/**
* TODO.
*/
-void w5500_reset(struct w5500 *self);
+void w5500_reset(struct w5500 *self, struct net_eth_addr addr);
struct w5500_netcfg {
struct net_ip4_addr gateway_addr;
@@ -74,6 +77,7 @@ struct w5500_netcfg {
*/
void w5500_netcfg(struct w5500 *self, struct w5500_netcfg cfg);
-implements_net_listener *w5500_listen(struct w5500 *self, uint8_t socknum, uint16_t port);
+implements_net_listener *w5500_listen(struct w5500 *self, uint8_t socknum,
+ uint16_t port);
#endif /* _HW_W5500_H_ */