summaryrefslogtreecommitdiff
path: root/libhw_generic
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-12 16:29:37 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-08 08:27:23 -0700
commitd07ade8014628930057f5398fc26b06a527bb4d0 (patch)
tree492e5a416bd2d6a9d701dde323e7643f397b3f37 /libhw_generic
parent957931e0f585b5132bf16e28b7eb3e68aec70d9a (diff)
w5500: Add DEBUG logging
Diffstat (limited to 'libhw_generic')
-rw-r--r--libhw_generic/include/libhw/generic/net.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/libhw_generic/include/libhw/generic/net.h b/libhw_generic/include/libhw/generic/net.h
index 150d199..a016d51 100644
--- a/libhw_generic/include/libhw/generic/net.h
+++ b/libhw_generic/include/libhw/generic/net.h
@@ -7,6 +7,7 @@
#ifndef _LIBHW_GENERIC_NET_H_
#define _LIBHW_GENERIC_NET_H_
+#include <inttypes.h> /* for PRI{u,x}{n} */
#include <stdbool.h> /* for bool */
#include <stddef.h> /* for size_t */
#include <stdint.h> /* for uint{n}_t} */
@@ -31,10 +32,24 @@ struct net_ip4_addr {
static const struct net_ip4_addr net_ip4_addr_broadcast = {{255, 255, 255, 255}};
static const struct net_ip4_addr net_ip4_addr_zero = {{0, 0, 0, 0}};
+#define PRI_net_ip4_addr "%"PRIu8".%"PRIu8".%"PRIu8".%"PRIu8
+#define ARG_net_ip4_addr(addr) (addr).octets[0], \
+ (addr).octets[1], \
+ (addr).octets[2], \
+ (addr).octets[3]
+
struct net_eth_addr {
unsigned char octets[6];
};
+#define PRI_net_eth_addr "%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8
+#define ARG_net_eth_addr(addr) (addr).octets[0], \
+ (addr).octets[1], \
+ (addr).octets[2], \
+ (addr).octets[3], \
+ (addr).octets[4], \
+ (addr).octets[5]
+
/* Streams (e.g. TCP) *********************************************************/
struct net_stream_listener_vtable;