aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/realtek/r8169.c
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@fr.zoreil.com>2012-01-26 06:50:01 -0500
committerFrancois Romieu <romieu@fr.zoreil.com>2012-01-27 03:57:45 -0500
commit3e990ff5f119c2f9b142f3e2548dc90ca9b7dfa1 (patch)
treedd9e9f9bd74f2edb1677d89499e6b283d76e776f /drivers/net/ethernet/realtek/r8169.c
parent4422bcd4907d1bbb9f63e049e3c3819132c047a1 (diff)
r8169: factor out IntrMask writes.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
Diffstat (limited to 'drivers/net/ethernet/realtek/r8169.c')
-rw-r--r--drivers/net/ethernet/realtek/r8169.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 6d74931049fb..9f9abb5d01a5 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -1184,6 +1184,13 @@ static u8 rtl8168d_efuse_read(void __iomem *ioaddr, int reg_addr)
1184 return value; 1184 return value;
1185} 1185}
1186 1186
1187static void rtl_irq_enable(struct rtl8169_private *tp, u16 bits)
1188{
1189 void __iomem *ioaddr = tp->mmio_addr;
1190
1191 RTL_W16(IntrMask, bits);
1192}
1193
1187static void rtl8169_irq_mask_and_ack(struct rtl8169_private *tp) 1194static void rtl8169_irq_mask_and_ack(struct rtl8169_private *tp)
1188{ 1195{
1189 void __iomem *ioaddr = tp->mmio_addr; 1196 void __iomem *ioaddr = tp->mmio_addr;
@@ -4383,6 +4390,8 @@ static void rtl_hw_start(struct net_device *dev)
4383 4390
4384 tp->hw_start(dev); 4391 tp->hw_start(dev);
4385 4392
4393 rtl_irq_enable(tp, tp->intr_event);
4394
4386 netif_start_queue(dev); 4395 netif_start_queue(dev);
4387} 4396}
4388 4397
@@ -4510,9 +4519,6 @@ static void rtl_hw_start_8169(struct net_device *dev)
4510 4519
4511 /* no early-rx interrupts */ 4520 /* no early-rx interrupts */
4512 RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xF000); 4521 RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xF000);
4513
4514 /* Enable all known interrupts by setting the interrupt mask. */
4515 RTL_W16(IntrMask, tp->intr_event);
4516} 4522}
4517 4523
4518static void rtl_csi_access_enable(void __iomem *ioaddr, u32 bits) 4524static void rtl_csi_access_enable(void __iomem *ioaddr, u32 bits)
@@ -4981,8 +4987,6 @@ static void rtl_hw_start_8168(struct net_device *dev)
4981 RTL_W8(Cfg9346, Cfg9346_Lock); 4987 RTL_W8(Cfg9346, Cfg9346_Lock);
4982 4988
4983 RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xF000); 4989 RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xF000);
4984
4985 RTL_W16(IntrMask, tp->intr_event);
4986} 4990}
4987 4991
4988#define R810X_CPCMD_QUIRK_MASK (\ 4992#define R810X_CPCMD_QUIRK_MASK (\
@@ -5140,8 +5144,6 @@ static void rtl_hw_start_8101(struct net_device *dev)
5140 rtl_set_rx_mode(dev); 5144 rtl_set_rx_mode(dev);
5141 5145
5142 RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000); 5146 RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000);
5143
5144 RTL_W16(IntrMask, tp->intr_event);
5145} 5147}
5146 5148
5147static int rtl8169_change_mtu(struct net_device *dev, int new_mtu) 5149static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)