Lines Matching refs:slave_dev
393 struct net_device *slave_dev) in bond_dev_queue_xmit() argument
395 skb->dev = slave_dev; in bond_dev_queue_xmit()
401 if (unlikely(netpoll_tx_running(slave_dev))) in bond_dev_queue_xmit()
402 bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb); in bond_dev_queue_xmit()
485 static void bond_add_vlans_on_slave(struct bonding *bond, struct net_device *slave_dev) in bond_add_vlans_on_slave() argument
491 res = vlan_vid_add(slave_dev, vlan->vlan_id); in bond_add_vlans_on_slave()
495 slave_dev->name); in bond_add_vlans_on_slave()
500 struct net_device *slave_dev) in bond_del_vlans_from_slave() argument
507 vlan_vid_del(slave_dev, vlan->vlan_id); in bond_del_vlans_from_slave()
557 struct net_device *slave_dev = slave->dev; in bond_update_speed_duplex() local
565 res = __ethtool_get_settings(slave_dev, &ecmd); in bond_update_speed_duplex()
604 struct net_device *slave_dev, int reporting) in bond_check_dev_link() argument
606 const struct net_device_ops *slave_ops = slave_dev->netdev_ops; in bond_check_dev_link()
611 if (!reporting && !netif_running(slave_dev)) in bond_check_dev_link()
615 return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0; in bond_check_dev_link()
618 if (slave_dev->ethtool_ops) { in bond_check_dev_link()
619 if (slave_dev->ethtool_ops->get_link) { in bond_check_dev_link()
622 link = slave_dev->ethtool_ops->get_link(slave_dev); in bond_check_dev_link()
644 strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ); in bond_check_dev_link()
646 if (IOCTL(slave_dev, &ifr, SIOCGMIIPHY) == 0) { in bond_check_dev_link()
648 if (IOCTL(slave_dev, &ifr, SIOCGMIIREG) == 0) in bond_check_dev_link()
816 struct net_device *slave_dev) in bond_mc_list_flush() argument
822 dev_mc_del(slave_dev, ha->addr); in bond_mc_list_flush()
828 dev_mc_del(slave_dev, lacpdu_multicast); in bond_mc_list_flush()
1266 static inline bool slave_dev_support_netpoll(struct net_device *slave_dev) in slave_dev_support_netpoll() argument
1268 if (slave_dev->priv_flags & IFF_DISABLE_NETPOLL) in slave_dev_support_netpoll()
1270 if (!slave_dev->netdev_ops->ndo_poll_controller) in slave_dev_support_netpoll()
1336 struct net_device *slave_dev) in bond_sethwaddr() argument
1339 pr_debug("slave_dev=%p\n", slave_dev); in bond_sethwaddr()
1340 pr_debug("slave_dev->addr_len=%d\n", slave_dev->addr_len); in bond_sethwaddr()
1341 memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len); in bond_sethwaddr()
1418 struct net_device *slave_dev) in bond_setup_by_slave() argument
1422 bond_dev->header_ops = slave_dev->header_ops; in bond_setup_by_slave()
1424 bond_dev->type = slave_dev->type; in bond_setup_by_slave()
1425 bond_dev->hard_header_len = slave_dev->hard_header_len; in bond_setup_by_slave()
1426 bond_dev->addr_len = slave_dev->addr_len; in bond_setup_by_slave()
1428 memcpy(bond_dev->broadcast, slave_dev->broadcast, in bond_setup_by_slave()
1429 slave_dev->addr_len); in bond_setup_by_slave()
1507 int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) in bond_enslave() argument
1510 const struct net_device_ops *slave_ops = slave_dev->netdev_ops; in bond_enslave()
1517 if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL && in bond_enslave()
1520 bond_dev->name, slave_dev->name); in bond_enslave()
1524 if (slave_dev->flags & IFF_SLAVE) { in bond_enslave()
1531 if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { in bond_enslave()
1532 pr_debug("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); in bond_enslave()
1535 bond_dev->name, slave_dev->name, bond_dev->name); in bond_enslave()
1539 bond_dev->name, slave_dev->name, in bond_enslave()
1540 slave_dev->name, bond_dev->name); in bond_enslave()
1543 pr_debug("%s: ! NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); in bond_enslave()
1552 if ((slave_dev->flags & IFF_UP)) { in bond_enslave()
1554 slave_dev->name); in bond_enslave()
1567 if (bond_dev->type != slave_dev->type) { in bond_enslave()
1570 bond_dev->type, slave_dev->type); in bond_enslave()
1586 if (slave_dev->type != ARPHRD_ETHER) in bond_enslave()
1587 bond_setup_by_slave(bond_dev, slave_dev); in bond_enslave()
1596 } else if (bond_dev->type != slave_dev->type) { in bond_enslave()
1598 slave_dev->name, in bond_enslave()
1599 slave_dev->type, bond_dev->type); in bond_enslave()
1617 call_netdevice_notifiers(NETDEV_JOIN, slave_dev); in bond_enslave()
1622 memcpy(bond->dev->dev_addr, slave_dev->dev_addr, in bond_enslave()
1623 slave_dev->addr_len); in bond_enslave()
1639 new_slave->original_mtu = slave_dev->mtu; in bond_enslave()
1640 res = dev_set_mtu(slave_dev, bond->dev->mtu); in bond_enslave()
1651 memcpy(new_slave->perm_hwaddr, slave_dev->dev_addr, ETH_ALEN); in bond_enslave()
1659 addr.sa_family = slave_dev->type; in bond_enslave()
1660 res = dev_set_mac_address(slave_dev, &addr); in bond_enslave()
1667 res = netdev_set_bond_master(slave_dev, bond_dev); in bond_enslave()
1674 res = dev_open(slave_dev); in bond_enslave()
1676 pr_debug("Opening slave %s failed\n", slave_dev->name); in bond_enslave()
1681 new_slave->dev = slave_dev; in bond_enslave()
1682 slave_dev->priv_flags |= IFF_BONDING; in bond_enslave()
1701 res = dev_set_promiscuity(slave_dev, 1); in bond_enslave()
1708 res = dev_set_allmulti(slave_dev, 1); in bond_enslave()
1716 dev_mc_add(slave_dev, ha->addr); in bond_enslave()
1724 dev_mc_add(slave_dev, lacpdu_multicast); in bond_enslave()
1727 bond_add_vlans_on_slave(bond, slave_dev); in bond_enslave()
1747 link_reporting = bond_check_dev_link(bond, slave_dev, 1); in bond_enslave()
1760 bond_dev->name, slave_dev->name); in bond_enslave()
1764 bond_dev->name, slave_dev->name); in bond_enslave()
1770 (bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS)) { in bond_enslave()
1847 slave_dev->npinfo = bond_netpoll_info(bond); in bond_enslave()
1848 if (slave_dev->npinfo) { in bond_enslave()
1862 res = bond_create_slave_symlinks(bond_dev, slave_dev); in bond_enslave()
1866 res = netdev_rx_handler_register(slave_dev, bond_handle_frame, in bond_enslave()
1874 bond_dev->name, slave_dev->name, in bond_enslave()
1883 bond_destroy_slave_symlinks(bond_dev, slave_dev); in bond_enslave()
1891 slave_dev->priv_flags &= ~IFF_BONDING; in bond_enslave()
1892 dev_close(slave_dev); in bond_enslave()
1895 netdev_set_bond_master(slave_dev, NULL); in bond_enslave()
1904 addr.sa_family = slave_dev->type; in bond_enslave()
1905 dev_set_mac_address(slave_dev, &addr); in bond_enslave()
1909 dev_set_mtu(slave_dev, new_slave->original_mtu); in bond_enslave()
1931 int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) in bond_release() argument
1940 if (!(slave_dev->flags & IFF_SLAVE) || in bond_release()
1941 (slave_dev->master != bond_dev)) { in bond_release()
1943 bond_dev->name, slave_dev->name); in bond_release()
1951 slave = bond_get_slave_by_dev(bond, slave_dev); in bond_release()
1955 bond_dev->name, slave_dev->name); in bond_release()
1965 netdev_rx_handler_unregister(slave_dev); in bond_release()
1972 bond_dev->name, slave_dev->name, in bond_release()
1974 bond_dev->name, slave_dev->name); in bond_release()
1988 slave_dev->name); in bond_release()
2058 bond_dev->name, slave_dev->name, bond_dev->name); in bond_release()
2061 bond_destroy_slave_symlinks(bond_dev, slave_dev); in bond_release()
2063 bond_del_vlans_from_slave(bond, slave_dev); in bond_release()
2078 dev_set_promiscuity(slave_dev, -1); in bond_release()
2082 dev_set_allmulti(slave_dev, -1); in bond_release()
2086 bond_mc_list_flush(bond_dev, slave_dev); in bond_release()
2090 netdev_set_bond_master(slave_dev, NULL); in bond_release()
2095 dev_close(slave_dev); in bond_release()
2100 addr.sa_family = slave_dev->type; in bond_release()
2101 dev_set_mac_address(slave_dev, &addr); in bond_release()
2104 dev_set_mtu(slave_dev, slave->original_mtu); in bond_release()
2106 slave_dev->priv_flags &= ~IFF_BONDING; in bond_release()
2118 struct net_device *slave_dev) in bond_release_and_destroy() argument
2123 ret = bond_release(bond_dev, slave_dev); in bond_release_and_destroy()
2140 struct net_device *slave_dev; in bond_release_all() local
2161 slave_dev = slave->dev; in bond_release_all()
2173 netdev_rx_handler_unregister(slave_dev); in bond_release_all()
2183 bond_destroy_slave_symlinks(bond_dev, slave_dev); in bond_release_all()
2184 bond_del_vlans_from_slave(bond, slave_dev); in bond_release_all()
2193 dev_set_promiscuity(slave_dev, -1); in bond_release_all()
2197 dev_set_allmulti(slave_dev, -1); in bond_release_all()
2201 bond_mc_list_flush(bond_dev, slave_dev); in bond_release_all()
2205 netdev_set_bond_master(slave_dev, NULL); in bond_release_all()
2210 dev_close(slave_dev); in bond_release_all()
2215 addr.sa_family = slave_dev->type; in bond_release_all()
2216 dev_set_mac_address(slave_dev, &addr); in bond_release_all()
2259 static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_device *slave_dev) in bond_ioctl_change_active() argument
2270 if (!(slave_dev->flags & IFF_SLAVE) || (slave_dev->master != bond_dev)) in bond_ioctl_change_active()
2279 new_active = bond_get_slave_by_dev(bond, slave_dev); in bond_ioctl_change_active()
2623 static void bond_arp_send(struct net_device *slave_dev, int arp_op, __be32 dest_ip, __be32 src_ip, … in bond_arp_send() argument
2628 slave_dev->name, dest_ip, src_ip, vlan_id); in bond_arp_send()
2630 skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip, in bond_arp_send()
2631 NULL, slave_dev->dev_addr, NULL); in bond_arp_send()
3247 struct net_device *slave_dev) in bond_slave_netdev_event() argument
3249 struct net_device *bond_dev = slave_dev->master; in bond_slave_netdev_event()
3257 bond_release_and_destroy(bond_dev, slave_dev); in bond_slave_netdev_event()
3259 bond_release(bond_dev, slave_dev); in bond_slave_netdev_event()
3264 slave = bond_get_slave_by_dev(bond, slave_dev); in bond_slave_netdev_event()
3552 struct net_device *slave_dev = NULL; in bond_do_ioctl() local
3627 slave_dev = dev_get_by_name(dev_net(bond_dev), ifr->ifr_slave); in bond_do_ioctl()
3629 pr_debug("slave_dev=%p:\n", slave_dev); in bond_do_ioctl()
3631 if (!slave_dev) in bond_do_ioctl()
3634 pr_debug("slave_dev->name=%s:\n", slave_dev->name); in bond_do_ioctl()
3638 res = bond_enslave(bond_dev, slave_dev); in bond_do_ioctl()
3642 res = bond_release(bond_dev, slave_dev); in bond_do_ioctl()
3646 res = bond_sethwaddr(bond_dev, slave_dev); in bond_do_ioctl()
3650 res = bond_ioctl_change_active(bond_dev, slave_dev); in bond_do_ioctl()
3656 dev_put(slave_dev); in bond_do_ioctl()