diff options
author | Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> | 2017-09-03 08:30:45 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-04 07:27:18 +0300 |
commit | b752eff5be24ec146393944848d2ffbef92b43a7 (patch) | |
tree | 470493e8104efd5e58eb232f593a3ee259a6e274 /drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c | |
parent | 032ee46828e7a2531c77bf80052fa1237820ec9c (diff) | |
download | linux-b752eff5be24ec146393944848d2ffbef92b43a7.tar.xz |
net: qualcomm: rmnet: Implement ndo_get_iflink
This makes it easier to find out the parent dev.
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Cc: Dan Williams <dcbw@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c')
-rw-r--r-- | drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c index a6de0419d68b..f5c63b78338b 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c @@ -63,9 +63,17 @@ static int rmnet_vnd_change_mtu(struct net_device *rmnet_dev, int new_mtu) return 0; } +static int rmnet_vnd_get_iflink(const struct net_device *dev) +{ + struct rmnet_priv *priv = netdev_priv(dev); + + return priv->real_dev->ifindex; +} + static const struct net_device_ops rmnet_vnd_ops = { .ndo_start_xmit = rmnet_vnd_start_xmit, .ndo_change_mtu = rmnet_vnd_change_mtu, + .ndo_get_iflink = rmnet_vnd_get_iflink, }; /* Called by kernel whenever a new rmnet<n> device is created. Sets MTU, @@ -91,7 +99,8 @@ void rmnet_vnd_setup(struct net_device *rmnet_dev) /* Exposed API */ int rmnet_vnd_newlink(u8 id, struct net_device *rmnet_dev, - struct rmnet_real_dev_info *r) + struct rmnet_real_dev_info *r, + struct net_device *real_dev) { struct rmnet_priv *priv; int rc; @@ -107,6 +116,7 @@ int rmnet_vnd_newlink(u8 id, struct net_device *rmnet_dev, priv = netdev_priv(rmnet_dev); priv->mux_id = id; + priv->real_dev = real_dev; netdev_dbg(rmnet_dev, "rmnet dev created\n"); } |