aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c53
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
1747static 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
1756static 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
1747static void ixgbe_vlan_rx_register(struct net_device *netdev, 1773static 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
1779static 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
1788static 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
1805static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter) 1806static 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);