Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58720
b: refs/heads/master
c: 5c11ce7
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Jul 10, 2007
1 parent c635f6b commit 7bad099
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 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: 3cf267539f1f133eb6ba63d074da18cb58cdf89a
refs/heads/master: 5c11ce700f77fada15b6264417d72462da4bbb1c
35 changes: 17 additions & 18 deletions trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2477,8 +2477,7 @@ static void sky2_err_intr(struct sky2_hw *hw, u32 status)
static int sky2_poll(struct net_device *dev0, int *budget)
{
struct sky2_hw *hw = ((struct sky2_port *) netdev_priv(dev0))->hw;
int work_limit = min(dev0->quota, *budget);
int work_done = 0;
int work_done;
u32 status = sky2_read32(hw, B0_Y2_SP_EISR);

if (unlikely(status & Y2_IS_ERROR))
Expand All @@ -2490,25 +2489,25 @@ static int sky2_poll(struct net_device *dev0, int *budget)
if (status & Y2_IS_IRQ_PHY2)
sky2_phy_intr(hw, 1);

work_done = sky2_status_intr(hw, work_limit);
if (work_done < work_limit) {
/* Bug/Errata workaround?
* Need to kick the TX irq moderation timer.
*/
if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_START) {
sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
}
netif_rx_complete(dev0);
work_done = sky2_status_intr(hw, min(dev0->quota, *budget));
*budget -= work_done;
dev0->quota -= work_done;

/* end of interrupt, re-enables also acts as I/O synchronization */
sky2_read32(hw, B0_Y2_SP_LISR);
return 0;
} else {
*budget -= work_done;
dev0->quota -= work_done;
/* More work? */
if (hw->st_idx != sky2_read16(hw, STAT_PUT_IDX))
return 1;

/* Bug/Errata workaround?
* Need to kick the TX irq moderation timer.
*/
if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_START) {
sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
}
netif_rx_complete(dev0);

sky2_read32(hw, B0_Y2_SP_LISR);
return 0;
}

static irqreturn_t sky2_intr(int irq, void *dev_id)
Expand Down

0 comments on commit 7bad099

Please sign in to comment.