29 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
45 if (netif_carrier_ok(dev)) {
69 ethtool_cmd_speed_set(cmd, speed);
101 switch (cmd->
speed) {
142 "Port speed successfully set: %dMbps %s Duplex\n",
149 static int ehea_nway_reset(
struct net_device *dev)
151 struct ehea_port *port = netdev_priv(dev);
158 "Port speed successfully set: %dMbps %s Duplex\n",
164 static void ehea_get_drvinfo(
struct net_device *dev,
173 struct ehea_port *port = netdev_priv(dev);
179 struct ehea_port *port = netdev_priv(dev);
188 {
"TCP cksum errors"},
190 {
"Frame cksum errors"},
213 memcpy(data, &ehea_ethtool_stats_keys,
214 sizeof(ehea_ethtool_stats_keys));
218 static int ehea_get_sset_count(
struct net_device *dev,
int sset)
228 static void ehea_get_ethtool_stats(
struct net_device *dev,
232 struct ehea_port *port = netdev_priv(dev);
234 for (i = 0; i < ehea_get_sset_count(dev,
ETH_SS_STATS); i++)
239 data[i++] = port->
port_res[0].swqe_refill_th;
243 tmp += port->
port_res[k].p_stats.poll_receive_errors;
247 tmp += port->
port_res[k].p_stats.err_tcp_cksum;
251 tmp += port->
port_res[k].p_stats.err_ip_cksum;
255 tmp += port->
port_res[k].p_stats.err_frame_crc;
259 tmp += port->
port_res[k].p_stats.queue_stopped;
262 for (k = 0; k < 16; k++)
266 static const struct ethtool_ops ehea_ethtool_ops = {
267 .get_settings = ehea_get_settings,
268 .get_drvinfo = ehea_get_drvinfo,
269 .get_msglevel = ehea_get_msglevel,
270 .set_msglevel = ehea_set_msglevel,
272 .get_strings = ehea_get_strings,
273 .get_sset_count = ehea_get_sset_count,
274 .get_ethtool_stats = ehea_get_ethtool_stats,
275 .set_settings = ehea_set_settings,
276 .nway_reset = ehea_nway_reset,