Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276437
b: refs/heads/master
c: 811fd30
h: refs/heads/master
i:
  276435: 8d7733a
v: v3
  • Loading branch information
françois romieu authored and David S. Miller committed Dec 5, 2011
1 parent 8992540 commit 5b16e3e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 321f3b8708e853695a4ff4a1a95b6fa0965b06e5
refs/heads/master: 811fd3010cf512f2e23e6c4c912aad54516dc706
42 changes: 17 additions & 25 deletions trunk/drivers/net/ethernet/realtek/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -1183,11 +1183,13 @@ static u8 rtl8168d_efuse_read(void __iomem *ioaddr, int reg_addr)
return value;
}

static void rtl8169_irq_mask_and_ack(void __iomem *ioaddr)
static void rtl8169_irq_mask_and_ack(struct rtl8169_private *tp)
{
RTL_W16(IntrMask, 0x0000);
void __iomem *ioaddr = tp->mmio_addr;

RTL_W16(IntrStatus, 0xffff);
RTL_W16(IntrMask, 0x0000);
RTL_W16(IntrStatus, tp->intr_event);
RTL_R8(ChipCmd);
}

static unsigned int rtl8169_tbi_reset_pending(struct rtl8169_private *tp)
Expand Down Expand Up @@ -4339,7 +4341,7 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
void __iomem *ioaddr = tp->mmio_addr;

/* Disable interrupts */
rtl8169_irq_mask_and_ack(ioaddr);
rtl8169_irq_mask_and_ack(tp);

rtl_rx_close(tp);

Expand Down Expand Up @@ -4885,8 +4887,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
RTL_W16(IntrMitigate, 0x5151);

/* Work around for RxFIFO overflow. */
if (tp->mac_version == RTL_GIGA_MAC_VER_11 ||
tp->mac_version == RTL_GIGA_MAC_VER_22) {
if (tp->mac_version == RTL_GIGA_MAC_VER_11) {
tp->intr_event |= RxFIFOOver | PCSTimeout;
tp->intr_event &= ~RxOverflow;
}
Expand Down Expand Up @@ -5076,6 +5077,11 @@ static void rtl_hw_start_8101(struct net_device *dev)
void __iomem *ioaddr = tp->mmio_addr;
struct pci_dev *pdev = tp->pci_dev;

if (tp->mac_version >= RTL_GIGA_MAC_VER_30) {
tp->intr_event &= ~RxFIFOOver;
tp->napi_event &= ~RxFIFOOver;
}

if (tp->mac_version == RTL_GIGA_MAC_VER_13 ||
tp->mac_version == RTL_GIGA_MAC_VER_16) {
int cap = pci_pcie_cap(pdev);
Expand Down Expand Up @@ -5342,7 +5348,7 @@ static void rtl8169_wait_for_quiescence(struct net_device *dev)
/* Wait for any pending NAPI task to complete */
napi_disable(&tp->napi);

rtl8169_irq_mask_and_ack(ioaddr);
rtl8169_irq_mask_and_ack(tp);

tp->intr_mask = 0xffff;
RTL_W16(IntrMask, tp->intr_event);
Expand Down Expand Up @@ -5804,6 +5810,10 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
*/
status = RTL_R16(IntrStatus);
while (status && status != 0xffff) {
status &= tp->intr_event;
if (!status)
break;

handled = 1;

/* Handle all of the error cases first. These will reset
Expand All @@ -5818,27 +5828,9 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
switch (tp->mac_version) {
/* Work around for rx fifo overflow */
case RTL_GIGA_MAC_VER_11:
case RTL_GIGA_MAC_VER_22:
case RTL_GIGA_MAC_VER_26:
netif_stop_queue(dev);
rtl8169_tx_timeout(dev);
goto done;
/* Testers needed. */
case RTL_GIGA_MAC_VER_17:
case RTL_GIGA_MAC_VER_19:
case RTL_GIGA_MAC_VER_20:
case RTL_GIGA_MAC_VER_21:
case RTL_GIGA_MAC_VER_23:
case RTL_GIGA_MAC_VER_24:
case RTL_GIGA_MAC_VER_27:
case RTL_GIGA_MAC_VER_28:
case RTL_GIGA_MAC_VER_31:
/* Experimental science. Pktgen proof. */
case RTL_GIGA_MAC_VER_12:
case RTL_GIGA_MAC_VER_25:
if (status == RxFIFOOver)
goto done;
break;
default:
break;
}
Expand Down

0 comments on commit 5b16e3e

Please sign in to comment.