Lines Matching refs:primary_dev
38 struct net_device *primary_dev, *standby_dev; in net_failover_open() local
41 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_open()
42 if (primary_dev) { in net_failover_open()
43 err = dev_open(primary_dev, NULL); in net_failover_open()
55 if ((primary_dev && net_failover_xmit_ready(primary_dev)) || in net_failover_open()
64 if (primary_dev) in net_failover_open()
65 dev_close(primary_dev); in net_failover_open()
78 slave_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_close()
104 xmit_dev = rcu_dereference_bh(nfo_info->primary_dev); in net_failover_start_xmit()
122 struct net_device *primary_dev; in net_failover_select_queue() local
125 primary_dev = rcu_dereference(nfo_info->primary_dev); in net_failover_select_queue()
126 if (primary_dev) { in net_failover_select_queue()
127 const struct net_device_ops *ops = primary_dev->netdev_ops; in net_failover_select_queue()
130 txq = ops->ndo_select_queue(primary_dev, skb, sb_dev); in net_failover_select_queue()
132 txq = netdev_pick_tx(primary_dev, skb, NULL); in net_failover_select_queue()
195 slave_dev = rcu_dereference(nfo_info->primary_dev); in net_failover_get_stats()
218 struct net_device *primary_dev, *standby_dev; in net_failover_change_mtu() local
221 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_change_mtu()
222 if (primary_dev) { in net_failover_change_mtu()
223 ret = dev_set_mtu(primary_dev, new_mtu); in net_failover_change_mtu()
232 if (primary_dev) in net_failover_change_mtu()
233 dev_set_mtu(primary_dev, dev->mtu); in net_failover_change_mtu()
250 slave_dev = rcu_dereference(nfo_info->primary_dev); in net_failover_set_rx_mode()
269 struct net_device *primary_dev, *standby_dev; in net_failover_vlan_rx_add_vid() local
272 primary_dev = rcu_dereference(nfo_info->primary_dev); in net_failover_vlan_rx_add_vid()
273 if (primary_dev) { in net_failover_vlan_rx_add_vid()
274 ret = vlan_vid_add(primary_dev, proto, vid); in net_failover_vlan_rx_add_vid()
283 if (primary_dev) in net_failover_vlan_rx_add_vid()
284 vlan_vid_del(primary_dev, proto, vid); in net_failover_vlan_rx_add_vid()
296 slave_dev = rcu_dereference(nfo_info->primary_dev); in net_failover_vlan_rx_kill_vid()
337 slave_dev = rtnl_dereference(nfo_info->primary_dev); in nfo_ethtool_get_link_ksettings()
367 struct net_device *primary_dev, *standby_dev; in net_failover_handle_frame() local
369 primary_dev = rcu_dereference(nfo_info->primary_dev); in net_failover_handle_frame()
372 if (primary_dev && skb->dev == standby_dev) in net_failover_handle_frame()
389 struct net_device *primary_dev, *standby_dev; in net_failover_compute_features() local
391 primary_dev = rcu_dereference(nfo_info->primary_dev); in net_failover_compute_features()
392 if (primary_dev) { in net_failover_compute_features()
395 primary_dev->vlan_features, in net_failover_compute_features()
399 primary_dev->hw_enc_features, in net_failover_compute_features()
402 dst_release_flag &= primary_dev->priv_flags; in net_failover_compute_features()
403 if (primary_dev->hard_header_len > max_hard_header_len) in net_failover_compute_features()
404 max_hard_header_len = primary_dev->hard_header_len; in net_failover_compute_features()
436 struct net_device *primary_dev, in net_failover_lower_state_changed() argument
446 if (slave_dev == primary_dev) { in net_failover_lower_state_changed()
447 if (netif_running(primary_dev)) in net_failover_lower_state_changed()
452 if ((primary_dev && netif_running(primary_dev)) || in net_failover_lower_state_changed()
465 struct net_device *standby_dev, *primary_dev; in net_failover_slave_pre_register() local
471 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_slave_pre_register()
473 if (slave_is_standby ? standby_dev : primary_dev) { in net_failover_slave_pre_register()
501 struct net_device *standby_dev, *primary_dev; in net_failover_slave_register() local
541 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_slave_register()
549 rcu_assign_pointer(nfo_info->primary_dev, slave_dev); in net_failover_slave_register()
550 primary_dev = slave_dev; in net_failover_slave_register()
551 dev_get_stats(primary_dev, &nfo_info->primary_stats); in net_failover_slave_register()
556 net_failover_lower_state_changed(slave_dev, primary_dev, standby_dev); in net_failover_slave_register()
580 struct net_device *standby_dev, *primary_dev; in net_failover_slave_pre_unregister() local
584 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_slave_pre_unregister()
587 if (slave_dev != primary_dev && slave_dev != standby_dev) in net_failover_slave_pre_unregister()
596 struct net_device *standby_dev, *primary_dev; in net_failover_slave_unregister() local
601 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_slave_unregister()
604 if (WARN_ON_ONCE(slave_dev != primary_dev && slave_dev != standby_dev)) in net_failover_slave_unregister()
619 RCU_INIT_POINTER(nfo_info->primary_dev, NULL); in net_failover_slave_unregister()
639 struct net_device *primary_dev, *standby_dev; in net_failover_slave_link_change() local
644 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_slave_link_change()
647 if (slave_dev != primary_dev && slave_dev != standby_dev) in net_failover_slave_link_change()
650 if ((primary_dev && net_failover_xmit_ready(primary_dev)) || in net_failover_slave_link_change()
660 net_failover_lower_state_changed(slave_dev, primary_dev, standby_dev); in net_failover_slave_link_change()
668 struct net_device *primary_dev, *standby_dev; in net_failover_slave_name_change() local
673 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_slave_name_change()
676 if (slave_dev != primary_dev && slave_dev != standby_dev) in net_failover_slave_name_change()
808 slave_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_destroy()