• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/net/bonding/

Lines Matching defs:bond_dev

239 static int bond_init(struct net_device *bond_dev);
240 static void bond_uninit(struct net_device *bond_dev);
481 * @bond_dev: bonding net device that got called
484 static void bond_vlan_rx_register(struct net_device *bond_dev,
487 struct bonding *bond = netdev_priv(bond_dev);
508 * @bond_dev: bonding net device that got called
511 static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid)
513 struct bonding *bond = netdev_priv(bond_dev);
530 bond_dev->name, vid);
536 * @bond_dev: bonding net device that got called
539 static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid)
541 struct bonding *bond = netdev_priv(bond_dev);
564 bond_dev->name, vid);
891 static void bond_mc_list_flush(struct net_device *bond_dev,
894 struct bonding *bond = netdev_priv(bond_dev);
897 netdev_for_each_mc_addr(ha, bond_dev)
1279 static bool slaves_support_netpoll(struct net_device *bond_dev)
1281 struct bonding *bond = netdev_priv(bond_dev);
1294 static void bond_poll_controller(struct net_device *bond_dev)
1296 struct net_device *dev = bond_dev->npinfo->netpoll->real_dev;
1297 if (dev != bond_dev)
1301 static void bond_netpoll_cleanup(struct net_device *bond_dev)
1303 struct bonding *bond = netdev_priv(bond_dev);
1309 bond_dev->npinfo = NULL;
1324 static void bond_netpoll_cleanup(struct net_device *bond_dev)
1332 static int bond_sethwaddr(struct net_device *bond_dev,
1335 pr_debug("bond_dev=%p\n", bond_dev);
1338 memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len);
1354 struct net_device *bond_dev = bond->dev;
1355 unsigned long features = bond_dev->features;
1358 bond_dev->hard_header_len);
1382 features |= (bond_dev->features & BOND_VLAN_FEATURES);
1383 bond_dev->features = netdev_fix_features(features, NULL);
1384 bond_dev->vlan_features = netdev_fix_features(vlan_features, NULL);
1385 bond_dev->hard_header_len = max_hard_header_len;
1390 static void bond_setup_by_slave(struct net_device *bond_dev,
1393 struct bonding *bond = netdev_priv(bond_dev);
1395 bond_dev->header_ops = slave_dev->header_ops;
1397 bond_dev->type = slave_dev->type;
1398 bond_dev->hard_header_len = slave_dev->hard_header_len;
1399 bond_dev->addr_len = slave_dev->addr_len;
1401 memcpy(bond_dev->broadcast, slave_dev->broadcast,
1407 int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1409 struct bonding *bond = netdev_priv(bond_dev);
1415 int old_features = bond_dev->features;
1421 bond_dev->name, slave_dev->name);
1425 if (!(bond_dev->flags & IFF_UP)) {
1427 bond_dev->name);
1442 bond_dev->name, slave_dev->name, bond_dev->name);
1446 bond_dev->name, slave_dev->name,
1447 slave_dev->name, bond_dev->name);
1448 bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
1456 bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED;
1481 if (bond_dev->type != slave_dev->type) {
1483 bond_dev->name,
1484 bond_dev->type, slave_dev->type);
1486 res = netdev_bonding_change(bond_dev,
1491 bond_dev->name);
1497 dev_uc_flush(bond_dev);
1498 dev_mc_flush(bond_dev);
1501 bond_setup_by_slave(bond_dev, slave_dev);
1503 ether_setup(bond_dev);
1505 netdev_bonding_change(bond_dev,
1508 } else if (bond_dev->type != slave_dev->type) {
1511 slave_dev->type, bond_dev->type);
1519 bond_dev->name);
1523 bond_dev->name);
1568 memcpy(addr.sa_data, bond_dev->dev_addr, bond_dev->addr_len);
1577 res = netdev_set_master(slave_dev, bond_dev);
1608 if (bond_dev->flags & IFF_PROMISC) {
1615 if (bond_dev->flags & IFF_ALLMULTI) {
1621 netif_addr_lock_bh(bond_dev);
1623 netdev_for_each_mc_addr(ha, bond_dev)
1625 netif_addr_unlock_bh(bond_dev);
1666 bond_dev->name, slave_dev->name);
1670 bond_dev->name, slave_dev->name);
1694 bond_dev->name, new_slave->dev->name);
1698 bond_dev->name);
1770 bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
1772 if (slaves_support_netpoll(bond_dev)) {
1773 bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL;
1774 if (bond_dev->npinfo)
1775 slave_dev->npinfo = bond_dev->npinfo;
1776 } else if (!(bond_dev->priv_flags & IFF_DISABLE_NETPOLL)) {
1777 bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
1780 pr_info("Disabling netpoll support for %s\n", bond_dev->name);
1786 res = bond_create_slave_symlinks(bond_dev, slave_dev);
1791 bond_dev->name, slave_dev->name,
1819 bond_dev->features = old_features;
1835 int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1837 struct bonding *bond = netdev_priv(bond_dev);
1843 (slave_dev->master != bond_dev)) {
1845 bond_dev->name, slave_dev->name);
1849 netdev_bonding_change(bond_dev, NETDEV_BONDING_DESLAVE);
1856 bond_dev->name, slave_dev->name);
1862 if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) &&
1865 bond_dev->name, slave_dev->name,
1867 bond_dev->name, slave_dev->name);
1879 bond_dev->name,
1933 memset(bond_dev->dev_addr, 0, bond_dev->addr_len);
1936 bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
1939 bond_dev->name, bond_dev->name);
1941 bond_dev->name);
1943 } else if ((bond_dev->features & NETIF_F_VLAN_CHALLENGED) &&
1946 bond_dev->name, slave_dev->name, bond_dev->name);
1947 bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED;
1953 bond_destroy_slave_symlinks(bond_dev, slave_dev);
1963 if (bond_dev->flags & IFF_PROMISC)
1967 if (bond_dev->flags & IFF_ALLMULTI)
1971 netif_addr_lock_bh(bond_dev);
1972 bond_mc_list_flush(bond_dev, slave_dev);
1973 netif_addr_unlock_bh(bond_dev);
1983 if (slaves_support_netpoll(bond_dev))
1984 bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL;
2017 int bond_release_and_destroy(struct net_device *bond_dev,
2020 struct bonding *bond = netdev_priv(bond_dev);
2023 ret = bond_release(bond_dev, slave_dev);
2026 bond_dev->name, bond_dev->name);
2027 unregister_netdevice(bond_dev);
2035 static int bond_release_all(struct net_device *bond_dev)
2037 struct bonding *bond = netdev_priv(bond_dev);
2044 netif_carrier_off(bond_dev);
2078 bond_destroy_slave_symlinks(bond_dev, slave_dev);
2087 if (bond_dev->flags & IFF_PROMISC)
2091 if (bond_dev->flags & IFF_ALLMULTI)
2095 netif_addr_lock_bh(bond_dev);
2096 bond_mc_list_flush(bond_dev, slave_dev);
2097 netif_addr_unlock_bh(bond_dev);
2125 memset(bond_dev->dev_addr, 0, bond_dev->addr_len);
2128 bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
2131 bond_dev->name, bond_dev->name);
2133 bond_dev->name);
2136 pr_info("%s: released all slaves\n", bond_dev->name);
2155 static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_device *slave_dev)
2157 struct bonding *bond = netdev_priv(bond_dev);
2166 if (!(slave_dev->flags & IFF_SLAVE) || (slave_dev->master != bond_dev))
2200 static int bond_info_query(struct net_device *bond_dev, struct ifbond *info)
2202 struct bonding *bond = netdev_priv(bond_dev);
2214 static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *info)
2216 struct bonding *bond = netdev_priv(bond_dev);
3373 struct net_device *bond_dev = bond->dev;
3374 struct bond_net *bn = net_generic(dev_net(bond_dev), bond_net_id);
3377 bond->proc_entry = proc_create_data(bond_dev->name,
3382 DRV_NAME, bond_dev->name);
3384 memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ);
3390 struct net_device *bond_dev = bond->dev;
3391 struct bond_net *bn = net_generic(dev_net(bond_dev), bond_net_id);
3459 struct net_device *bond_dev)
3461 struct bonding *event_bond = netdev_priv(bond_dev);
3476 struct net_device *bond_dev = slave_dev->master;
3477 struct bonding *bond = netdev_priv(bond_dev);
3481 if (bond_dev) {
3483 bond_release_and_destroy(bond_dev, slave_dev);
3485 bond_release(bond_dev, slave_dev);
3736 static int bond_open(struct net_device *bond_dev)
3738 struct bonding *bond = netdev_priv(bond_dev);
3784 static int bond_close(struct net_device *bond_dev)
3786 struct bonding *bond = netdev_priv(bond_dev);
3837 static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
3840 struct bonding *bond = netdev_priv(bond_dev);
3885 static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd)
3895 pr_debug("bond_ioctl: master=%s, cmd=%d\n", bond_dev->name, cmd);
3916 struct bonding *bond = netdev_priv(bond_dev);
3935 res = bond_info_query(bond_dev, &k_binfo);
3948 res = bond_slave_info_query(bond_dev, &k_sinfo);
3962 slave_dev = dev_get_by_name(dev_net(bond_dev), ifr->ifr_slave);
3973 res = bond_enslave(bond_dev, slave_dev);
3977 res = bond_release(bond_dev, slave_dev);
3981 res = bond_sethwaddr(bond_dev, slave_dev);
3985 res = bond_ioctl_change_active(bond_dev, slave_dev);
4010 static void bond_set_multicast_list(struct net_device *bond_dev)
4012 struct bonding *bond = netdev_priv(bond_dev);
4019 if ((bond_dev->flags & IFF_PROMISC) && !(bond->flags & IFF_PROMISC))
4023 if (!(bond_dev->flags & IFF_PROMISC) && (bond->flags & IFF_PROMISC))
4028 if ((bond_dev->flags & IFF_ALLMULTI) && !(bond->flags & IFF_ALLMULTI))
4032 if (!(bond_dev->flags & IFF_ALLMULTI) && (bond->flags & IFF_ALLMULTI))
4038 bond->flags = bond_dev->flags;
4041 netdev_for_each_mc_addr(ha, bond_dev) {
4043 bond_dev->addr_len);
4050 found = bond_addr_in_mc_list(ha->addr, &bond_dev->mc,
4051 bond_dev->addr_len);
4058 __hw_addr_add_multiple(&bond->mc_list, &bond_dev->mc,
4059 bond_dev->addr_len, NETDEV_HW_ADDR_T_MULTICAST);
4081 static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
4083 struct bonding *bond = netdev_priv(bond_dev);
4089 (bond_dev ? bond_dev->name : "None"), new_mtu);
4128 bond_dev->mtu = new_mtu;
4138 tmp_res = dev_set_mtu(slave->dev, bond_dev->mtu);
4155 static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
4157 struct bonding *bond = netdev_priv(bond_dev);
4164 return bond_alb_set_mac_address(bond_dev, addr);
4168 bond, bond_dev ? bond_dev->name : "None");
4219 memcpy(bond_dev->dev_addr, sa->sa_data, bond_dev->addr_len);
4223 memcpy(tmp_sa.sa_data, bond_dev->dev_addr, bond_dev->addr_len);
4224 tmp_sa.sa_family = bond_dev->type;
4241 static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev)
4243 struct bonding *bond = netdev_priv(bond_dev);
4307 static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dev)
4309 struct bonding *bond = netdev_priv(bond_dev);
4338 static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev)
4340 struct bonding *bond = netdev_priv(bond_dev);
4382 static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)
4384 struct bonding *bond = netdev_priv(bond_dev);
4410 bond_dev->name);
4539 struct net_device *bond_dev = bond->dev;
4563 bond_dev->name, mode);
4568 static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
4608 static void bond_destructor(struct net_device *bond_dev)
4610 struct bonding *bond = netdev_priv(bond_dev);
4613 free_netdev(bond_dev);
4616 static void bond_setup(struct net_device *bond_dev)
4618 struct bonding *bond = netdev_priv(bond_dev);
4627 bond->dev = bond_dev;
4631 ether_setup(bond_dev);
4632 bond_dev->netdev_ops = &bond_netdev_ops;
4633 bond_dev->ethtool_ops = &bond_ethtool_ops;
4636 bond_dev->destructor = bond_destructor;
4639 bond_dev->tx_queue_len = 0;
4640 bond_dev->flags |= IFF_MASTER|IFF_MULTICAST;
4641 bond_dev->priv_flags |= IFF_BONDING;
4642 bond_dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
4645 bond_dev->priv_flags |= IFF_MASTER_ARPMON;
4652 bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
4656 bond_dev->features |= NETIF_F_LLTX;
4664 bond_dev->features |= (NETIF_F_HW_VLAN_TX |
4695 static void bond_uninit(struct net_device *bond_dev)
4697 struct bonding *bond = netdev_priv(bond_dev);
4700 bond_netpoll_cleanup(bond_dev);
4703 bond_release_all(bond_dev);
5085 static int bond_init(struct net_device *bond_dev)
5087 struct bonding *bond = netdev_priv(bond_dev);
5088 struct bond_net *bn = net_generic(dev_net(bond_dev), bond_net_id);
5090 pr_debug("Begin bond_init for %s\n", bond_dev->name);
5092 bond->wq = create_singlethread_workqueue(bond_dev->name);
5096 bond_set_lockdep_class(bond_dev);
5098 netif_carrier_off(bond_dev);
5134 struct net_device *bond_dev;
5139 bond_dev = alloc_netdev_mq(sizeof(struct bonding), name ? name : "",
5141 if (!bond_dev) {
5147 dev_net_set(bond_dev, net);
5148 bond_dev->rtnl_link_ops = &bond_link_ops;
5151 res = dev_alloc_name(bond_dev, "bond%d");
5165 res = register_netdevice(bond_dev);
5170 bond_destructor(bond_dev);