git: cc792250acad - main - LinuxKPI: add three skeleton functions to etherdevice.h

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Tue, 21 Oct 2025 07:53:08 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=cc792250acadd29e80a69501ad326d1340c0c1c6

commit cc792250acadd29e80a69501ad326d1340c0c1c6
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-10-11 09:22:48 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-10-21 07:49:38 +0000

    LinuxKPI: add three skeleton functions to etherdevice.h
    
    We will see how much we will need them and how to fill them at that
    point.  They are left with a pr_debug("TODO") for now.
    
    MFC after:      3 days
    Differential Revision: https://reviews.freebsd.org/D53204
---
 .../linuxkpi/common/include/linux/etherdevice.h    | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/etherdevice.h b/sys/compat/linuxkpi/common/include/linux/etherdevice.h
index 1f2d6cf22d7e..b9a4951de8ac 100644
--- a/sys/compat/linuxkpi/common/include/linux/etherdevice.h
+++ b/sys/compat/linuxkpi/common/include/linux/etherdevice.h
@@ -27,6 +27,8 @@
 
 #include <linux/types.h>
 #include <linux/device.h>
+#include <linux/skbuff.h>
+#include <linux/netdevice.h>
 
 #include <sys/random.h>
 #include <sys/libkern.h>
@@ -137,4 +139,25 @@ device_get_mac_address(struct device *dev, char *dst)
 	return (-ENOENT);
 }
 
+/* Returns network byte order. */
+static inline uint16_t
+eth_type_trans(struct sk_buff *skb, struct net_device *dev)
+{
+	pr_debug("%s: TODO\n", __func__);
+	return (htons(ETHERTYPE_8023));
+}
+
+static inline void
+eth_hw_addr_set(struct net_device *dev, const u8 *addr)
+{
+	pr_debug("%s: TODO (if we want to)\n", __func__);
+}
+
+static inline int
+eth_platform_get_mac_address(struct device *dev __unused, u8 *addr __unused)
+{
+	pr_debug("%s: TODO\n", __func__);
+	return (-ENODEV);
+}
+
 #endif					/* _LINUXKPI_LINUX_ETHERDEVICE_H_ */