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()
191 slave_dev = rcu_dereference(nfo_info->primary_dev); in net_failover_get_stats()
214 struct net_device *primary_dev, *standby_dev; in net_failover_change_mtu() local
217 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_change_mtu()
218 if (primary_dev) { in net_failover_change_mtu()
219 ret = dev_set_mtu(primary_dev, new_mtu); in net_failover_change_mtu()
228 if (primary_dev) in net_failover_change_mtu()
229 dev_set_mtu(primary_dev, dev->mtu); in net_failover_change_mtu()
246 slave_dev = rcu_dereference(nfo_info->primary_dev); in net_failover_set_rx_mode()
265 struct net_device *primary_dev, *standby_dev; in net_failover_vlan_rx_add_vid() local
268 primary_dev = rcu_dereference(nfo_info->primary_dev); in net_failover_vlan_rx_add_vid()
269 if (primary_dev) { in net_failover_vlan_rx_add_vid()
270 ret = vlan_vid_add(primary_dev, proto, vid); in net_failover_vlan_rx_add_vid()
279 if (primary_dev) in net_failover_vlan_rx_add_vid()
280 vlan_vid_del(primary_dev, proto, vid); in net_failover_vlan_rx_add_vid()
292 slave_dev = rcu_dereference(nfo_info->primary_dev); in net_failover_vlan_rx_kill_vid()
333 slave_dev = rtnl_dereference(nfo_info->primary_dev); in nfo_ethtool_get_link_ksettings()
363 struct net_device *primary_dev, *standby_dev; in net_failover_handle_frame() local
365 primary_dev = rcu_dereference(nfo_info->primary_dev); in net_failover_handle_frame()
368 if (primary_dev && skb->dev == standby_dev) in net_failover_handle_frame()
385 struct net_device *primary_dev, *standby_dev; in net_failover_compute_features() local
387 primary_dev = rcu_dereference(nfo_info->primary_dev); in net_failover_compute_features()
388 if (primary_dev) { in net_failover_compute_features()
391 primary_dev->vlan_features, in net_failover_compute_features()
395 primary_dev->hw_enc_features, in net_failover_compute_features()
398 dst_release_flag &= primary_dev->priv_flags; in net_failover_compute_features()
399 if (primary_dev->hard_header_len > max_hard_header_len) in net_failover_compute_features()
400 max_hard_header_len = primary_dev->hard_header_len; in net_failover_compute_features()
432 struct net_device *primary_dev, in net_failover_lower_state_changed() argument
442 if (slave_dev == primary_dev) { in net_failover_lower_state_changed()
443 if (netif_running(primary_dev)) in net_failover_lower_state_changed()
448 if ((primary_dev && netif_running(primary_dev)) || in net_failover_lower_state_changed()
461 struct net_device *standby_dev, *primary_dev; in net_failover_slave_pre_register() local
467 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_slave_pre_register()
469 if (slave_is_standby ? standby_dev : primary_dev) { in net_failover_slave_pre_register()
497 struct net_device *standby_dev, *primary_dev; in net_failover_slave_register() local
537 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_slave_register()
545 rcu_assign_pointer(nfo_info->primary_dev, slave_dev); in net_failover_slave_register()
546 primary_dev = slave_dev; in net_failover_slave_register()
547 dev_get_stats(primary_dev, &nfo_info->primary_stats); in net_failover_slave_register()
552 net_failover_lower_state_changed(slave_dev, primary_dev, standby_dev); in net_failover_slave_register()
576 struct net_device *standby_dev, *primary_dev; in net_failover_slave_pre_unregister() local
580 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_slave_pre_unregister()
583 if (slave_dev != primary_dev && slave_dev != standby_dev) in net_failover_slave_pre_unregister()
592 struct net_device *standby_dev, *primary_dev; in net_failover_slave_unregister() local
597 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_slave_unregister()
600 if (WARN_ON_ONCE(slave_dev != primary_dev && slave_dev != standby_dev)) in net_failover_slave_unregister()
615 RCU_INIT_POINTER(nfo_info->primary_dev, NULL); in net_failover_slave_unregister()
635 struct net_device *primary_dev, *standby_dev; in net_failover_slave_link_change() local
640 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_slave_link_change()
643 if (slave_dev != primary_dev && slave_dev != standby_dev) in net_failover_slave_link_change()
646 if ((primary_dev && net_failover_xmit_ready(primary_dev)) || in net_failover_slave_link_change()
656 net_failover_lower_state_changed(slave_dev, primary_dev, standby_dev); in net_failover_slave_link_change()
664 struct net_device *primary_dev, *standby_dev; in net_failover_slave_name_change() local
669 primary_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_slave_name_change()
672 if (slave_dev != primary_dev && slave_dev != standby_dev) in net_failover_slave_name_change()
804 slave_dev = rtnl_dereference(nfo_info->primary_dev); in net_failover_destroy()