Lines Matching defs:bond_dev

250 static int bond_init(struct net_device *bond_dev);
251 static void bond_uninit(struct net_device *bond_dev);
428 * @bond_dev: bonding net device that got called
431 static int bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid)
433 struct bonding *bond = netdev_priv(bond_dev);
446 bond_dev->name, vid);
463 * @bond_dev: bonding net device that got called
466 static int bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid)
468 struct bonding *bond = netdev_priv(bond_dev);
478 bond_dev->name, vid);
769 struct net_device *bond_dev, *vlan_dev, *master_dev;
774 bond_dev = bond->dev;
777 __bond_resend_igmp_join_requests(bond_dev);
783 master_dev = bond_dev->master;
786 && (bond_dev->priv_flags & IFF_BRIDGE_PORT))
792 vlan_dev = __vlan_find_dev_deep(bond_dev,
815 static void bond_mc_list_flush(struct net_device *bond_dev,
818 struct bonding *bond = netdev_priv(bond_dev);
821 netdev_for_each_mc_addr(ha, bond_dev)
1275 static void bond_poll_controller(struct net_device *bond_dev)
1288 static void bond_netpoll_cleanup(struct net_device *bond_dev)
1290 struct bonding *bond = netdev_priv(bond_dev);
1328 static void bond_netpoll_cleanup(struct net_device *bond_dev)
1335 static int bond_sethwaddr(struct net_device *bond_dev,
1338 pr_debug("bond_dev=%p\n", bond_dev);
1341 memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len);
1383 struct net_device *bond_dev = bond->dev;
1402 bond_dev->vlan_features = vlan_features;
1403 bond_dev->hard_header_len = max_hard_header_len;
1407 netdev_change_features(bond_dev);
1410 static void bond_setup_by_slave(struct net_device *bond_dev,
1413 struct bonding *bond = netdev_priv(bond_dev);
1415 bond_dev->header_ops = slave_dev->header_ops;
1417 bond_dev->type = slave_dev->type;
1418 bond_dev->hard_header_len = slave_dev->hard_header_len;
1419 bond_dev->addr_len = slave_dev->addr_len;
1421 memcpy(bond_dev->broadcast, slave_dev->broadcast,
1500 int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1502 struct bonding *bond = netdev_priv(bond_dev);
1513 bond_dev->name, slave_dev->name);
1528 bond_dev->name, slave_dev->name, bond_dev->name);
1532 bond_dev->name, slave_dev->name,
1533 slave_dev->name, bond_dev->name);
1560 if (bond_dev->type != slave_dev->type) {
1562 bond_dev->name,
1563 bond_dev->type, slave_dev->type);
1565 res = netdev_bonding_change(bond_dev,
1570 bond_dev->name);
1576 dev_uc_flush(bond_dev);
1577 dev_mc_flush(bond_dev);
1580 bond_setup_by_slave(bond_dev, slave_dev);
1582 ether_setup(bond_dev);
1583 bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
1586 netdev_bonding_change(bond_dev,
1589 } else if (bond_dev->type != slave_dev->type) {
1592 slave_dev->type, bond_dev->type);
1600 bond_dev->name);
1604 bond_dev->name);
1651 memcpy(addr.sa_data, bond_dev->dev_addr, bond_dev->addr_len);
1660 res = netdev_set_bond_master(slave_dev, bond_dev);
1693 if (bond_dev->flags & IFF_PROMISC) {
1700 if (bond_dev->flags & IFF_ALLMULTI) {
1706 netif_addr_lock_bh(bond_dev);
1708 netdev_for_each_mc_addr(ha, bond_dev)
1710 netif_addr_unlock_bh(bond_dev);
1751 bond_dev->name, slave_dev->name);
1755 bond_dev->name, slave_dev->name);
1846 bond_dev->name);
1855 res = bond_create_slave_symlinks(bond_dev, slave_dev);
1867 bond_dev->name, slave_dev->name,
1876 bond_destroy_slave_symlinks(bond_dev, slave_dev);
1923 int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1925 struct bonding *bond = netdev_priv(bond_dev);
1928 netdev_features_t old_features = bond_dev->features;
1932 (slave_dev->master != bond_dev)) {
1934 bond_dev->name, slave_dev->name);
1939 netdev_bonding_change(bond_dev, NETDEV_RELEASE);
1946 bond_dev->name, slave_dev->name);
1961 if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) &&
1964 bond_dev->name, slave_dev->name,
1966 bond_dev->name, slave_dev->name);
1978 bond_dev->name,
2030 memset(bond_dev->dev_addr, 0, bond_dev->addr_len);
2034 bond_dev->name, bond_dev->name);
2036 bond_dev->name);
2047 if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) &&
2050 bond_dev->name, slave_dev->name, bond_dev->name);
2053 bond_destroy_slave_symlinks(bond_dev, slave_dev);
2063 if (bond_dev->flags & IFF_PROMISC)
2067 if (bond_dev->flags & IFF_ALLMULTI)
2071 netif_addr_lock_bh(bond_dev);
2072 bond_mc_list_flush(bond_dev, slave_dev);
2073 netif_addr_unlock_bh(bond_dev);
2103 static int bond_release_and_destroy(struct net_device *bond_dev,
2106 struct bonding *bond = netdev_priv(bond_dev);
2109 ret = bond_release(bond_dev, slave_dev);
2111 bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
2113 bond_dev->name, bond_dev->name);
2114 unregister_netdevice(bond_dev);
2122 static int bond_release_all(struct net_device *bond_dev)
2124 struct bonding *bond = netdev_priv(bond_dev);
2131 netif_carrier_off(bond_dev);
2169 bond_destroy_slave_symlinks(bond_dev, slave_dev);
2178 if (bond_dev->flags & IFF_PROMISC)
2182 if (bond_dev->flags & IFF_ALLMULTI)
2186 netif_addr_lock_bh(bond_dev);
2187 bond_mc_list_flush(bond_dev, slave_dev);
2188 netif_addr_unlock_bh(bond_dev);
2215 memset(bond_dev->dev_addr, 0, bond_dev->addr_len);
2219 bond_dev->name, bond_dev->name);
2221 bond_dev->name);
2224 pr_info("%s: released all slaves\n", bond_dev->name);
2245 static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_device *slave_dev)
2247 struct bonding *bond = netdev_priv(bond_dev);
2256 if (!(slave_dev->flags & IFF_SLAVE) || (slave_dev->master != bond_dev))
2292 static int bond_info_query(struct net_device *bond_dev, struct ifbond *info)
2294 struct bonding *bond = netdev_priv(bond_dev);
2306 static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *info)
2308 struct bonding *bond = netdev_priv(bond_dev);
3214 struct net_device *bond_dev)
3216 struct bonding *event_bond = netdev_priv(bond_dev);
3231 struct net_device *bond_dev = slave_dev->master;
3232 struct bonding *bond = netdev_priv(bond_dev);
3237 if (bond_dev) {
3239 bond_release_and_destroy(bond_dev, slave_dev);
3241 bond_release(bond_dev, slave_dev);
3390 static int bond_open(struct net_device *bond_dev)
3392 struct bonding *bond = netdev_priv(bond_dev);
3456 static int bond_close(struct net_device *bond_dev)
3458 struct bonding *bond = netdev_priv(bond_dev);
3500 static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
3503 struct bonding *bond = netdev_priv(bond_dev);
3548 static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd)
3558 pr_debug("bond_ioctl: master=%s, cmd=%d\n", bond_dev->name, cmd);
3579 struct bonding *bond = netdev_priv(bond_dev);
3598 res = bond_info_query(bond_dev, &k_binfo);
3611 res = bond_slave_info_query(bond_dev, &k_sinfo);
3625 slave_dev = dev_get_by_name(dev_net(bond_dev), ifr->ifr_slave);
3636 res = bond_enslave(bond_dev, slave_dev);
3640 res = bond_release(bond_dev, slave_dev);
3644 res = bond_sethwaddr(bond_dev, slave_dev);
3648 res = bond_ioctl_change_active(bond_dev, slave_dev);
3673 static void bond_change_rx_flags(struct net_device *bond_dev, int change)
3675 struct bonding *bond = netdev_priv(bond_dev);
3679 bond_dev->flags & IFF_PROMISC ? 1 : -1);
3683 bond_dev->flags & IFF_ALLMULTI ? 1 : -1);
3686 static void bond_set_multicast_list(struct net_device *bond_dev)
3688 struct bonding *bond = netdev_priv(bond_dev);
3695 netdev_for_each_mc_addr(ha, bond_dev) {
3697 bond_dev->addr_len);
3704 found = bond_addr_in_mc_list(ha->addr, &bond_dev->mc,
3705 bond_dev->addr_len);
3712 __hw_addr_add_multiple(&bond->mc_list, &bond_dev->mc,
3713 bond_dev->addr_len, NETDEV_HW_ADDR_T_MULTICAST);
3770 static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
3772 struct bonding *bond = netdev_priv(bond_dev);
3778 (bond_dev ? bond_dev->name : "None"), new_mtu);
3817 bond_dev->mtu = new_mtu;
3827 tmp_res = dev_set_mtu(slave->dev, bond_dev->mtu);
3844 static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
3846 struct bonding *bond = netdev_priv(bond_dev);
3853 return bond_alb_set_mac_address(bond_dev, addr);
3857 bond, bond_dev ? bond_dev->name : "None");
3908 memcpy(bond_dev->dev_addr, sa->sa_data, bond_dev->addr_len);
3912 memcpy(tmp_sa.sa_data, bond_dev->dev_addr, bond_dev->addr_len);
3913 tmp_sa.sa_family = bond_dev->type;
3930 static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev)
3932 struct bonding *bond = netdev_priv(bond_dev);
3992 static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dev)
3994 struct bonding *bond = netdev_priv(bond_dev);
4017 static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev)
4019 struct bonding *bond = netdev_priv(bond_dev);
4055 static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)
4057 struct bonding *bond = netdev_priv(bond_dev);
4078 bond_dev->name);
4238 struct net_device *bond_dev = bond->dev;
4260 bond_dev->name, mode);
4265 static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
4304 static void bond_destructor(struct net_device *bond_dev)
4306 struct bonding *bond = netdev_priv(bond_dev);
4309 free_netdev(bond_dev);
4312 static void bond_setup(struct net_device *bond_dev)
4314 struct bonding *bond = netdev_priv(bond_dev);
4323 bond->dev = bond_dev;
4327 ether_setup(bond_dev);
4328 bond_dev->netdev_ops = &bond_netdev_ops;
4329 bond_dev->ethtool_ops = &bond_ethtool_ops;
4332 bond_dev->destructor = bond_destructor;
4335 bond_dev->tx_queue_len = 0;
4336 bond_dev->flags |= IFF_MASTER|IFF_MULTICAST;
4337 bond_dev->priv_flags |= IFF_BONDING;
4338 bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
4345 bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
4349 bond_dev->features |= NETIF_F_LLTX;
4358 bond_dev->hw_features = BOND_VLAN_FEATURES |
4363 bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_HW_CSUM);
4364 bond_dev->features |= bond_dev->hw_features;
4391 static void bond_uninit(struct net_device *bond_dev)
4393 struct bonding *bond = netdev_priv(bond_dev);
4396 bond_netpoll_cleanup(bond_dev);
4399 bond_release_all(bond_dev);
4785 static int bond_init(struct net_device *bond_dev)
4787 struct bonding *bond = netdev_priv(bond_dev);
4788 struct bond_net *bn = net_generic(dev_net(bond_dev), bond_net_id);
4791 pr_debug("Begin bond_init for %s\n", bond_dev->name);
4802 bond->wq = create_singlethread_workqueue(bond_dev->name);
4806 bond_set_lockdep_class(bond_dev);
4853 struct net_device *bond_dev;
4858 bond_dev = alloc_netdev_mq(sizeof(struct bonding),
4861 if (!bond_dev) {
4867 dev_net_set(bond_dev, net);
4868 bond_dev->rtnl_link_ops = &bond_link_ops;
4870 res = register_netdevice(bond_dev);
4872 netif_carrier_off(bond_dev);
4876 bond_destructor(bond_dev);