diff options
author | Don Skidmore <donald.c.skidmore@intel.com> | 2009-01-19 19:54:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-19 19:54:36 -0500 |
commit | 068c89b014ebd27b1c09c3c772e9d982988e7786 (patch) | |
tree | 85ece46a4a4b9b86c05d6f0a524af16286c694ac /drivers/net/ixgbe | |
parent | 15005a320473b8d3676b878deb29bbe738ef9027 (diff) |
ixgbe: fix tag stripping for VLAN ID 0
Register VLAN ID 0 so that frames with VLAN ID 0 are received and get
their tag stripped when ixgbe is not in DCB mode. VLAN ID 0 means
that the frame is 'priority tagged' only - it is not a VLAN, but the
priority value is the tag in valid. The functions
ixgbe_vlan_rx_register() and ixgbe_vlan_rx_kill_vid() were moved up a
couple functions to correct compiling issues with this change.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Eric W Multanen <eric.w.multanen@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 92d9b17a081a..bf36737e2ec7 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -1744,6 +1744,32 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter) | |||
1744 | IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum); | 1744 | IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum); |
1745 | } | 1745 | } |
1746 | 1746 | ||
1747 | static void ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | ||
1748 | { | ||
1749 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
1750 | struct ixgbe_hw *hw = &adapter->hw; | ||
1751 | |||
1752 | /* add VID to filter table */ | ||
1753 | hw->mac.ops.set_vfta(&adapter->hw, vid, 0, true); | ||
1754 | } | ||
1755 | |||
1756 | static void ixgbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | ||
1757 | { | ||
1758 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
1759 | struct ixgbe_hw *hw = &adapter->hw; | ||
1760 | |||
1761 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | ||
1762 | ixgbe_irq_disable(adapter); | ||
1763 | |||
1764 | vlan_group_set_device(adapter->vlgrp, vid, NULL); | ||
1765 | |||
1766 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | ||
1767 | ixgbe_irq_enable(adapter); | ||
1768 | |||
1769 | /* remove VID from filter table */ | ||
1770 | hw->mac.ops.set_vfta(&adapter->hw, vid, 0, false); | ||
1771 | } | ||
1772 | |||
1747 | static void ixgbe_vlan_rx_register(struct net_device *netdev, | 1773 | static void ixgbe_vlan_rx_register(struct net_device *netdev, |
1748 | struct vlan_group *grp) | 1774 | struct vlan_group *grp) |
1749 | { | 1775 | { |
@@ -1763,6 +1789,7 @@ static void ixgbe_vlan_rx_register(struct net_device *netdev, | |||
1763 | ctrl |= IXGBE_VLNCTRL_VME; | 1789 | ctrl |= IXGBE_VLNCTRL_VME; |
1764 | ctrl &= ~IXGBE_VLNCTRL_CFIEN; | 1790 | ctrl &= ~IXGBE_VLNCTRL_CFIEN; |
1765 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl); | 1791 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl); |
1792 | ixgbe_vlan_rx_add_vid(netdev, 0); | ||
1766 | 1793 | ||
1767 | if (grp) { | 1794 | if (grp) { |
1768 | /* enable VLAN tag insert/strip */ | 1795 | /* enable VLAN tag insert/strip */ |
@@ -1776,32 +1803,6 @@ static void ixgbe_vlan_rx_register(struct net_device *netdev, | |||
1776 | ixgbe_irq_enable(adapter); | 1803 | ixgbe_irq_enable(adapter); |
1777 | } | 1804 | } |
1778 | 1805 | ||
1779 | static void ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | ||
1780 | { | ||
1781 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
1782 | struct ixgbe_hw *hw = &adapter->hw; | ||
1783 | |||
1784 | /* add VID to filter table */ | ||
1785 | hw->mac.ops.set_vfta(&adapter->hw, vid, 0, true); | ||
1786 | } | ||
1787 | |||
1788 | static void ixgbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | ||
1789 | { | ||
1790 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
1791 | struct ixgbe_hw *hw = &adapter->hw; | ||
1792 | |||
1793 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | ||
1794 | ixgbe_irq_disable(adapter); | ||
1795 | |||
1796 | vlan_group_set_device(adapter->vlgrp, vid, NULL); | ||
1797 | |||
1798 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | ||
1799 | ixgbe_irq_enable(adapter); | ||
1800 | |||
1801 | /* remove VID from filter table */ | ||
1802 | hw->mac.ops.set_vfta(&adapter->hw, vid, 0, false); | ||
1803 | } | ||
1804 | |||
1805 | static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter) | 1806 | static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter) |
1806 | { | 1807 | { |
1807 | ixgbe_vlan_rx_register(adapter->netdev, adapter->vlgrp); | 1808 | ixgbe_vlan_rx_register(adapter->netdev, adapter->vlgrp); |