45
45
struct mlx4_en_priv *priv = netdev_priv(dev);
46
46
struct mlx4_en_dev *mdev = priv->mdev;
48
sprintf(drvinfo->driver, DRV_NAME " (%s)", mdev->dev->board_id);
48
strncpy(drvinfo->driver, DRV_NAME, 32);
49
49
strncpy(drvinfo->version, DRV_VERSION " (" DRV_RELDATE ")", 32);
50
50
sprintf(drvinfo->fw_version, "%d.%d.%d",
51
51
(u16) (mdev->dev->caps.fw_ver >> 32),
57
57
drvinfo->eedump_len = 0;
60
static u32 mlx4_en_get_tso(struct net_device *dev)
62
return (dev->features & NETIF_F_TSO) != 0;
65
static int mlx4_en_set_tso(struct net_device *dev, u32 data)
67
struct mlx4_en_priv *priv = netdev_priv(dev);
70
if (!priv->mdev->LSO_support)
72
dev->features |= (NETIF_F_TSO | NETIF_F_TSO6);
74
dev->features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
78
static u32 mlx4_en_get_rx_csum(struct net_device *dev)
80
struct mlx4_en_priv *priv = netdev_priv(dev);
84
static int mlx4_en_set_rx_csum(struct net_device *dev, u32 data)
86
struct mlx4_en_priv *priv = netdev_priv(dev);
87
priv->rx_csum = (data != 0);
91
60
static const char main_strings[][ETH_GSTRING_LEN] = {
92
61
"rx_packets", "tx_packets", "rx_bytes", "tx_bytes", "rx_errors",
93
62
"tx_errors", "rx_dropped", "tx_dropped", "multicast", "collisions",
131
100
static void mlx4_en_get_wol(struct net_device *netdev,
132
101
struct ethtool_wolinfo *wol)
103
struct mlx4_en_priv *priv = netdev_priv(netdev);
107
if (!priv->mdev->dev->caps.wol) {
113
err = mlx4_wol_read(priv->mdev->dev, &config, priv->port);
115
en_err(priv, "Failed to get WoL information\n");
119
if (config & MLX4_EN_WOL_MAGIC)
120
wol->supported = WAKE_MAGIC;
124
if (config & MLX4_EN_WOL_ENABLED)
125
wol->wolopts = WAKE_MAGIC;
130
static int mlx4_en_set_wol(struct net_device *netdev,
131
struct ethtool_wolinfo *wol)
133
struct mlx4_en_priv *priv = netdev_priv(netdev);
137
if (!priv->mdev->dev->caps.wol)
140
if (wol->supported & ~WAKE_MAGIC)
143
err = mlx4_wol_read(priv->mdev->dev, &config, priv->port);
145
en_err(priv, "Failed to get WoL info, unable to modify\n");
149
if (wol->wolopts & WAKE_MAGIC) {
150
config |= MLX4_EN_WOL_DO_MODIFY | MLX4_EN_WOL_ENABLED |
153
config &= ~(MLX4_EN_WOL_ENABLED | MLX4_EN_WOL_MAGIC);
154
config |= MLX4_EN_WOL_DO_MODIFY;
157
err = mlx4_wol_write(priv->mdev->dev, config, priv->port);
159
en_err(priv, "Failed to set WoL information\n");
138
164
static int mlx4_en_get_sset_count(struct net_device *dev, int sset)
240
266
trans_type = priv->port_state.transciver;
241
267
if (netif_carrier_ok(dev)) {
242
cmd->speed = priv->port_state.link_speed;
268
ethtool_cmd_speed_set(cmd, priv->port_state.link_speed);
243
269
cmd->duplex = DUPLEX_FULL;
271
ethtool_cmd_speed_set(cmd, -1);
246
272
cmd->duplex = -1;
266
292
static int mlx4_en_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
268
294
if ((cmd->autoneg == AUTONEG_ENABLE) ||
269
(cmd->speed != SPEED_10000) || (cmd->duplex != DUPLEX_FULL))
295
(ethtool_cmd_speed(cmd) != SPEED_10000) ||
296
(cmd->duplex != DUPLEX_FULL))
272
299
/* Nothing to change */
388
415
mlx4_en_stop_port(dev);
391
mlx4_en_free_resources(priv);
418
mlx4_en_free_resources(priv, true);
393
420
priv->prof->tx_ring_size = tx_size;
394
421
priv->prof->rx_ring_size = rx_size;
426
453
.get_drvinfo = mlx4_en_get_drvinfo,
427
454
.get_settings = mlx4_en_get_settings,
428
455
.set_settings = mlx4_en_set_settings,
430
.get_tso = mlx4_en_get_tso,
431
.set_tso = mlx4_en_set_tso,
433
.get_sg = ethtool_op_get_sg,
434
.set_sg = ethtool_op_set_sg,
435
456
.get_link = ethtool_op_get_link,
436
.get_rx_csum = mlx4_en_get_rx_csum,
437
.set_rx_csum = mlx4_en_set_rx_csum,
438
.get_tx_csum = ethtool_op_get_tx_csum,
439
.set_tx_csum = ethtool_op_set_tx_ipv6_csum,
440
457
.get_strings = mlx4_en_get_strings,
441
458
.get_sset_count = mlx4_en_get_sset_count,
442
459
.get_ethtool_stats = mlx4_en_get_ethtool_stats,
443
460
.self_test = mlx4_en_self_test,
444
461
.get_wol = mlx4_en_get_wol,
462
.set_wol = mlx4_en_set_wol,
445
463
.get_msglevel = mlx4_en_get_msglevel,
446
464
.set_msglevel = mlx4_en_set_msglevel,
447
465
.get_coalesce = mlx4_en_get_coalesce,
450
468
.set_pauseparam = mlx4_en_set_pauseparam,
451
469
.get_ringparam = mlx4_en_get_ringparam,
452
470
.set_ringparam = mlx4_en_set_ringparam,
453
.get_flags = ethtool_op_get_flags,