summaryrefslogtreecommitdiff
path: root/libhw/w5500_ll.h
diff options
context:
space:
mode:
Diffstat (limited to 'libhw/w5500_ll.h')
-rw-r--r--libhw/w5500_ll.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/libhw/w5500_ll.h b/libhw/w5500_ll.h
index db66f01..c70da0d 100644
--- a/libhw/w5500_ll.h
+++ b/libhw/w5500_ll.h
@@ -10,17 +10,16 @@
#ifndef _LIBHW_W5500_LL_H_
#define _LIBHW_W5500_LL_H_
-#include <assert.h> /* for assert(), static_assert() */
#include <stdint.h> /* for uint{n}_t */
#include <string.h> /* for memcmp() */
-#include <libmisc/vcall.h> /* for VCALL() */
+#include <libmisc/assert.h> /* for assert(), static_assert() */
#include <libmisc/endian.h> /* for uint16be_t */
+#include <libmisc/vcall.h> /* for VCALL() */
#include <libhw/generic/net.h> /* for struct net_eth_addr, struct net_ip4_addr */
#include <libhw/generic/spi.h> /* for implements_spi */
-
/* Low-level protocol built on SPI frames. ***********************************/
/* A u8 control byte has 3 parts: block-ID, R/W, and operating-mode. */
@@ -198,13 +197,13 @@ static_assert(sizeof(struct w5500ll_block_sock_reg) == 0x30);
#define SOCKMODE_FLAG_UDP_ENABLE_MULTICAST ((uint8_t)(1<<7))
#define SOCKMODE_FLAG_UDP_BLOCK_BROADCAST ((uint8_t)(1<<6))
-#define SOCKMODE_FLAG_UDP_MULTICAST_DOWNGRADE ((uint8_t)(1<<5))
+#define SOCKMODE_FLAG_UDP_MULTICAST_DOWNGRADE ((uint8_t)(1<<5)) /* Use IGMPv1 instead of v2 */
#define SOCKMODE_FLAG_UDP_BLOCK_UNICAST ((uint8_t)(1<<4))
#define SOCKMODE_FLAG_MACRAW_MAC_FILTERING ((uint8_t)(1<<7))
#define SOCKMODE_FLAG_MACRAW_BLOCK_BROADCAST ((uint8_t)(1<<6))
#define SOCKMODE_FLAG_MACRAW_BLOCK_MULTICAST ((uint8_t)(1<<5))
-#define SOCKMODE_FLAG_MACRAW_BLOCK_V6 ((uint8_t)(1<<4))
+#define SOCKMODE_FLAG_MACRAW_BLOCK_IPV6 ((uint8_t)(1<<4))
#define CMD_OPEN ((uint8_t)0x01)
#define CMD_LISTEN ((uint8_t)0x02) /* TCP-only */
@@ -219,10 +218,10 @@ static_assert(sizeof(struct w5500ll_block_sock_reg) == 0x30);
#define _SOCKINTR_SEND_UNUSED7 ((uint8_t)1<<7)
#define _SOCKINTR_SEND_UNUSED6 ((uint8_t)1<<6)
#define _SOCKINTR_SEND_UNUSED5 ((uint8_t)1<<5)
-#define SOCKINTR_SEND_OK ((uint8_t)1<<4)
-#define SOCKINTR_TIMEOUT ((uint8_t)1<<3)
-#define SOCKINTR_RECV ((uint8_t)1<<2)
-#define SOCKINTR_FIN ((uint8_t)1<<1)
+#define SOCKINTR_SEND_OK ((uint8_t)1<<4) /* TODO: determine precise meaning */
+#define SOCKINTR_SEND_TIMEOUT ((uint8_t)1<<3) /* ARP or TCP */
+#define SOCKINTR_RECV_DAT ((uint8_t)1<<2) /* received data */
+#define SOCKINTR_RECV_FIN ((uint8_t)1<<1) /* received FIN */
#define SOCKINTR_CONN ((uint8_t)1<<1) /* first for SYN, then when SOCKMODE_ESTABLISHED */
#define STATE_CLOSED ((uint8_t)0x00)