Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 3062

kernel-2.6.18-238.el5.src.rpm

From: Andy Gospodarek <gospo@redhat.com>
Date: Fri, 7 Dec 2007 19:01:37 -0500
Subject: [net] s2io: allow VLAN creation on interfaces
Message-id: 20071208000136.GG28709@gospo.usersys.redhat.com
O-Subject: [RHEL5.2 PATCH 1/2] s2io: allow VLAN creation on interfaces
Bugzilla: 354451

Without this patch, one cannot create VLANs on s2io interfaces.  This
got pulled out of RHEL5 accidently since upstream no longer needs it due
to simplified VLAN infrastructure.

This will resolve BZ 354451.

Acked-by: Neil Horman <nhorman@redhat.com>

diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index bd81931..5b146ee 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -344,6 +344,18 @@ static void s2io_vlan_rx_register(struct net_device *dev,
 /* A flag indicating whether 'RX_PA_CFG_STRIP_VLAN_TAG' bit is set or not */
 int vlan_strip_flag;
 
+/* Unregister the vlan */
+static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid)
+{
+	struct s2io_nic *nic = dev->priv;
+	unsigned long flags;
+
+	spin_lock_irqsave(&nic->tx_lock, flags);
+	if (nic->vlgrp)
+		nic->vlgrp->vlan_devices[vid] = NULL;
+	spin_unlock_irqrestore(&nic->tx_lock, flags);
+}
+
 /*
  * Constants to be programmed into the Xena's registers, to configure
  * the XAUI.
@@ -7238,6 +7250,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
 	SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
 	dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
 	dev->vlan_rx_register = s2io_vlan_rx_register;
+	dev->vlan_rx_kill_vid = (void *)s2io_vlan_rx_kill_vid;
 
 	/*
 	 * will use eth_mac_addr() for  dev->set_mac_address