aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2010-08-19 09:36:49 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-19 19:40:52 -0400
commitf5dc442b4671e2961c2e5bb3e16a86ce7da86cd3 (patch)
tree9bf5a0c36bcd669dd8316f79bf0676fc7f8c2554 /drivers/net/ixgbe/ixgbe_main.c
parent486545216472d67c16e3d3d60c5f21f60959c855 (diff)
ixgbe: combine accesses to FCTRL register into ixgbe_set_rx_mode
We are accessing the FCTRL register in multiple spots in the init path and we can simplify things by combining the configuration all into ixgbe_set_rx_mode. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 88e6936a1579..b7553643f9ad 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2709,7 +2709,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2709 int max_frame = netdev->mtu + ETH_HLEN + ETH_FCS_LEN; 2709 int max_frame = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
2710 int i; 2710 int i;
2711 u32 rxctrl; 2711 u32 rxctrl;
2712 u32 fctrl, hlreg0; 2712 u32 hlreg0;
2713 u32 rdrxctl; 2713 u32 rdrxctl;
2714 int rx_buf_len; 2714 int rx_buf_len;
2715 2715
@@ -2731,12 +2731,6 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2731 rx_buf_len = ALIGN(max_frame, 1024); 2731 rx_buf_len = ALIGN(max_frame, 1024);
2732 } 2732 }
2733 2733
2734 fctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_FCTRL);
2735 fctrl |= IXGBE_FCTRL_BAM;
2736 fctrl |= IXGBE_FCTRL_DPF; /* discard pause frames when FC enabled */
2737 fctrl |= IXGBE_FCTRL_PMCF;
2738 IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl);
2739
2740 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); 2734 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
2741 if (adapter->netdev->mtu <= ETH_DATA_LEN) 2735 if (adapter->netdev->mtu <= ETH_DATA_LEN)
2742 hlreg0 &= ~IXGBE_HLREG0_JUMBOEN; 2736 hlreg0 &= ~IXGBE_HLREG0_JUMBOEN;
@@ -3055,6 +3049,11 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
3055 3049
3056 fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); 3050 fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
3057 3051
3052 /* set all bits that we expect to always be set */
3053 fctrl |= IXGBE_FCTRL_BAM;
3054 fctrl |= IXGBE_FCTRL_DPF; /* discard pause frames when FC enabled */
3055 fctrl |= IXGBE_FCTRL_PMCF;
3056
3058 /* clear the bits we are changing the status of */ 3057 /* clear the bits we are changing the status of */
3059 fctrl &= ~(IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); 3058 fctrl &= ~(IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
3060 3059