diff options
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 7db99b52679f..e95dc30110eb 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -4496,6 +4496,30 @@ void dev_set_rx_mode(struct net_device *dev) | |||
4496 | } | 4496 | } |
4497 | 4497 | ||
4498 | /** | 4498 | /** |
4499 | * dev_ethtool_get_settings - call device's ethtool_ops::get_settings() | ||
4500 | * @dev: device | ||
4501 | * @cmd: memory area for ethtool_ops::get_settings() result | ||
4502 | * | ||
4503 | * The cmd arg is initialized properly (cleared and | ||
4504 | * ethtool_cmd::cmd field set to ETHTOOL_GSET). | ||
4505 | * | ||
4506 | * Return device's ethtool_ops::get_settings() result value or | ||
4507 | * -EOPNOTSUPP when device doesn't expose | ||
4508 | * ethtool_ops::get_settings() operation. | ||
4509 | */ | ||
4510 | int dev_ethtool_get_settings(struct net_device *dev, | ||
4511 | struct ethtool_cmd *cmd) | ||
4512 | { | ||
4513 | if (!dev->ethtool_ops || !dev->ethtool_ops->get_settings) | ||
4514 | return -EOPNOTSUPP; | ||
4515 | |||
4516 | memset(cmd, 0, sizeof(struct ethtool_cmd)); | ||
4517 | cmd->cmd = ETHTOOL_GSET; | ||
4518 | return dev->ethtool_ops->get_settings(dev, cmd); | ||
4519 | } | ||
4520 | EXPORT_SYMBOL(dev_ethtool_get_settings); | ||
4521 | |||
4522 | /** | ||
4499 | * dev_get_flags - get flags reported to userspace | 4523 | * dev_get_flags - get flags reported to userspace |
4500 | * @dev: device | 4524 | * @dev: device |
4501 | * | 4525 | * |