Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

amd8111e: do vlan cleanup

- unify vlan and nonvlan rx path
- kill lp->vlgrp and amd8111e_vlan_rx_register

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jiri Pirko and committed by
David S. Miller
c8d9e6dd 9fea0330

+6 -31
+6 -28
drivers/net/amd8111e.c
··· 661 661 } 662 662 663 663 } 664 - #if AMD8111E_VLAN_TAG_USED 665 - /* 666 - This is the receive indication function for packets with vlan tag. 667 - */ 668 - static int amd8111e_vlan_rx(struct amd8111e_priv *lp, struct sk_buff *skb, u16 vlan_tag) 669 - { 670 - return vlan_hwaccel_receive_skb(skb, lp->vlgrp,vlan_tag); 671 - } 672 - #endif 673 664 674 665 /* 675 666 This function will free all the transmit skbs that are actually transmitted by the device. It will check the ownership of the skb before freeing the skb. ··· 755 764 #if AMD8111E_VLAN_TAG_USED 756 765 vtag = status & TT_MASK; 757 766 /*MAC will strip vlan tag*/ 758 - if(lp->vlgrp != NULL && vtag !=0) 767 + if (vtag != 0) 759 768 min_pkt_len =MIN_PKT_LEN - 4; 760 769 else 761 770 #endif ··· 790 799 skb->protocol = eth_type_trans(skb, dev); 791 800 792 801 #if AMD8111E_VLAN_TAG_USED 793 - if(lp->vlgrp != NULL && (vtag == TT_VLAN_TAGGED)){ 794 - amd8111e_vlan_rx(lp, skb, 795 - le16_to_cpu(lp->rx_ring[rx_index].tag_ctrl_info)); 796 - } else 802 + if (vtag == TT_VLAN_TAGGED){ 803 + u16 vlan_tag = le16_to_cpu(lp->rx_ring[rx_index].tag_ctrl_info); 804 + __vlan_hwaccel_put_tag(skb, vlan_tag); 805 + } 797 806 #endif 798 - netif_receive_skb(skb); 807 + netif_receive_skb(skb); 799 808 /*COAL update rx coalescing parameters*/ 800 809 lp->coal_conf.rx_packets++; 801 810 lp->coal_conf.rx_bytes += pkt_len; ··· 1589 1598 return err; 1590 1599 } 1591 1600 1592 - #if AMD8111E_VLAN_TAG_USED 1593 - static void amd8111e_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) 1594 - { 1595 - struct amd8111e_priv *lp = netdev_priv(dev); 1596 - spin_lock_irq(&lp->lock); 1597 - lp->vlgrp = grp; 1598 - spin_unlock_irq(&lp->lock); 1599 - } 1600 - #endif 1601 - 1602 1601 static int amd8111e_enable_magicpkt(struct amd8111e_priv* lp) 1603 1602 { 1604 1603 writel( VAL1|MPPLBA, lp->mmio + CMD3); ··· 1803 1822 .ndo_set_mac_address = amd8111e_set_mac_address, 1804 1823 .ndo_do_ioctl = amd8111e_ioctl, 1805 1824 .ndo_change_mtu = amd8111e_change_mtu, 1806 - #if AMD8111E_VLAN_TAG_USED 1807 - .ndo_vlan_rx_register = amd8111e_vlan_rx_register, 1808 - #endif 1809 1825 #ifdef CONFIG_NET_POLL_CONTROLLER 1810 1826 .ndo_poll_controller = amd8111e_poll, 1811 1827 #endif
-3
drivers/net/amd8111e.h
··· 783 783 struct net_device *next; 784 784 int mii; 785 785 struct mii_if_info mii_if; 786 - #if AMD8111E_VLAN_TAG_USED 787 - struct vlan_group *vlgrp; 788 - #endif 789 786 char opened; 790 787 unsigned int drv_rx_errors; 791 788 struct amd8111e_coalesce_conf coal_conf;