提交 2df8a295 编写于 作者: X Xue 提交者: Xie XiuQi

net: hinic: Add ethtool support

driver inclusion
category:feature
bugzilla:4472
CVE:NA
------------------------------------------------------------------

Add ethtool support, we support almost all the ethtool command
Reviewed-by: NChiqijun <chiqijun@huawei.com>
Signed-off-by: NXue <xuechaojing@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 6cb2e756
......@@ -8,4 +8,5 @@ hinic-y := hinic_nic_cfg.o hinic_nic_io.o hinic_nic_dbg.o \
hinic_sml_counter.o hinic_sml_lt.o \
hinic_multi_host_mgmt.o hinic_main.o hinic_lld.o \
hinic_qp.o hinic_rx.o hinic_tx.o hinic_dbgtool_knl.o \
hinic_nictool.o hinic_sriov.o hinic_dcb.o
hinic_nictool.o hinic_sriov.o hinic_dcb.o\
hinic_ethtool.o
......@@ -293,7 +293,7 @@ int hinic_setup_tc(struct net_device *netdev, u8 tc)
return -EFAULT;
}
} else {
/* will implement hinic_update_num_qps() in next patch */
hinic_update_num_qps(netdev);
}
hinic_configure_dcb(netdev);
......
此差异已折叠。
......@@ -2305,13 +2305,13 @@ static void hinic_assign_netdev_ops(struct hinic_nic_dev *adapter)
#endif /* HAVE_RHEL6_NET_DEVICE_OPS_EXT */
if (FUNC_SUPPORT_DCB(adapter->hwdev))
adapter->netdev->dcbnl_ops = &hinic_dcbnl_ops;
/* Will implement hinic_set_ethtool_ops() in next patch. */
hinic_set_ethtool_ops(adapter->netdev);
} else {
adapter->netdev->netdev_ops = &hinicvf_netdev_ops;
#ifdef HAVE_RHEL6_NET_DEVICE_OPS_EXT
set_netdev_ops_ext(adapter->netdev, &hinicvf_netdev_ops_ext);
#endif /* HAVE_RHEL6_NET_DEVICE_OPS_EXT */
/* Will implement hinic_set_ethtool_ops() in next patch. */
hinicvf_set_ethtool_ops(adapter->netdev);
}
adapter->netdev->watchdog_timeo = 5 * HZ;
}
......
......@@ -257,6 +257,9 @@ int hinic_open(struct net_device *netdev);
int hinic_close(struct net_device *netdev);
int nic_ioctl(void *uld_dev, u32 cmd, void *buf_in,
u32 in_size, void *buf_out, u32 *out_size);
void hinic_set_ethtool_ops(struct net_device *netdev);
void hinicvf_set_ethtool_ops(struct net_device *netdev);
void hinic_update_num_qps(struct net_device *netdev);
int hinic_force_port_disable(struct hinic_nic_dev *nic_dev);
int hinic_force_set_port_state(struct hinic_nic_dev *nic_dev, bool enable);
......
......@@ -779,7 +779,7 @@ static int get_sset_count(struct hinic_nic_dev *nic_dev, void *buf_in,
switch (*((u32 *)buf_in)) {
case HINIC_SHOW_SSET_IO_STATS:
count = 0;
count = hinic_get_io_stats_size(nic_dev);
break;
default:
......@@ -818,6 +818,7 @@ static int get_sset_stats(struct hinic_nic_dev *nic_dev, void *buf_in,
switch (sset) {
case HINIC_SHOW_SSET_IO_STATS:
hinic_get_io_stats(nic_dev, items);
break;
default:
......
......@@ -235,5 +235,8 @@ struct hinic_pf_info {
int nictool_k_init(void);
void nictool_k_uninit(void);
extern u32 hinic_get_io_stats_size(struct hinic_nic_dev *nic_dev);
extern void hinic_get_io_stats(struct hinic_nic_dev *nic_dev,
struct hinic_show_item *items);
#endif
......@@ -47,43 +47,43 @@
#define __GFP_COMP 0
#endif
#ifndef SUPPORTED_100000BASEKR4_Full
#define SUPPORTED_100000BASEKR4_Full 0
#define ADVERTISED_100000BASEKR4_Full 0
#ifndef SUPPORTED_100000baseKR4_Full
#define SUPPORTED_100000baseKR4_Full 0
#define ADVERTISED_100000baseKR4_Full 0
#endif
#ifndef SUPPORTED_100000BASECR4_Full
#define SUPPORTED_100000BASECR4_Full 0
#define ADVERTISED_100000BASECR4_Full 0
#ifndef SUPPORTED_100000baseCR4_Full
#define SUPPORTED_100000baseCR4_Full 0
#define ADVERTISED_100000baseCR4_Full 0
#endif
#ifndef SUPPORTED_40000BASEKR4_Full
#define SUPPORTED_40000BASEKR4_Full 0
#define ADVERTISED_40000BASEKR4_Full 0
#ifndef SUPPORTED_40000baseKR4_Full
#define SUPPORTED_40000baseKR4_Full 0
#define ADVERTISED_40000baseKR4_Full 0
#endif
#ifndef SUPPORTED_40000BASECR4_Full
#define SUPPORTED_40000BASECR4_Full 0
#define ADVERTISED_40000BASECR4_Full 0
#ifndef SUPPORTED_40000baseCR4_Full
#define SUPPORTED_40000baseCR4_Full 0
#define ADVERTISED_40000baseCR4_Full 0
#endif
#ifndef SUPPORTED_25000BASEKR_Full
#define SUPPORTED_25000BASEKR_Full 0
#define ADVERTISED_25000BASEKR_Full 0
#ifndef SUPPORTED_25000baseKR_Full
#define SUPPORTED_25000baseKR_Full 0
#define ADVERTISED_25000baseKR_Full 0
#endif
#ifndef SUPPORTED_25000BASECR_Full
#define SUPPORTED_25000BASECR_Full 0
#define ADVERTISED_25000BASECR_Full 0
#ifndef SUPPORTED_25000baseCR_Full
#define SUPPORTED_25000baseCR_Full 0
#define ADVERTISED_25000baseCR_Full 0
#endif
#ifndef ETHTOOL_GLINKSETTINGS
enum ethtool_link_mode_bit_indices {
ETHTOOL_LINK_MODE_1000BASEKX_Full_BIT = 17,
ETHTOOL_LINK_MODE_10000BASEKR_Full_BIT = 19,
ETHTOOL_LINK_MODE_40000BASEKR4_Full_BIT = 23,
ETHTOOL_LINK_MODE_40000BASECR4_Full_BIT = 24,
ETHTOOL_LINK_MODE_25000BASECR_Full_BIT = 31,
ETHTOOL_LINK_MODE_25000BASEKR_Full_BIT = 32,
ETHTOOL_LINK_MODE_100000BASEKR4_Full_BIT = 36,
ETHTOOL_LINK_MODE_100000BASECR4_Full_BIT = 38,
ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 17,
ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 19,
ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 23,
ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 24,
ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31,
ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32,
ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT = 36,
ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT = 38,
};
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册