Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135545
b: refs/heads/master
c: a6c4232
h: refs/heads/master
i:
  135543: e4ef605
v: v3
  • Loading branch information
Jesse Brandeburg authored and David S. Miller committed Mar 26, 2009
1 parent 005cdbd commit 83c83e8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 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: ccfb342c5cd584f0f3e682280f7152310edf0e39
refs/heads/master: a6c42322722976ca81e6d02e4a702f33d659d8fc
28 changes: 24 additions & 4 deletions trunk/drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,30 @@ static void e1000_power_down_phy(struct e1000_adapter *adapter)

void e1000_down(struct e1000_adapter *adapter)
{
struct e1000_hw *hw = &adapter->hw;
struct net_device *netdev = adapter->netdev;
u32 rctl, tctl;

/* signal that we're down so the interrupt handler does not
* reschedule our watchdog timer */
set_bit(__E1000_DOWN, &adapter->flags);

/* disable receives in the hardware */
rctl = er32(RCTL);
ew32(RCTL, rctl & ~E1000_RCTL_EN);
/* flush and sleep below */

/* can be netif_tx_disable when NETIF_F_LLTX is removed */
netif_stop_queue(netdev);

/* disable transmits in the hardware */
tctl = er32(TCTL);
tctl &= ~E1000_TCTL_EN;
ew32(TCTL, tctl);
/* flush both disables and wait for them to finish */
E1000_WRITE_FLUSH();
msleep(10);

napi_disable(&adapter->napi);

e1000_irq_disable(adapter);
Expand All @@ -595,7 +613,6 @@ void e1000_down(struct e1000_adapter *adapter)
adapter->link_speed = 0;
adapter->link_duplex = 0;
netif_carrier_off(netdev);
netif_stop_queue(netdev);

e1000_reset(adapter);
e1000_clean_all_tx_rings(adapter);
Expand Down Expand Up @@ -3744,10 +3761,12 @@ static irqreturn_t e1000_intr(int irq, void *data)
adapter->total_rx_bytes = 0;
adapter->total_rx_packets = 0;
__napi_schedule(&adapter->napi);
} else
} else {
/* this really should not happen! if it does it is basically a
* bug, but not a hard error, so enable ints and continue */
e1000_irq_enable(adapter);
if (!test_bit(__E1000_DOWN, &adapter->flags))
e1000_irq_enable(adapter);
}

return IRQ_HANDLED;
}
Expand Down Expand Up @@ -3777,7 +3796,8 @@ static int e1000_clean(struct napi_struct *napi, int budget)
if (likely(adapter->itr_setting & 3))
e1000_set_itr(adapter);
napi_complete(napi);
e1000_irq_enable(adapter);
if (!test_bit(__E1000_DOWN, &adapter->flags))
e1000_irq_enable(adapter);
}

return work_done;
Expand Down

0 comments on commit 83c83e8

Please sign in to comment.