2 * Copyright (c) 2017, Mellanox Technologies. All rights reserved.
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36 static void mlx5i_get_drvinfo(struct net_device *dev,
37 struct ethtool_drvinfo *drvinfo)
39 struct mlx5e_priv *priv = mlx5i_epriv(dev);
41 mlx5e_ethtool_get_drvinfo(priv, drvinfo);
44 static void mlx5i_get_strings(struct net_device *dev,
45 uint32_t stringset, uint8_t *data)
47 struct mlx5e_priv *priv = mlx5i_epriv(dev);
49 mlx5e_ethtool_get_strings(priv, stringset, data);
52 static int mlx5i_get_sset_count(struct net_device *dev, int sset)
54 struct mlx5e_priv *priv = mlx5i_epriv(dev);
56 return mlx5e_ethtool_get_sset_count(priv, sset);
59 static void mlx5i_get_ethtool_stats(struct net_device *dev,
60 struct ethtool_stats *stats,
63 struct mlx5e_priv *priv = mlx5i_epriv(dev);
65 mlx5e_ethtool_get_ethtool_stats(priv, stats, data);
68 static int mlx5i_set_ringparam(struct net_device *dev,
69 struct ethtool_ringparam *param)
71 struct mlx5e_priv *priv = mlx5i_epriv(dev);
73 return mlx5e_ethtool_set_ringparam(priv, param);
76 static void mlx5i_get_ringparam(struct net_device *dev,
77 struct ethtool_ringparam *param)
79 struct mlx5e_priv *priv = mlx5i_epriv(dev);
81 mlx5e_ethtool_get_ringparam(priv, param);
84 static int mlx5i_set_channels(struct net_device *dev,
85 struct ethtool_channels *ch)
87 struct mlx5e_priv *priv = mlx5i_epriv(dev);
89 return mlx5e_ethtool_set_channels(priv, ch);
92 static void mlx5i_get_channels(struct net_device *dev,
93 struct ethtool_channels *ch)
95 struct mlx5e_priv *priv = mlx5i_epriv(dev);
97 mlx5e_ethtool_get_channels(priv, ch);
100 static int mlx5i_set_coalesce(struct net_device *netdev,
101 struct ethtool_coalesce *coal)
103 struct mlx5e_priv *priv = mlx5i_epriv(netdev);
105 return mlx5e_ethtool_set_coalesce(priv, coal);
108 static int mlx5i_get_coalesce(struct net_device *netdev,
109 struct ethtool_coalesce *coal)
111 struct mlx5e_priv *priv = mlx5i_epriv(netdev);
113 return mlx5e_ethtool_get_coalesce(priv, coal);
116 static int mlx5i_get_ts_info(struct net_device *netdev,
117 struct ethtool_ts_info *info)
119 struct mlx5e_priv *priv = mlx5i_epriv(netdev);
121 return mlx5e_ethtool_get_ts_info(priv, info);
124 static int mlx5i_flash_device(struct net_device *netdev,
125 struct ethtool_flash *flash)
127 struct mlx5e_priv *priv = mlx5i_epriv(netdev);
129 return mlx5e_ethtool_flash_device(priv, flash);
132 const struct ethtool_ops mlx5i_ethtool_ops = {
133 .get_drvinfo = mlx5i_get_drvinfo,
134 .get_strings = mlx5i_get_strings,
135 .get_sset_count = mlx5i_get_sset_count,
136 .get_ethtool_stats = mlx5i_get_ethtool_stats,
137 .get_ringparam = mlx5i_get_ringparam,
138 .set_ringparam = mlx5i_set_ringparam,
139 .flash_device = mlx5i_flash_device,
140 .get_channels = mlx5i_get_channels,
141 .set_channels = mlx5i_set_channels,
142 .get_coalesce = mlx5i_get_coalesce,
143 .set_coalesce = mlx5i_set_coalesce,
144 .get_ts_info = mlx5i_get_ts_info,