105 lines
3.1 KiB
Diff
105 lines
3.1 KiB
Diff
From 1218ed8abcc882c290e50e71d16bb799ab8f7603 Mon Sep 17 00:00:00 2001
|
|
From: Guangbin Huang <huangguangbin2@huawei.com>
|
|
Date: Sat, 21 Aug 2021 17:00:40 +0800
|
|
Subject: [PATCH 100/283] net: hns3: add header file hns3_ethtoo.h
|
|
|
|
mainline inclusion
|
|
from mainline-v5.15-rc1
|
|
commit edb40bbc17eb589beb3cbd672d341e1505d6cdb1
|
|
category: feature
|
|
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I8EMYT
|
|
CVE: NA
|
|
|
|
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=edb40bbc17eb589beb3cbd672d341e1505d6cdb1
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
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>
|
|
Reviewed-by: Yongxin Li <liyongxin1@huawei.com>
|
|
Signed-off-by: Junxin Chen <chenjunxin1@huawei.com>
|
|
Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com>
|
|
Signed-off-by: Xiaodong Li <lixiaodong67@huawei.com>
|
|
|
|
Conflicts:
|
|
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
|
|
---
|
|
.../ethernet/hisilicon/hns3/hns3_ethtool.c | 24 ++++--------------
|
|
.../ethernet/hisilicon/hns3/hns3_ethtool.h | 25 +++++++++++++++++++
|
|
2 files changed, 30 insertions(+), 19 deletions(-)
|
|
create mode 100644 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.h
|
|
|
|
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
|
|
index 4197d40471f4..d4d5474d0f09 100644
|
|
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
|
|
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
|
|
@@ -6,26 +6,12 @@
|
|
#include <linux/phy.h>
|
|
#include "kcompat.h"
|
|
#include "hns3_enet.h"
|
|
+#include "hns3_ethtool.h"
|
|
|
|
-struct hns3_stats {
|
|
- char stats_string[ETH_GSTRING_LEN];
|
|
- int stats_offset;
|
|
-};
|
|
-
|
|
-#define HNS3_MODULE_TYPE_QSFP 0x0C
|
|
-#define HNS3_MODULE_TYPE_QSFP_P 0x0D
|
|
-#define HNS3_MODULE_TYPE_QSFP_28 0x11
|
|
-#define HNS3_MODULE_TYPE_SFP 0x03
|
|
-
|
|
-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);
|
|
-};
|
|
+#define HNS3_MODULE_TYPE_QSFP 0x0C
|
|
+#define HNS3_MODULE_TYPE_QSFP_P 0x0D
|
|
+#define HNS3_MODULE_TYPE_QSFP_28 0x11
|
|
+#define HNS3_MODULE_TYPE_SFP 0x03
|
|
|
|
/* 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
|
|
index 000000000000..2f186607c6e0
|
|
--- /dev/null
|
|
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.h
|
|
@@ -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
|
|
--
|
|
2.34.1
|
|
|