net: hns3: add header file hns3_ethtoo.h
authorGuangbin Huang <huangguangbin2@huawei.com>
Mon, 16 Aug 2021 02:15:28 +0000 (10:15 +0800)
committerJakub Kicinski <kuba@kernel.org>
Mon, 16 Aug 2021 22:12:13 +0000 (15:12 -0700)
Add a new file hns3_ethtool.h, and move struct type definitions from
hns3_ethtool.c to hns3_ethtool.h.

Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.h [new file with mode: 0644]

index c8f09b07185eeb8b0219a937f0133a9dc4bb095d..167721b647adff95305094c94340914b957dafe0 100644 (file)
@@ -7,21 +7,7 @@
 #include <linux/sfp.h>
 
 #include "hns3_enet.h"
-
-struct hns3_stats {
-       char stats_string[ETH_GSTRING_LEN];
-       int stats_offset;
-};
-
-struct hns3_sfp_type {
-       u8 type;
-       u8 ext_type;
-};
-
-struct hns3_pflag_desc {
-       char name[ETH_GSTRING_LEN];
-       void (*handler)(struct net_device *netdev, bool enable);
-};
+#include "hns3_ethtool.h"
 
 /* tqp related stats */
 #define HNS3_TQP_STAT(_string, _member)        {                       \
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.h b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.h
new file mode 100644 (file)
index 0000000..2f18660
--- /dev/null
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+// Copyright (c) 2021 Hisilicon Limited.
+
+#ifndef __HNS3_ETHTOOL_H
+#define __HNS3_ETHTOOL_H
+
+#include <linux/ethtool.h>
+#include <linux/netdevice.h>
+
+struct hns3_stats {
+       char stats_string[ETH_GSTRING_LEN];
+       int stats_offset;
+};
+
+struct hns3_sfp_type {
+       u8 type;
+       u8 ext_type;
+};
+
+struct hns3_pflag_desc {
+       char name[ETH_GSTRING_LEN];
+       void (*handler)(struct net_device *netdev, bool enable);
+};
+
+#endif