diff options
author | Govindarajulu Varadarajan <_govind@gmx.com> | 2014-09-02 17:47:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-05 15:12:20 -0400 |
commit | d4ad30b182305ecf97f145a5d4d1fd9e728c6d01 (patch) | |
tree | 5b3552c3f19957d3caaa32a86ccf91ba788e0900 /drivers/net/ethernet/cisco | |
parent | f0db9b073415848709dd59a6394969882f517da9 (diff) |
enic: Add tunable_ops support for rx_copybreak
This patch adds support for setting/getting rx_copybreak using
generic ethtool tunable.
Defines enic_get_tunable() & enic_set_tunable() to get/set rx_copybreak.
As of now, these two function supports only rx_copybreak.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cisco')
-rw-r--r-- | drivers/net/ethernet/cisco/enic/enic_ethtool.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cisco/enic/enic_ethtool.c b/drivers/net/ethernet/cisco/enic/enic_ethtool.c index 523c9ceb04c0..85173d620758 100644 --- a/drivers/net/ethernet/cisco/enic/enic_ethtool.c +++ b/drivers/net/ethernet/cisco/enic/enic_ethtool.c | |||
@@ -379,6 +379,43 @@ static int enic_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, | |||
379 | return ret; | 379 | return ret; |
380 | } | 380 | } |
381 | 381 | ||
382 | static int enic_get_tunable(struct net_device *dev, | ||
383 | const struct ethtool_tunable *tuna, void *data) | ||
384 | { | ||
385 | struct enic *enic = netdev_priv(dev); | ||
386 | int ret = 0; | ||
387 | |||
388 | switch (tuna->id) { | ||
389 | case ETHTOOL_RX_COPYBREAK: | ||
390 | *(u32 *)data = enic->rx_copybreak; | ||
391 | break; | ||
392 | default: | ||
393 | ret = -EINVAL; | ||
394 | break; | ||
395 | } | ||
396 | |||
397 | return ret; | ||
398 | } | ||
399 | |||
400 | static int enic_set_tunable(struct net_device *dev, | ||
401 | const struct ethtool_tunable *tuna, | ||
402 | const void *data) | ||
403 | { | ||
404 | struct enic *enic = netdev_priv(dev); | ||
405 | int ret = 0; | ||
406 | |||
407 | switch (tuna->id) { | ||
408 | case ETHTOOL_RX_COPYBREAK: | ||
409 | enic->rx_copybreak = *(u32 *)data; | ||
410 | break; | ||
411 | default: | ||
412 | ret = -EINVAL; | ||
413 | break; | ||
414 | } | ||
415 | |||
416 | return ret; | ||
417 | } | ||
418 | |||
382 | static const struct ethtool_ops enic_ethtool_ops = { | 419 | static const struct ethtool_ops enic_ethtool_ops = { |
383 | .get_settings = enic_get_settings, | 420 | .get_settings = enic_get_settings, |
384 | .get_drvinfo = enic_get_drvinfo, | 421 | .get_drvinfo = enic_get_drvinfo, |
@@ -391,6 +428,8 @@ static const struct ethtool_ops enic_ethtool_ops = { | |||
391 | .get_coalesce = enic_get_coalesce, | 428 | .get_coalesce = enic_get_coalesce, |
392 | .set_coalesce = enic_set_coalesce, | 429 | .set_coalesce = enic_set_coalesce, |
393 | .get_rxnfc = enic_get_rxnfc, | 430 | .get_rxnfc = enic_get_rxnfc, |
431 | .get_tunable = enic_get_tunable, | ||
432 | .set_tunable = enic_set_tunable, | ||
394 | }; | 433 | }; |
395 | 434 | ||
396 | void enic_set_ethtool_ops(struct net_device *netdev) | 435 | void enic_set_ethtool_ops(struct net_device *netdev) |