macvlan.c (d94e5fcbf1420366dcb4102bafe04dbcfc0d0d4b) macvlan.c (23289a37e2b127dfc4de1313fba15bb4c9f0cd5b)
1/*
2 * Copyright (c) 2007 Patrick McHardy <kaber@trash.net>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *

--- 541 unchanged lines hidden (view full) ---

550 if (err < 0)
551 return err;
552
553 list_add_tail(&vlan->list, &port->vlans);
554 macvlan_transfer_operstate(dev);
555 return 0;
556}
557
1/*
2 * Copyright (c) 2007 Patrick McHardy <kaber@trash.net>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *

--- 541 unchanged lines hidden (view full) ---

550 if (err < 0)
551 return err;
552
553 list_add_tail(&vlan->list, &port->vlans);
554 macvlan_transfer_operstate(dev);
555 return 0;
556}
557
558static void macvlan_dellink(struct net_device *dev)
558static void macvlan_dellink(struct net_device *dev, struct list_head *head)
559{
560 struct macvlan_dev *vlan = netdev_priv(dev);
561 struct macvlan_port *port = vlan->port;
562
563 list_del(&vlan->list);
559{
560 struct macvlan_dev *vlan = netdev_priv(dev);
561 struct macvlan_port *port = vlan->port;
562
563 list_del(&vlan->list);
564 unregister_netdevice(dev);
564 unregister_netdevice_queue(dev, head);
565
566 if (list_empty(&port->vlans))
567 macvlan_port_destroy(port->dev);
568}
569
570static struct rtnl_link_ops macvlan_link_ops __read_mostly = {
571 .kind = "macvlan",
572 .priv_size = sizeof(struct macvlan_dev),

--- 23 unchanged lines hidden (view full) ---

596 case NETDEV_FEAT_CHANGE:
597 list_for_each_entry(vlan, &port->vlans, list) {
598 vlan->dev->features = dev->features & MACVLAN_FEATURES;
599 netdev_features_change(vlan->dev);
600 }
601 break;
602 case NETDEV_UNREGISTER:
603 list_for_each_entry_safe(vlan, next, &port->vlans, list)
565
566 if (list_empty(&port->vlans))
567 macvlan_port_destroy(port->dev);
568}
569
570static struct rtnl_link_ops macvlan_link_ops __read_mostly = {
571 .kind = "macvlan",
572 .priv_size = sizeof(struct macvlan_dev),

--- 23 unchanged lines hidden (view full) ---

596 case NETDEV_FEAT_CHANGE:
597 list_for_each_entry(vlan, &port->vlans, list) {
598 vlan->dev->features = dev->features & MACVLAN_FEATURES;
599 netdev_features_change(vlan->dev);
600 }
601 break;
602 case NETDEV_UNREGISTER:
603 list_for_each_entry_safe(vlan, next, &port->vlans, list)
604 macvlan_dellink(vlan->dev);
604 macvlan_dellink(vlan->dev, NULL);
605 break;
606 }
607 return NOTIFY_DONE;
608}
609
610static struct notifier_block macvlan_notifier_block __read_mostly = {
611 .notifier_call = macvlan_device_event,
612};

--- 32 unchanged lines hidden ---
605 break;
606 }
607 return NOTIFY_DONE;
608}
609
610static struct notifier_block macvlan_notifier_block __read_mostly = {
611 .notifier_call = macvlan_device_event,
612};

--- 32 unchanged lines hidden ---