From: Veaceslav Falico <vfalico@redhat.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, richardcochran@gmail.com,
tshimizu818@gmail.com, andy.cress@us.kontron.com,
erwan.velu@zodiacaerospace.com, agospoda@redhat.com
Subject: [PATCH 1/3] pch_gbe: create functions for MAC_RX {en,dis}able
Date: Mon, 22 Oct 2012 16:43:23 +0200 [thread overview]
Message-ID: <1350917005-26350-2-git-send-email-vfalico@redhat.com> (raw)
In-Reply-To: <1350917005-26350-1-git-send-email-vfalico@redhat.com>
Move MAC_RX-related bits into separate functions.
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
.../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 26 +++++++++++++++----
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 b2a94d0..d5190bf 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)
return;
}
+static void pch_gbe_disable_mac_rx(struct pch_gbe_hw *hw)
+{
+ u32 rctl;
+ /* Disables Receive MAC */
+ rctl = ioread32(&hw->reg->MAC_RX_EN);
+ iowrite32((rctl & ~PCH_GBE_MRE_MAC_RX_EN), &hw->reg->MAC_RX_EN);
+}
+
+static void pch_gbe_enable_mac_rx(struct pch_gbe_hw *hw)
+{
+ u32 rctl;
+ /* Enables Receive MAC */
+ rctl = ioread32(&hw->reg->MAC_RX_EN);
+ iowrite32((rctl | PCH_GBE_MRE_MAC_RX_EN), &hw->reg->MAC_RX_EN);
+}
+
/**
* pch_gbe_mac_init_rx_addrs - Initialize receive address's
* @hw: Pointer to the HW structure
@@ -913,7 +929,7 @@ static void pch_gbe_setup_rctl(struct pch_gbe_adapter *adapter)
static void pch_gbe_configure_rx(struct pch_gbe_adapter *adapter)
{
struct pch_gbe_hw *hw = &adapter->hw;
- u32 rdba, rdlen, rctl, rxdma;
+ u32 rdba, rdlen, rxdma;
pr_debug("dma adr = 0x%08llx size = 0x%08x\n",
(unsigned long long)adapter->rx_ring->dma,
@@ -921,9 +937,7 @@ static void pch_gbe_configure_rx(struct pch_gbe_adapter *adapter)
pch_gbe_mac_force_mac_fc(hw);
- /* Disables Receive MAC */
- rctl = ioread32(&hw->reg->MAC_RX_EN);
- iowrite32((rctl & ~PCH_GBE_MRE_MAC_RX_EN), &hw->reg->MAC_RX_EN);
+ pch_gbe_disable_mac_rx(hw);
/* Disables Receive DMA */
rxdma = ioread32(&hw->reg->DMA_CTRL);
@@ -1355,8 +1369,8 @@ static void pch_gbe_start_receive(struct pch_gbe_hw *hw)
rxdma = ioread32(&hw->reg->DMA_CTRL);
rxdma |= PCH_GBE_RX_DMA_EN;
iowrite32(rxdma, &hw->reg->DMA_CTRL);
- /* Enables Receive */
- iowrite32(PCH_GBE_MRE_MAC_RX_EN, &hw->reg->MAC_RX_EN);
+
+ pch_gbe_enable_mac_rx(hw);
return;
}
--
1.7.1
next prev parent reply other threads:[~2012-10-22 14:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-22 14:43 [PATCH 0/3] pch_gbe: fix CRC errors and improve speed Veaceslav Falico
2012-10-22 14:43 ` Veaceslav Falico [this message]
2012-10-22 14:43 ` [PATCH 2/3] pch_gbe: don't re-set RX_FIFO_ERR flag in napi_poll Veaceslav Falico
2012-10-22 14:43 ` [PATCH 3/3] pch_gbe: don't reset MAC_RX on FIFO overflow Veaceslav Falico
2012-10-23 6:31 ` [PATCH 0/3] pch_gbe: fix CRC errors and improve speed David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350917005-26350-2-git-send-email-vfalico@redhat.com \
--to=vfalico@redhat.com \
--cc=agospoda@redhat.com \
--cc=andy.cress@us.kontron.com \
--cc=davem@davemloft.net \
--cc=erwan.velu@zodiacaerospace.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=tshimizu818@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).