aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_eal/linuxapp/kni/kni_ethtool.c
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-12-08 14:07:29 +0100
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-12-08 14:10:05 +0100
commit6b3e017e5d25f15da73f7700f7f2ac553ef1a2e9 (patch)
tree1b1fb3f903b2282e261ade69e3c17952b3fd3464 /lib/librte_eal/linuxapp/kni/kni_ethtool.c
parent32e04ea00cd159613e04acef75e52bfca6eeff2f (diff)
Imported Upstream version 16.11
Change-Id: I1944c65ddc88a9ad70f8c0eb6731552b84fbcb77 Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_eal/linuxapp/kni/kni_ethtool.c')
-rw-r--r--lib/librte_eal/linuxapp/kni/kni_ethtool.c39
1 files changed, 30 insertions, 9 deletions
diff --git a/lib/librte_eal/linuxapp/kni/kni_ethtool.c b/lib/librte_eal/linuxapp/kni/kni_ethtool.c
index 06b6d463..0c88589c 100644
--- a/lib/librte_eal/linuxapp/kni/kni_ethtool.c
+++ b/lib/librte_eal/linuxapp/kni/kni_ethtool.c
@@ -31,6 +31,7 @@ static int
kni_check_if_running(struct net_device *dev)
{
struct kni_dev *priv = netdev_priv(dev);
+
if (priv->lad_dev)
return 0;
else
@@ -41,6 +42,7 @@ static void
kni_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{
struct kni_dev *priv = netdev_priv(dev);
+
priv->lad_dev->ethtool_ops->get_drvinfo(priv->lad_dev, info);
}
@@ -48,6 +50,7 @@ static int
kni_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
{
struct kni_dev *priv = netdev_priv(dev);
+
return priv->lad_dev->ethtool_ops->get_settings(priv->lad_dev, ecmd);
}
@@ -55,6 +58,7 @@ static int
kni_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
{
struct kni_dev *priv = netdev_priv(dev);
+
return priv->lad_dev->ethtool_ops->set_settings(priv->lad_dev, ecmd);
}
@@ -62,6 +66,7 @@ static void
kni_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct kni_dev *priv = netdev_priv(dev);
+
priv->lad_dev->ethtool_ops->get_wol(priv->lad_dev, wol);
}
@@ -69,6 +74,7 @@ static int
kni_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct kni_dev *priv = netdev_priv(dev);
+
return priv->lad_dev->ethtool_ops->set_wol(priv->lad_dev, wol);
}
@@ -76,6 +82,7 @@ static int
kni_nway_reset(struct net_device *dev)
{
struct kni_dev *priv = netdev_priv(dev);
+
return priv->lad_dev->ethtool_ops->nway_reset(priv->lad_dev);
}
@@ -83,6 +90,7 @@ static int
kni_get_eeprom_len(struct net_device *dev)
{
struct kni_dev *priv = netdev_priv(dev);
+
return priv->lad_dev->ethtool_ops->get_eeprom_len(priv->lad_dev);
}
@@ -91,6 +99,7 @@ kni_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
u8 *bytes)
{
struct kni_dev *priv = netdev_priv(dev);
+
return priv->lad_dev->ethtool_ops->get_eeprom(priv->lad_dev, eeprom,
bytes);
}
@@ -100,6 +109,7 @@ kni_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
u8 *bytes)
{
struct kni_dev *priv = netdev_priv(dev);
+
return priv->lad_dev->ethtool_ops->set_eeprom(priv->lad_dev, eeprom,
bytes);
}
@@ -108,6 +118,7 @@ static void
kni_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring)
{
struct kni_dev *priv = netdev_priv(dev);
+
priv->lad_dev->ethtool_ops->get_ringparam(priv->lad_dev, ring);
}
@@ -115,6 +126,7 @@ static int
kni_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring)
{
struct kni_dev *priv = netdev_priv(dev);
+
return priv->lad_dev->ethtool_ops->set_ringparam(priv->lad_dev, ring);
}
@@ -122,6 +134,7 @@ static void
kni_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
{
struct kni_dev *priv = netdev_priv(dev);
+
priv->lad_dev->ethtool_ops->get_pauseparam(priv->lad_dev, pause);
}
@@ -129,6 +142,7 @@ static int
kni_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
{
struct kni_dev *priv = netdev_priv(dev);
+
return priv->lad_dev->ethtool_ops->set_pauseparam(priv->lad_dev,
pause);
}
@@ -137,6 +151,7 @@ static u32
kni_get_msglevel(struct net_device *dev)
{
struct kni_dev *priv = netdev_priv(dev);
+
return priv->lad_dev->ethtool_ops->get_msglevel(priv->lad_dev);
}
@@ -144,6 +159,7 @@ static void
kni_set_msglevel(struct net_device *dev, u32 data)
{
struct kni_dev *priv = netdev_priv(dev);
+
priv->lad_dev->ethtool_ops->set_msglevel(priv->lad_dev, data);
}
@@ -151,6 +167,7 @@ static int
kni_get_regs_len(struct net_device *dev)
{
struct kni_dev *priv = netdev_priv(dev);
+
return priv->lad_dev->ethtool_ops->get_regs_len(priv->lad_dev);
}
@@ -158,6 +175,7 @@ static void
kni_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
{
struct kni_dev *priv = netdev_priv(dev);
+
priv->lad_dev->ethtool_ops->get_regs(priv->lad_dev, regs, p);
}
@@ -165,6 +183,7 @@ static void
kni_get_strings(struct net_device *dev, u32 stringset, u8 *data)
{
struct kni_dev *priv = netdev_priv(dev);
+
priv->lad_dev->ethtool_ops->get_strings(priv->lad_dev, stringset,
data);
}
@@ -173,6 +192,7 @@ static int
kni_get_sset_count(struct net_device *dev, int sset)
{
struct kni_dev *priv = netdev_priv(dev);
+
return priv->lad_dev->ethtool_ops->get_sset_count(priv->lad_dev, sset);
}
@@ -181,24 +201,25 @@ kni_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats,
u64 *data)
{
struct kni_dev *priv = netdev_priv(dev);
+
priv->lad_dev->ethtool_ops->get_ethtool_stats(priv->lad_dev, stats,
data);
}
struct ethtool_ops kni_ethtool_ops = {
- .begin = kni_check_if_running,
+ .begin = kni_check_if_running,
.get_drvinfo = kni_get_drvinfo,
.get_settings = kni_get_settings,
.set_settings = kni_set_settings,
.get_regs_len = kni_get_regs_len,
- .get_regs = kni_get_regs,
- .get_wol = kni_get_wol,
- .set_wol = kni_set_wol,
- .nway_reset = kni_nway_reset,
- .get_link = ethtool_op_get_link,
+ .get_regs = kni_get_regs,
+ .get_wol = kni_get_wol,
+ .set_wol = kni_set_wol,
+ .nway_reset = kni_nway_reset,
+ .get_link = ethtool_op_get_link,
.get_eeprom_len = kni_get_eeprom_len,
- .get_eeprom = kni_get_eeprom,
- .set_eeprom = kni_set_eeprom,
+ .get_eeprom = kni_get_eeprom,
+ .set_eeprom = kni_set_eeprom,
.get_ringparam = kni_get_ringparam,
.set_ringparam = kni_set_ringparam,
.get_pauseparam = kni_get_pauseparam,
@@ -207,7 +228,7 @@ struct ethtool_ops kni_ethtool_ops = {
.set_msglevel = kni_set_msglevel,
.get_strings = kni_get_strings,
.get_sset_count = kni_get_sset_count,
- .get_ethtool_stats = kni_get_ethtool_stats,
+ .get_ethtool_stats = kni_get_ethtool_stats,
};
void