aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r--drivers/net/sky2.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index de1177b7b996..13431f6a3ad9 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -50,7 +50,7 @@
50#include "sky2.h" 50#include "sky2.h"
51 51
52#define DRV_NAME "sky2" 52#define DRV_NAME "sky2"
53#define DRV_VERSION "1.5" 53#define DRV_VERSION "1.6"
54#define PFX DRV_NAME " " 54#define PFX DRV_NAME " "
55 55
56/* 56/*
@@ -1932,12 +1932,6 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
1932 } 1932 }
1933} 1933}
1934 1934
1935/* Is status ring empty or is there more to do? */
1936static inline int sky2_more_work(const struct sky2_hw *hw)
1937{
1938 return (hw->st_idx != sky2_read16(hw, STAT_PUT_IDX));
1939}
1940
1941/* Process status response ring */ 1935/* Process status response ring */
1942static int sky2_status_intr(struct sky2_hw *hw, int to_do) 1936static int sky2_status_intr(struct sky2_hw *hw, int to_do)
1943{ 1937{
@@ -2028,6 +2022,9 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
2028 } 2022 }
2029 } 2023 }
2030 2024
2025 /* Fully processed status ring so clear irq */
2026 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
2027
2031exit_loop: 2028exit_loop:
2032 if (buf_write[0]) { 2029 if (buf_write[0]) {
2033 sky2 = netdev_priv(hw->dev[0]); 2030 sky2 = netdev_priv(hw->dev[0]);
@@ -2237,19 +2234,16 @@ static int sky2_poll(struct net_device *dev0, int *budget)
2237 sky2_descriptor_error(hw, 1, "transmit", Y2_IS_CHK_TXA2); 2234 sky2_descriptor_error(hw, 1, "transmit", Y2_IS_CHK_TXA2);
2238 2235
2239 work_done = sky2_status_intr(hw, work_limit); 2236 work_done = sky2_status_intr(hw, work_limit);
2240 *budget -= work_done; 2237 if (work_done < work_limit) {
2241 dev0->quota -= work_done; 2238 netif_rx_complete(dev0);
2242
2243 if (status & Y2_IS_STAT_BMU)
2244 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
2245 2239
2246 if (sky2_more_work(hw)) 2240 sky2_read32(hw, B0_Y2_SP_LISR);
2241 return 0;
2242 } else {
2243 *budget -= work_done;
2244 dev0->quota -= work_done;
2247 return 1; 2245 return 1;
2248 2246 }
2249 netif_rx_complete(dev0);
2250
2251 sky2_read32(hw, B0_Y2_SP_LISR);
2252 return 0;
2253} 2247}
2254 2248
2255static irqreturn_t sky2_intr(int irq, void *dev_id, struct pt_regs *regs) 2249static irqreturn_t sky2_intr(int irq, void *dev_id, struct pt_regs *regs)