goto err0;
r = rmnet_get_real_dev_info_rtnl(real_dev);
- err = rmnet_vnd_newlink(mux_id, dev, r);
+ err = rmnet_vnd_newlink(mux_id, dev, r, real_dev);
if (err)
goto err1;
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,
/* 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;
priv = netdev_priv(rmnet_dev);
priv->mux_id = id;
+ priv->real_dev = real_dev;
netdev_dbg(rmnet_dev, "rmnet dev created\n");
}
int rmnet_vnd_do_flow_control(struct net_device *dev, int enable);
struct rmnet_endpoint *rmnet_vnd_get_endpoint(struct net_device *dev);
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);
int rmnet_vnd_dellink(u8 id, struct rmnet_real_dev_info *r);
void rmnet_vnd_rx_fixup(struct sk_buff *skb, struct net_device *dev);
void rmnet_vnd_tx_fixup(struct sk_buff *skb, struct net_device *dev);