~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to drivers/net/mlx4/en_ethtool.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
        drvinfo->eedump_len = 0;
58
58
}
59
59
 
60
 
static u32 mlx4_en_get_tso(struct net_device *dev)
61
 
{
62
 
        return (dev->features & NETIF_F_TSO) != 0;
63
 
}
64
 
 
65
 
static int mlx4_en_set_tso(struct net_device *dev, u32 data)
66
 
{
67
 
        struct mlx4_en_priv *priv = netdev_priv(dev);
68
 
 
69
 
        if (data) {
70
 
                if (!priv->mdev->LSO_support)
71
 
                        return -EPERM;
72
 
                dev->features |= (NETIF_F_TSO | NETIF_F_TSO6);
73
 
        } else
74
 
                dev->features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
75
 
        return 0;
76
 
}
77
 
 
78
 
static u32 mlx4_en_get_rx_csum(struct net_device *dev)
79
 
{
80
 
        struct mlx4_en_priv *priv = netdev_priv(dev);
81
 
        return priv->rx_csum;
82
 
}
83
 
 
84
 
static int mlx4_en_set_rx_csum(struct net_device *dev, u32 data)
85
 
{
86
 
        struct mlx4_en_priv *priv = netdev_priv(dev);
87
 
        priv->rx_csum = (data != 0);
88
 
        return 0;
89
 
}
90
 
 
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",
296
265
 
297
266
        trans_type = priv->port_state.transciver;
298
267
        if (netif_carrier_ok(dev)) {
299
 
                cmd->speed = priv->port_state.link_speed;
 
268
                ethtool_cmd_speed_set(cmd, priv->port_state.link_speed);
300
269
                cmd->duplex = DUPLEX_FULL;
301
270
        } else {
302
 
                cmd->speed = -1;
 
271
                ethtool_cmd_speed_set(cmd, -1);
303
272
                cmd->duplex = -1;
304
273
        }
305
274
 
323
292
static int mlx4_en_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
324
293
{
325
294
        if ((cmd->autoneg == AUTONEG_ENABLE) ||
326
 
            (cmd->speed != SPEED_10000) || (cmd->duplex != DUPLEX_FULL))
 
295
            (ethtool_cmd_speed(cmd) != SPEED_10000) ||
 
296
            (cmd->duplex != DUPLEX_FULL))
327
297
                return -EINVAL;
328
298
 
329
299
        /* Nothing to change */
483
453
        .get_drvinfo = mlx4_en_get_drvinfo,
484
454
        .get_settings = mlx4_en_get_settings,
485
455
        .set_settings = mlx4_en_set_settings,
486
 
#ifdef NETIF_F_TSO
487
 
        .get_tso = mlx4_en_get_tso,
488
 
        .set_tso = mlx4_en_set_tso,
489
 
#endif
490
 
        .get_sg = ethtool_op_get_sg,
491
 
        .set_sg = ethtool_op_set_sg,
492
456
        .get_link = ethtool_op_get_link,
493
 
        .get_rx_csum = mlx4_en_get_rx_csum,
494
 
        .set_rx_csum = mlx4_en_set_rx_csum,
495
 
        .get_tx_csum = ethtool_op_get_tx_csum,
496
 
        .set_tx_csum = ethtool_op_set_tx_ipv6_csum,
497
457
        .get_strings = mlx4_en_get_strings,
498
458
        .get_sset_count = mlx4_en_get_sset_count,
499
459
        .get_ethtool_stats = mlx4_en_get_ethtool_stats,
508
468
        .set_pauseparam = mlx4_en_set_pauseparam,
509
469
        .get_ringparam = mlx4_en_get_ringparam,
510
470
        .set_ringparam = mlx4_en_set_ringparam,
511
 
        .get_flags = ethtool_op_get_flags,
512
471
};
513
472
 
514
473