Commit dd063ffa authored by Taehee Yoo's avatar Taehee Yoo Committed by Johannes Berg

virt_wifi: implement ndo_get_iflink

->ndo_get_iflink() is useful for finding lower interface.

Test commands:
    ip link add dummy0 type dummy
    ip link add vw1 link dummy0 type virt_wifi
    ip link show vw1

Before:
    9: vw1: <BROADCAST,MULTICAST> ...
After:
    9: vw1@dummy0: <BROADCAST,MULTICAST> ...
Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
Link: https://lore.kernel.org/r/20200305090636.28221-1-ap420073@gmail.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent a916062a
......@@ -436,10 +436,18 @@ static int virt_wifi_net_device_stop(struct net_device *dev)
return 0;
}
static int virt_wifi_net_device_get_iflink(const struct net_device *dev)
{
struct virt_wifi_netdev_priv *priv = netdev_priv(dev);
return priv->lowerdev->ifindex;
}
static const struct net_device_ops virt_wifi_ops = {
.ndo_start_xmit = virt_wifi_start_xmit,
.ndo_open = virt_wifi_net_device_open,
.ndo_stop = virt_wifi_net_device_stop,
.ndo_get_iflink = virt_wifi_net_device_get_iflink,
};
/* Invoked as part of rtnl lock release. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment