Lines Matching refs:real_dev
23 static int rmnet_is_real_dev_registered(const struct net_device *real_dev) in rmnet_is_real_dev_registered() argument
25 return rcu_access_pointer(real_dev->rx_handler) == rmnet_rx_handler; in rmnet_is_real_dev_registered()
30 rmnet_get_port_rtnl(const struct net_device *real_dev) in rmnet_get_port_rtnl() argument
32 return rtnl_dereference(real_dev->rx_handler_data); in rmnet_get_port_rtnl()
35 static int rmnet_unregister_real_device(struct net_device *real_dev) in rmnet_unregister_real_device() argument
37 struct rmnet_port *port = rmnet_get_port_rtnl(real_dev); in rmnet_unregister_real_device()
42 netdev_rx_handler_unregister(real_dev); in rmnet_unregister_real_device()
46 netdev_dbg(real_dev, "Removed from rmnet\n"); in rmnet_unregister_real_device()
50 static int rmnet_register_real_device(struct net_device *real_dev, in rmnet_register_real_device() argument
58 if (rmnet_is_real_dev_registered(real_dev)) { in rmnet_register_real_device()
59 port = rmnet_get_port_rtnl(real_dev); in rmnet_register_real_device()
72 port->dev = real_dev; in rmnet_register_real_device()
73 rc = netdev_rx_handler_register(real_dev, rmnet_rx_handler, port); in rmnet_register_real_device()
82 netdev_dbg(real_dev, "registered with rmnet\n"); in rmnet_register_real_device()
88 struct net_device *bridge_dev, *real_dev, *rmnet_dev; in rmnet_unregister_bridge() local
97 real_dev = port->bridge_ep; in rmnet_unregister_bridge()
100 real_port = rmnet_get_port_rtnl(real_dev); in rmnet_unregister_bridge()
120 struct net_device *real_dev; in rmnet_newlink() local
132 real_dev = __dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK])); in rmnet_newlink()
133 if (!real_dev) { in rmnet_newlink()
144 err = rmnet_register_real_device(real_dev, extack); in rmnet_newlink()
148 port = rmnet_get_port_rtnl(real_dev); in rmnet_newlink()
149 err = rmnet_vnd_newlink(mux_id, dev, port, real_dev, ep, extack); in rmnet_newlink()
153 err = netdev_upper_dev_link(real_dev, dev, extack); in rmnet_newlink()
179 rmnet_unregister_real_device(real_dev); in rmnet_newlink()
188 struct net_device *real_dev, *bridge_dev; in rmnet_dellink() local
193 real_dev = priv->real_dev; in rmnet_dellink()
195 if (!rmnet_is_real_dev_registered(real_dev)) in rmnet_dellink()
198 real_port = rmnet_get_port_rtnl(real_dev); in rmnet_dellink()
212 netdev_upper_dev_unlink(real_dev, dev); in rmnet_dellink()
213 rmnet_unregister_real_device(real_dev); in rmnet_dellink()
217 static void rmnet_force_unassociate_device(struct net_device *real_dev) in rmnet_force_unassociate_device() argument
225 port = rmnet_get_port_rtnl(real_dev); in rmnet_force_unassociate_device()
232 netdev_upper_dev_unlink(real_dev, ep->egress_dev); in rmnet_force_unassociate_device()
237 rmnet_unregister_real_device(real_dev); in rmnet_force_unassociate_device()
247 struct net_device *real_dev = netdev_notifier_info_to_dev(data); in rmnet_config_notify_cb() local
249 if (!rmnet_is_real_dev_registered(real_dev)) in rmnet_config_notify_cb()
254 netdev_dbg(real_dev, "Kernel unregister\n"); in rmnet_config_notify_cb()
255 rmnet_force_unassociate_device(real_dev); in rmnet_config_notify_cb()
258 if (rmnet_vnd_validate_real_dev_mtu(real_dev)) in rmnet_config_notify_cb()
296 struct net_device *real_dev; in rmnet_changelink() local
303 real_dev = priv->real_dev; in rmnet_changelink()
304 if (!rmnet_is_real_dev_registered(real_dev)) in rmnet_changelink()
307 port = rmnet_get_port_rtnl(real_dev); in rmnet_changelink()
343 if (rmnet_vnd_update_dev_mtu(port, real_dev)) { in rmnet_changelink()
365 struct net_device *real_dev; in rmnet_fill_info() local
369 real_dev = priv->real_dev; in rmnet_fill_info()
374 if (rmnet_is_real_dev_registered(real_dev)) { in rmnet_fill_info()
375 port = rmnet_get_port_rtnl(real_dev); in rmnet_fill_info()
406 struct rmnet_port *rmnet_get_port_rcu(struct net_device *real_dev) in rmnet_get_port_rcu() argument
408 if (rmnet_is_real_dev_registered(real_dev)) in rmnet_get_port_rcu()
409 return rcu_dereference_bh(real_dev->rx_handler_data); in rmnet_get_port_rcu()
431 struct net_device *real_dev = priv->real_dev; in rmnet_add_bridge() local
435 port = rmnet_get_port_rtnl(real_dev); in rmnet_add_bridge()
470 slave_port->bridge_ep = real_dev; in rmnet_add_bridge()