summaryrefslogtreecommitdiffstats
path: root/net/8021q/vlan.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-01-21 00:22:11 -0800
committerDavid S. Miller <davem@davemloft.net>2008-01-28 15:08:26 -0800
commitef3eb3e59bd5723895b2349edec98998198ef5bb (patch)
tree586fdbc09660ae47ad863c00e061973687f7ab23 /net/8021q/vlan.c
parent7bd38d778e3f2250e96fc277040879d66c30ecb4 (diff)
downloadop-kernel-dev-ef3eb3e59bd5723895b2349edec98998198ef5bb.zip
op-kernel-dev-ef3eb3e59bd5723895b2349edec98998198ef5bb.tar.gz
[VLAN]: Move device setup to vlan_dev.c
Move device setup to vlan_dev.c and make all the VLAN device methods static. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan.c')
-rw-r--r--net/8021q/vlan.c81
1 files changed, 0 insertions, 81 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 54f2346..8bc6385 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -307,87 +307,6 @@ int unregister_vlan_device(struct net_device *dev)
return ret;
}
-/*
- * vlan network devices have devices nesting below it, and are a special
- * "super class" of normal network devices; split their locks off into a
- * separate class since they always nest.
- */
-static struct lock_class_key vlan_netdev_xmit_lock_key;
-
-static const struct header_ops vlan_header_ops = {
- .create = vlan_dev_hard_header,
- .rebuild = vlan_dev_rebuild_header,
- .parse = eth_header_parse,
-};
-
-static int vlan_dev_init(struct net_device *dev)
-{
- struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev;
- int subclass = 0;
-
- /* IFF_BROADCAST|IFF_MULTICAST; ??? */
- dev->flags = real_dev->flags & ~IFF_UP;
- dev->iflink = real_dev->ifindex;
- dev->state = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) |
- (1<<__LINK_STATE_DORMANT))) |
- (1<<__LINK_STATE_PRESENT);
-
- /* ipv6 shared card related stuff */
- dev->dev_id = real_dev->dev_id;
-
- if (is_zero_ether_addr(dev->dev_addr))
- memcpy(dev->dev_addr, real_dev->dev_addr, dev->addr_len);
- if (is_zero_ether_addr(dev->broadcast))
- memcpy(dev->broadcast, real_dev->broadcast, dev->addr_len);
-
- if (real_dev->features & NETIF_F_HW_VLAN_TX) {
- dev->header_ops = real_dev->header_ops;
- dev->hard_header_len = real_dev->hard_header_len;
- dev->hard_start_xmit = vlan_dev_hwaccel_hard_start_xmit;
- } else {
- dev->header_ops = &vlan_header_ops;
- dev->hard_header_len = real_dev->hard_header_len + VLAN_HLEN;
- dev->hard_start_xmit = vlan_dev_hard_start_xmit;
- }
-
- if (real_dev->priv_flags & IFF_802_1Q_VLAN)
- subclass = 1;
-
- lockdep_set_class_and_subclass(&dev->_xmit_lock,
- &vlan_netdev_xmit_lock_key, subclass);
- return 0;
-}
-
-void vlan_setup(struct net_device *new_dev)
-{
- ether_setup(new_dev);
-
- /* new_dev->ifindex = 0; it will be set when added to
- * the global list.
- * iflink is set as well.
- */
- /* Make this thing known as a VLAN device */
- new_dev->priv_flags |= IFF_802_1Q_VLAN;
-
- /* Set us up to have no queue, as the underlying Hardware device
- * can do all the queueing we could want.
- */
- new_dev->tx_queue_len = 0;
-
- /* set up method calls */
- new_dev->change_mtu = vlan_dev_change_mtu;
- new_dev->init = vlan_dev_init;
- new_dev->open = vlan_dev_open;
- new_dev->stop = vlan_dev_stop;
- new_dev->set_mac_address = vlan_set_mac_address;
- new_dev->set_multicast_list = vlan_dev_set_multicast_list;
- new_dev->change_rx_flags = vlan_change_rx_flags;
- new_dev->destructor = free_netdev;
- new_dev->do_ioctl = vlan_dev_ioctl;
-
- memset(new_dev->broadcast, 0, ETH_ALEN);
-}
-
static void vlan_transfer_operstate(const struct net_device *dev, struct net_device *vlandev)
{
/* Have to respect userspace enforced dormant state
OpenPOWER on IntegriCloud