git: 2078d0ea1e9f - stable/13 - LinuxKPI: ethtool.h add more definitions

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Wed, 18 Jan 2023 16:24:45 UTC
The branch stable/13 has been updated by bz:

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

commit 2078d0ea1e9f3c18422c30725687e7f861c2e560
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-10-30 17:07:49 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-01-18 13:23:55 +0000

    LinuxKPI: ethtool.h add more definitions
    
    While we do not currently use ethtool, add the definitions to avoid
    other longer-term maintenance problems with drivers.
    
    Also migrate ETH_GSTRING_LEN into here from if_ether.h as it seems this
    is where it belongs.
    
    Differential Revision: https://reviews.freebsd.org/D37214
    
    (cherry picked from commit 1b91eba37b294fd191a9dc79a80f52495af9418d)
---
 sys/compat/linuxkpi/common/include/linux/ethtool.h  | 20 +++++++++++++++++++-
 sys/compat/linuxkpi/common/include/linux/if_ether.h |  2 --
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/ethtool.h b/sys/compat/linuxkpi/common/include/linux/ethtool.h
index 9195766f752d..99f5219d0187 100644
--- a/sys/compat/linuxkpi/common/include/linux/ethtool.h
+++ b/sys/compat/linuxkpi/common/include/linux/ethtool.h
@@ -32,10 +32,28 @@
 
 #include <linux/types.h>
 
-#define	ETHTOOL_FWVERS_LEN	64
+#define	ETH_GSTRING_LEN	(2 * IF_NAMESIZE)	/* Increase if not large enough */
+
+#define	ETHTOOL_FWVERS_LEN	32
 
 struct ethtool_stats {
 	uint8_t __dummy[0];
 };
 
+enum ethtool_ss {
+	ETH_SS_STATS,
+};
+
+struct ethtool_drvinfo {
+	char			driver[32];
+	char			version[32];
+	char			fw_version[ETHTOOL_FWVERS_LEN];
+	char			bus_info[32];
+};
+
+struct net_device;
+struct ethtool_ops {
+	void(*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);
+};
+
 #endif	/* _LINUXKPI_LINUX_ETHTOOL_H_ */
diff --git a/sys/compat/linuxkpi/common/include/linux/if_ether.h b/sys/compat/linuxkpi/common/include/linux/if_ether.h
index c27583e62ebd..cb3e34a0823f 100644
--- a/sys/compat/linuxkpi/common/include/linux/if_ether.h
+++ b/sys/compat/linuxkpi/common/include/linux/if_ether.h
@@ -71,6 +71,4 @@ struct ethhdr {
 	uint16_t	h_proto;
 } __packed;
 
-#define	ETH_GSTRING_LEN	(2 * IF_NAMESIZE)	/* Increase if not large enough */
-
 #endif	/* _LINUXKPI_LINUX_IF_ETHER_H_ */