aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@redhat.com>2012-10-22 00:43:23 -0400
committerDavid S. Miller <davem@davemloft.net>2012-10-23 02:31:15 -0400
commite408a9ff3c7c371d0e2a47a9eb8fa3de48fea30d (patch)
treeb3559b86d876a04cddc390989037332c1268611a
parent3d861f661006606bf159fd6bd973e83dbf21d0f9 (diff)
pch_gbe: create functions for MAC_RX {en,dis}able
Move MAC_RX-related bits into separate functions. Signed-off-by: Veaceslav Falico <vfalico@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index b2a94d02a521..d5190bf94ba0 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -420,6 +420,22 @@ static void pch_gbe_mac_reset_rx(struct pch_gbe_hw *hw)
420 return; 420 return;
421} 421}
422 422
423static void pch_gbe_disable_mac_rx(struct pch_gbe_hw *hw)
424{
425 u32 rctl;
426 /* Disables Receive MAC */
427 rctl = ioread32(&hw->reg->MAC_RX_EN);
428 iowrite32((rctl & ~PCH_GBE_MRE_MAC_RX_EN), &hw->reg->MAC_RX_EN);
429}
430
431static void pch_gbe_enable_mac_rx(struct pch_gbe_hw *hw)
432{
433 u32 rctl;
434 /* Enables Receive MAC */
435 rctl = ioread32(&hw->reg->MAC_RX_EN);
436 iowrite32((rctl | PCH_GBE_MRE_MAC_RX_EN), &hw->reg->MAC_RX_EN);
437}
438
423/** 439/**
424 * pch_gbe_mac_init_rx_addrs - Initialize receive address's 440 * pch_gbe_mac_init_rx_addrs - Initialize receive address's
425 * @hw: Pointer to the HW structure 441 * @hw: Pointer to the HW structure
@@ -913,7 +929,7 @@ static void pch_gbe_setup_rctl(struct pch_gbe_adapter *adapter)
913static void pch_gbe_configure_rx(struct pch_gbe_adapter *adapter) 929static void pch_gbe_configure_rx(struct pch_gbe_adapter *adapter)
914{ 930{
915 struct pch_gbe_hw *hw = &adapter->hw; 931 struct pch_gbe_hw *hw = &adapter->hw;
916 u32 rdba, rdlen, rctl, rxdma; 932 u32 rdba, rdlen, rxdma;
917 933
918 pr_debug("dma adr = 0x%08llx size = 0x%08x\n", 934 pr_debug("dma adr = 0x%08llx size = 0x%08x\n",
919 (unsigned long long)adapter->rx_ring->dma, 935 (unsigned long long)adapter->rx_ring->dma,
@@ -921,9 +937,7 @@ static void pch_gbe_configure_rx(struct pch_gbe_adapter *adapter)
921 937
922 pch_gbe_mac_force_mac_fc(hw); 938 pch_gbe_mac_force_mac_fc(hw);
923 939
924 /* Disables Receive MAC */ 940 pch_gbe_disable_mac_rx(hw);
925 rctl = ioread32(&hw->reg->MAC_RX_EN);
926 iowrite32((rctl & ~PCH_GBE_MRE_MAC_RX_EN), &hw->reg->MAC_RX_EN);
927 941
928 /* Disables Receive DMA */ 942 /* Disables Receive DMA */
929 rxdma = ioread32(&hw->reg->DMA_CTRL); 943 rxdma = ioread32(&hw->reg->DMA_CTRL);
@@ -1355,8 +1369,8 @@ static void pch_gbe_start_receive(struct pch_gbe_hw *hw)
1355 rxdma = ioread32(&hw->reg->DMA_CTRL); 1369 rxdma = ioread32(&hw->reg->DMA_CTRL);
1356 rxdma |= PCH_GBE_RX_DMA_EN; 1370 rxdma |= PCH_GBE_RX_DMA_EN;
1357 iowrite32(rxdma, &hw->reg->DMA_CTRL); 1371 iowrite32(rxdma, &hw->reg->DMA_CTRL);
1358 /* Enables Receive */ 1372
1359 iowrite32(PCH_GBE_MRE_MAC_RX_EN, &hw->reg->MAC_RX_EN); 1373 pch_gbe_enable_mac_rx(hw);
1360 return; 1374 return;
1361} 1375}
1362 1376