Many drivers had code that did kill_vid, but they weren't doing vlan filtering. With new API the stub is unneeded unless device sets NETIF_F_HW_VLAN_FILTER. Bad habit: I couldn't resist fixing a couple of nearby style things in acenic, and forcedeth. Signed-off-by: Stephen Hemminger --- drivers/net/acenic.c | 21 +++------------------ drivers/net/acenic.h | 1 - drivers/net/amd8111e.c | 11 +---------- drivers/net/bnx2.c | 14 -------------- drivers/net/chelsio/cxgb2.c | 10 ---------- drivers/net/cxgb3/cxgb3_main.c | 6 ------ drivers/net/forcedeth.c | 8 +------- drivers/net/gianfar.c | 16 ---------------- drivers/net/ns83820.c | 12 ------------ drivers/net/r8169.c | 11 ----------- drivers/net/s2io.c | 12 ------------ drivers/net/spider_net.c | 40 ---------------------------------------- drivers/net/tg3.c | 16 ---------------- drivers/net/typhoon.c | 11 +---------- 15 files changed, 7 insertions(+), 207 deletions(-) --- a/drivers/net/acenic.c 2007-06-01 08:41:22.000000000 -0700 +++ b/drivers/net/acenic.c 2007-06-01 08:41:49.000000000 -0700 @@ -480,12 +480,10 @@ static int __devinit acenic_probe_one(st #if ACENIC_DO_VLAN dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = ace_vlan_rx_register; - dev->vlan_rx_kill_vid = ace_vlan_rx_kill_vid; #endif - if (1) { - dev->tx_timeout = &ace_watchdog; - dev->watchdog_timeo = 5*HZ; - } + + dev->tx_timeout = &ace_watchdog; + dev->watchdog_timeo = 5*HZ; dev->open = &ace_open; dev->stop = &ace_close; @@ -2283,19 +2281,6 @@ static void ace_vlan_rx_register(struct ace_unmask_irq(dev); local_irq_restore(flags); } - - -static void ace_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct ace_private *ap = netdev_priv(dev); - unsigned long flags; - - local_irq_save(flags); - ace_mask_irq(dev); - vlan_group_set_device(ap->vlgrp, vid, NULL); - ace_unmask_irq(dev); - local_irq_restore(flags); -} #endif /* ACENIC_DO_VLAN */ --- a/drivers/net/amd8111e.c 2007-06-01 08:41:22.000000000 -0700 +++ b/drivers/net/amd8111e.c 2007-06-01 09:01:39.000000000 -0700 @@ -1728,15 +1728,8 @@ static void amd8111e_vlan_rx_register(st lp->vlgrp = grp; spin_unlock_irq(&lp->lock); } - -static void amd8111e_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct amd8111e_priv *lp = netdev_priv(dev); - spin_lock_irq(&lp->lock); - vlan_group_set_device(lp->vlgrp, vid, NULL); - spin_unlock_irq(&lp->lock); -} #endif + static int amd8111e_enable_magicpkt(struct amd8111e_priv* lp) { writel( VAL1|MPPLBA, lp->mmio + CMD3); @@ -1996,7 +1989,6 @@ static int __devinit amd8111e_probe_one( #if AMD8111E_VLAN_TAG_USED dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX ; dev->vlan_rx_register =amd8111e_vlan_rx_register; - dev->vlan_rx_kill_vid = amd8111e_vlan_rx_kill_vid; #endif lp = netdev_priv(dev); @@ -2049,7 +2041,6 @@ static int __devinit amd8111e_probe_one( #if AMD8111E_VLAN_TAG_USED dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register =amd8111e_vlan_rx_register; - dev->vlan_rx_kill_vid = amd8111e_vlan_rx_kill_vid; #endif /* Probe the external PHY */ amd8111e_probe_ext_phy(dev); --- a/drivers/net/bnx2.c 2007-06-01 08:41:22.000000000 -0700 +++ b/drivers/net/bnx2.c 2007-06-01 08:42:42.000000000 -0700 @@ -4786,19 +4786,6 @@ bnx2_vlan_rx_register(struct net_device bnx2_netif_start(bp); } - -/* Called with rtnl_lock */ -static void -bnx2_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid) -{ - struct bnx2 *bp = netdev_priv(dev); - - bnx2_netif_stop(bp); - vlan_group_set_device(bp->vlgrp, vid, NULL); - bnx2_set_rx_mode(dev); - - bnx2_netif_start(bp); -} #endif /* Called with netif_tx_lock. @@ -6453,7 +6440,6 @@ bnx2_init_one(struct pci_dev *pdev, cons dev->watchdog_timeo = TX_TIMEOUT; #ifdef BCM_VLAN dev->vlan_rx_register = bnx2_vlan_rx_register; - dev->vlan_rx_kill_vid = bnx2_vlan_rx_kill_vid; #endif dev->poll = bnx2_poll; dev->ethtool_ops = &bnx2_ethtool_ops; --- a/drivers/net/forcedeth.c 2007-06-01 08:41:22.000000000 -0700 +++ b/drivers/net/forcedeth.c 2007-06-01 08:42:47.000000000 -0700 @@ -4605,12 +4605,7 @@ static void nv_vlan_rx_register(struct n writel(np->txrxctl_bits, get_hwbase(dev) + NvRegTxRxControl); spin_unlock_irq(&np->lock); -}; - -static void nv_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - /* nothing to do */ -}; +} /* The mgmt unit and driver use a semaphore to access the phy during init */ static int nv_mgmt_acquire_sema(struct net_device *dev) @@ -4956,7 +4951,6 @@ static int __devinit nv_probe(struct pci np->vlanctl_bits = NVREG_VLANCONTROL_ENABLE; dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX; dev->vlan_rx_register = nv_vlan_rx_register; - dev->vlan_rx_kill_vid = nv_vlan_rx_kill_vid; } np->msi_flags = 0; --- a/drivers/net/tg3.c 2007-06-01 08:20:36.000000000 -0700 +++ b/drivers/net/tg3.c 2007-06-01 08:48:42.000000000 -0700 @@ -9121,21 +9121,6 @@ static void tg3_vlan_rx_register(struct if (netif_running(dev)) tg3_netif_start(tp); } - -static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct tg3 *tp = netdev_priv(dev); - - if (netif_running(dev)) - tg3_netif_stop(tp); - - tg3_full_lock(tp, 0); - vlan_group_set_device(tp->vlgrp, vid, NULL); - tg3_full_unlock(tp); - - if (netif_running(dev)) - tg3_netif_start(tp); -} #endif static int tg3_get_coalesce(struct net_device *dev, struct ethtool_coalesce *ec) @@ -11778,7 +11763,6 @@ static int __devinit tg3_init_one(struct #if TG3_VLAN_TAG_USED dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = tg3_vlan_rx_register; - dev->vlan_rx_kill_vid = tg3_vlan_rx_kill_vid; #endif tp = netdev_priv(dev); --- a/drivers/net/gianfar.c 2007-06-01 08:40:40.000000000 -0700 +++ b/drivers/net/gianfar.c 2007-06-01 08:50:12.000000000 -0700 @@ -140,7 +140,6 @@ int gfar_clean_rx_ring(struct net_device static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb, int length); static void gfar_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp); -static void gfar_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid); void gfar_halt(struct net_device *dev); void gfar_start(struct net_device *dev); static void gfar_clear_exact_match(struct net_device *dev); @@ -284,7 +283,6 @@ static int gfar_probe(struct platform_de if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_VLAN) { dev->vlan_rx_register = gfar_vlan_rx_register; - dev->vlan_rx_kill_vid = gfar_vlan_rx_kill_vid; dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; @@ -1133,20 +1131,6 @@ static void gfar_vlan_rx_register(struct spin_unlock_irqrestore(&priv->rxlock, flags); } - -static void gfar_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid) -{ - struct gfar_private *priv = netdev_priv(dev); - unsigned long flags; - - spin_lock_irqsave(&priv->rxlock, flags); - - vlan_group_set_device(priv->vlgrp, vid, NULL); - - spin_unlock_irqrestore(&priv->rxlock, flags); -} - - static int gfar_change_mtu(struct net_device *dev, int new_mtu) { int tempsize, tempval; --- a/drivers/net/ns83820.c 2007-06-01 08:18:21.000000000 -0700 +++ b/drivers/net/ns83820.c 2007-06-01 08:44:34.000000000 -0700 @@ -506,17 +506,6 @@ static void ns83820_vlan_rx_register(str spin_unlock(&dev->tx_lock); spin_unlock_irq(&dev->misc_lock); } - -static void ns83820_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid) -{ - struct ns83820 *dev = PRIV(ndev); - - spin_lock_irq(&dev->misc_lock); - spin_lock(&dev->tx_lock); - vlan_group_set_device(dev->vlgrp, vid, NULL); - spin_unlock(&dev->tx_lock); - spin_unlock_irq(&dev->misc_lock); -} #endif /* Packet Receiver @@ -2083,7 +2072,6 @@ static int __devinit ns83820_init_one(st /* We also support hardware vlan acceleration */ ndev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; ndev->vlan_rx_register = ns83820_vlan_rx_register; - ndev->vlan_rx_kill_vid = ns83820_vlan_rx_kill_vid; #endif if (using_dac) { --- a/drivers/net/r8169.c 2007-06-01 08:18:21.000000000 -0700 +++ b/drivers/net/r8169.c 2007-06-01 08:45:01.000000000 -0700 @@ -886,16 +886,6 @@ static void rtl8169_vlan_rx_register(str spin_unlock_irqrestore(&tp->lock, flags); } -static void rtl8169_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct rtl8169_private *tp = netdev_priv(dev); - unsigned long flags; - - spin_lock_irqsave(&tp->lock, flags); - vlan_group_set_device(tp->vlgrp, vid, NULL); - spin_unlock_irqrestore(&tp->lock, flags); -} - static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, struct sk_buff *skb) { @@ -1671,7 +1661,6 @@ rtl8169_init_one(struct pci_dev *pdev, c #ifdef CONFIG_R8169_VLAN dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = rtl8169_vlan_rx_register; - dev->vlan_rx_kill_vid = rtl8169_vlan_rx_kill_vid; #endif #ifdef CONFIG_NET_POLL_CONTROLLER --- a/drivers/net/s2io.c 2007-06-01 08:45:19.000000000 -0700 +++ b/drivers/net/s2io.c 2007-06-01 08:46:23.000000000 -0700 @@ -340,17 +340,6 @@ static void s2io_vlan_rx_register(struct /* A flag indicating whether 'RX_PA_CFG_STRIP_VLAN_TAG' bit is set or not */ static 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); - vlan_group_set_device(nic->vlgrp, vid, NULL); - spin_unlock_irqrestore(&nic->tx_lock, flags); -} - /* * Constants to be programmed into the Xena's registers, to configure * the XAUI. @@ -7412,7 +7401,6 @@ s2io_init_nic(struct pci_dev *pdev, cons 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 --- a/drivers/net/spider_net.c 2007-06-01 08:18:21.000000000 -0700 +++ b/drivers/net/spider_net.c 2007-06-01 08:52:08.000000000 -0700 @@ -1191,43 +1191,6 @@ spider_net_poll(struct net_device *netde } /** - * spider_net_vlan_rx_reg - initializes VLAN structures in the driver and card - * @netdev: interface device structure - * @grp: vlan_group structure that is registered (NULL on destroying interface) - */ -static void -spider_net_vlan_rx_reg(struct net_device *netdev, struct vlan_group *grp) -{ - /* further enhancement... yet to do */ - return; -} - -/** - * spider_net_vlan_rx_add - adds VLAN id to the card filter - * @netdev: interface device structure - * @vid: VLAN id to add - */ -static void -spider_net_vlan_rx_add(struct net_device *netdev, uint16_t vid) -{ - /* further enhancement... yet to do */ - /* add vid to card's VLAN filter table */ - return; -} - -/** - * spider_net_vlan_rx_kill - removes VLAN id to the card filter - * @netdev: interface device structure - * @vid: VLAN id to remove - */ -static void -spider_net_vlan_rx_kill(struct net_device *netdev, uint16_t vid) -{ - /* further enhancement... yet to do */ - /* remove vid from card's VLAN filter table */ -} - -/** * spider_net_get_stats - get interface statistics * @netdev: interface device structure * @@ -2177,9 +2140,6 @@ spider_net_setup_netdev_ops(struct net_d netdev->poll = &spider_net_poll; netdev->weight = SPIDER_NET_NAPI_WEIGHT; /* HW VLAN */ - netdev->vlan_rx_register = &spider_net_vlan_rx_reg; - netdev->vlan_rx_add_vid = &spider_net_vlan_rx_add; - netdev->vlan_rx_kill_vid = &spider_net_vlan_rx_kill; #ifdef CONFIG_NET_POLL_CONTROLLER /* poll controller */ netdev->poll_controller = &spider_net_poll_controller; --- a/drivers/net/typhoon.c 2007-06-01 08:18:22.000000000 -0700 +++ b/drivers/net/typhoon.c 2007-06-01 08:53:13.000000000 -0700 @@ -741,15 +741,6 @@ typhoon_vlan_rx_register(struct net_devi spin_unlock_bh(&tp->state_lock); } -static void -typhoon_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct typhoon *tp = netdev_priv(dev); - spin_lock_bh(&tp->state_lock); - vlan_group_set_device(tp->vlgrp, vid, NULL); - spin_unlock_bh(&tp->state_lock); -} - static inline void typhoon_tso_fill(struct sk_buff *skb, struct transmit_ring *txRing, u32 ring_dma) @@ -2542,7 +2533,7 @@ typhoon_init_one(struct pci_dev *pdev, c dev->get_stats = typhoon_get_stats; dev->set_mac_address = typhoon_set_mac_address; dev->vlan_rx_register = typhoon_vlan_rx_register; - dev->vlan_rx_kill_vid = typhoon_vlan_rx_kill_vid; + SET_ETHTOOL_OPS(dev, &typhoon_ethtool_ops); /* We can handle scatter gather, up to 16 entries, and --- a/drivers/net/acenic.h 2007-06-01 08:18:21.000000000 -0700 +++ b/drivers/net/acenic.h 2007-06-01 09:02:11.000000000 -0700 @@ -787,7 +787,6 @@ static struct net_device_stats *ace_get_ static int read_eeprom_byte(struct net_device *dev, unsigned long offset); #if ACENIC_DO_VLAN static void ace_vlan_rx_register(struct net_device *dev, struct vlan_group *grp); -static void ace_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid); #endif #endif /* _ACENIC_H_ */ --- a/drivers/net/chelsio/cxgb2.c 2007-06-01 08:18:21.000000000 -0700 +++ b/drivers/net/chelsio/cxgb2.c 2007-06-01 09:05:22.000000000 -0700 @@ -883,15 +883,6 @@ static void vlan_rx_register(struct net_ t1_set_vlan_accel(adapter, grp != NULL); spin_unlock_irq(&adapter->async_lock); } - -static void vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct adapter *adapter = dev->priv; - - spin_lock_irq(&adapter->async_lock); - vlan_group_set_device(adapter->vlan_grp, vid, NULL); - spin_unlock_irq(&adapter->async_lock); -} #endif #ifdef CONFIG_NET_POLL_CONTROLLER @@ -1099,7 +1090,6 @@ static int __devinit init_one(struct pci netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; netdev->vlan_rx_register = vlan_rx_register; - netdev->vlan_rx_kill_vid = vlan_rx_kill_vid; #endif /* T204: disable TSO */ --- a/drivers/net/cxgb3/cxgb3_main.c 2007-06-01 08:18:21.000000000 -0700 +++ b/drivers/net/cxgb3/cxgb3_main.c 2007-06-01 09:06:33.000000000 -0700 @@ -2067,11 +2067,6 @@ static void vlan_rx_register(struct net_ t3_synchronize_rx(adapter, pi); } -static void vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - /* nothing */ -} - #ifdef CONFIG_NET_POLL_CONTROLLER static void cxgb_netpoll(struct net_device *dev) { @@ -2409,7 +2404,6 @@ static int __devinit init_one(struct pci netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; netdev->vlan_rx_register = vlan_rx_register; - netdev->vlan_rx_kill_vid = vlan_rx_kill_vid; netdev->open = cxgb_open; netdev->stop = cxgb_close; -- Stephen Hemminger - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html