diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-07-20 00:54:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-21 16:47:54 -0400 |
commit | c8d9e6dd484a2e10875d2c277f7e8584b92779e5 (patch) | |
tree | 8ad27faa195c473e3153ac3c230db3485074f03c | |
parent | 9fea03302ada3291fb3066a3c276e3f43556548b (diff) |
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>
-rw-r--r-- | drivers/net/amd8111e.c | 34 | ||||
-rw-r--r-- | drivers/net/amd8111e.h | 3 |
2 files changed, 6 insertions, 31 deletions
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index db6d2da5a8f3..78002ef9c0e5 100644 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c | |||
@@ -661,15 +661,6 @@ static void amd8111e_free_ring(struct amd8111e_priv* lp) | |||
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 | 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. | 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. |
@@ -764,7 +755,7 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget) | |||
764 | #if AMD8111E_VLAN_TAG_USED | 755 | #if AMD8111E_VLAN_TAG_USED |
765 | vtag = status & TT_MASK; | 756 | vtag = status & TT_MASK; |
766 | /*MAC will strip vlan tag*/ | 757 | /*MAC will strip vlan tag*/ |
767 | if(lp->vlgrp != NULL && vtag !=0) | 758 | if (vtag != 0) |
768 | min_pkt_len =MIN_PKT_LEN - 4; | 759 | min_pkt_len =MIN_PKT_LEN - 4; |
769 | else | 760 | else |
770 | #endif | 761 | #endif |
@@ -799,12 +790,12 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget) | |||
799 | skb->protocol = eth_type_trans(skb, dev); | 790 | skb->protocol = eth_type_trans(skb, dev); |
800 | 791 | ||
801 | #if AMD8111E_VLAN_TAG_USED | 792 | #if AMD8111E_VLAN_TAG_USED |
802 | if(lp->vlgrp != NULL && (vtag == TT_VLAN_TAGGED)){ | 793 | if (vtag == TT_VLAN_TAGGED){ |
803 | amd8111e_vlan_rx(lp, skb, | 794 | u16 vlan_tag = le16_to_cpu(lp->rx_ring[rx_index].tag_ctrl_info); |
804 | le16_to_cpu(lp->rx_ring[rx_index].tag_ctrl_info)); | 795 | __vlan_hwaccel_put_tag(skb, vlan_tag); |
805 | } else | 796 | } |
806 | #endif | 797 | #endif |
807 | netif_receive_skb(skb); | 798 | netif_receive_skb(skb); |
808 | /*COAL update rx coalescing parameters*/ | 799 | /*COAL update rx coalescing parameters*/ |
809 | lp->coal_conf.rx_packets++; | 800 | lp->coal_conf.rx_packets++; |
810 | lp->coal_conf.rx_bytes += pkt_len; | 801 | lp->coal_conf.rx_bytes += pkt_len; |
@@ -1598,16 +1589,6 @@ static int amd8111e_change_mtu(struct net_device *dev, int new_mtu) | |||
1598 | return err; | 1589 | return err; |
1599 | } | 1590 | } |
1600 | 1591 | ||
1601 | #if AMD8111E_VLAN_TAG_USED | ||
1602 | static void amd8111e_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) | ||
1603 | { | ||
1604 | struct amd8111e_priv *lp = netdev_priv(dev); | ||
1605 | spin_lock_irq(&lp->lock); | ||
1606 | lp->vlgrp = grp; | ||
1607 | spin_unlock_irq(&lp->lock); | ||
1608 | } | ||
1609 | #endif | ||
1610 | |||
1611 | static int amd8111e_enable_magicpkt(struct amd8111e_priv* lp) | 1592 | static int amd8111e_enable_magicpkt(struct amd8111e_priv* lp) |
1612 | { | 1593 | { |
1613 | writel( VAL1|MPPLBA, lp->mmio + CMD3); | 1594 | writel( VAL1|MPPLBA, lp->mmio + CMD3); |
@@ -1822,9 +1803,6 @@ static const struct net_device_ops amd8111e_netdev_ops = { | |||
1822 | .ndo_set_mac_address = amd8111e_set_mac_address, | 1803 | .ndo_set_mac_address = amd8111e_set_mac_address, |
1823 | .ndo_do_ioctl = amd8111e_ioctl, | 1804 | .ndo_do_ioctl = amd8111e_ioctl, |
1824 | .ndo_change_mtu = amd8111e_change_mtu, | 1805 | .ndo_change_mtu = amd8111e_change_mtu, |
1825 | #if AMD8111E_VLAN_TAG_USED | ||
1826 | .ndo_vlan_rx_register = amd8111e_vlan_rx_register, | ||
1827 | #endif | ||
1828 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1806 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1829 | .ndo_poll_controller = amd8111e_poll, | 1807 | .ndo_poll_controller = amd8111e_poll, |
1830 | #endif | 1808 | #endif |
diff --git a/drivers/net/amd8111e.h b/drivers/net/amd8111e.h index b5926af03a7e..2ff2e7a12dd0 100644 --- a/drivers/net/amd8111e.h +++ b/drivers/net/amd8111e.h | |||
@@ -783,9 +783,6 @@ struct amd8111e_priv{ | |||
783 | struct net_device *next; | 783 | struct net_device *next; |
784 | int mii; | 784 | int mii; |
785 | struct mii_if_info mii_if; | 785 | struct mii_if_info mii_if; |
786 | #if AMD8111E_VLAN_TAG_USED | ||
787 | struct vlan_group *vlgrp; | ||
788 | #endif | ||
789 | char opened; | 786 | char opened; |
790 | unsigned int drv_rx_errors; | 787 | unsigned int drv_rx_errors; |
791 | struct amd8111e_coalesce_conf coal_conf; | 788 | struct amd8111e_coalesce_conf coal_conf; |