Commit d2d1acdb authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

VLAN: kill_vid is only useful for VLAN filtering devices

The interface for network device VLAN extension was confusing.
The kill_vid function is only really useful for devices that do
hardware filtering. Devices that only do VLAN receiption without
filtering were being forced to provide the hook, and there were
bugs in those devices.

Many drivers had kill_vid routine that called vlan_group_set_device, with
NULL, but that is done already.
Signed-off-by: default avatarStephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent e68a8c10
...@@ -240,10 +240,8 @@ static int unregister_vlan_dev(struct net_device *real_dev, ...@@ -240,10 +240,8 @@ static int unregister_vlan_dev(struct net_device *real_dev,
* interlock with HW accelerating devices or SW vlan * interlock with HW accelerating devices or SW vlan
* input packet processing. * input packet processing.
*/ */
if (real_dev->features & if (real_dev->features & NETIF_F_HW_VLAN_FILTER)
(NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER)) {
real_dev->vlan_rx_kill_vid(real_dev, vlan_id); real_dev->vlan_rx_kill_vid(real_dev, vlan_id);
}
vlan_group_set_device(grp, vlan_id, NULL); vlan_group_set_device(grp, vlan_id, NULL);
synchronize_net(); synchronize_net();
...@@ -409,16 +407,14 @@ static struct net_device *register_vlan_device(const char *eth_IF_name, ...@@ -409,16 +407,14 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
} }
if ((real_dev->features & NETIF_F_HW_VLAN_RX) && if ((real_dev->features & NETIF_F_HW_VLAN_RX) &&
(real_dev->vlan_rx_register == NULL || !real_dev->vlan_rx_register) {
real_dev->vlan_rx_kill_vid == NULL)) {
printk(VLAN_DBG "%s: Device %s has buggy VLAN hw accel.\n", printk(VLAN_DBG "%s: Device %s has buggy VLAN hw accel.\n",
__FUNCTION__, real_dev->name); __FUNCTION__, real_dev->name);
goto out_put_dev; goto out_put_dev;
} }
if ((real_dev->features & NETIF_F_HW_VLAN_FILTER) && if ((real_dev->features & NETIF_F_HW_VLAN_FILTER) &&
(real_dev->vlan_rx_add_vid == NULL || (!real_dev->vlan_rx_add_vid || !real_dev->vlan_rx_kill_vid)) {
real_dev->vlan_rx_kill_vid == NULL)) {
printk(VLAN_DBG "%s: Device %s has buggy VLAN hw accel.\n", printk(VLAN_DBG "%s: Device %s has buggy VLAN hw accel.\n",
__FUNCTION__, real_dev->name); __FUNCTION__, real_dev->name);
goto out_put_dev; goto out_put_dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment