diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/sky2.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 41dbe588de30..7e3353f55c38 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -2272,7 +2272,8 @@ static int sky2_reset(struct sky2_hw *hw) | |||
2272 | sky2_write8(hw, STAT_FIFO_ISR_WM, 16); | 2272 | sky2_write8(hw, STAT_FIFO_ISR_WM, 16); |
2273 | 2273 | ||
2274 | sky2_write32(hw, STAT_TX_TIMER_INI, sky2_us2clk(hw, 1000)); | 2274 | sky2_write32(hw, STAT_TX_TIMER_INI, sky2_us2clk(hw, 1000)); |
2275 | sky2_write32(hw, STAT_ISR_TIMER_INI, sky2_us2clk(hw, 7)); | 2275 | sky2_write32(hw, STAT_ISR_TIMER_INI, sky2_us2clk(hw, 20)); |
2276 | sky2_write32(hw, STAT_LEV_TIMER_INI, sky2_us2clk(hw, 100)); | ||
2276 | 2277 | ||
2277 | /* enable status unit */ | 2278 | /* enable status unit */ |
2278 | sky2_write32(hw, STAT_CTRL, SC_STAT_OP_ON); | 2279 | sky2_write32(hw, STAT_CTRL, SC_STAT_OP_ON); |
@@ -2758,19 +2759,11 @@ static int sky2_set_coalesce(struct net_device *dev, | |||
2758 | { | 2759 | { |
2759 | struct sky2_port *sky2 = netdev_priv(dev); | 2760 | struct sky2_port *sky2 = netdev_priv(dev); |
2760 | struct sky2_hw *hw = sky2->hw; | 2761 | struct sky2_hw *hw = sky2->hw; |
2761 | const u32 tmin = sky2_clk2us(hw, 1); | 2762 | const u32 tmax = sky2_clk2us(hw, 0x0ffffff); |
2762 | const u32 tmax = 5000; | ||
2763 | 2763 | ||
2764 | if (ecmd->tx_coalesce_usecs != 0 && | 2764 | if (ecmd->tx_coalesce_usecs > tmax || |
2765 | (ecmd->tx_coalesce_usecs < tmin || ecmd->tx_coalesce_usecs > tmax)) | 2765 | ecmd->rx_coalesce_usecs > tmax || |
2766 | return -EINVAL; | 2766 | ecmd->rx_coalesce_usecs_irq > tmax) |
2767 | |||
2768 | if (ecmd->rx_coalesce_usecs != 0 && | ||
2769 | (ecmd->rx_coalesce_usecs < tmin || ecmd->rx_coalesce_usecs > tmax)) | ||
2770 | return -EINVAL; | ||
2771 | |||
2772 | if (ecmd->rx_coalesce_usecs_irq != 0 && | ||
2773 | (ecmd->rx_coalesce_usecs_irq < tmin || ecmd->rx_coalesce_usecs_irq > tmax)) | ||
2774 | return -EINVAL; | 2767 | return -EINVAL; |
2775 | 2768 | ||
2776 | if (ecmd->tx_max_coalesced_frames >= TX_RING_SIZE-1) | 2769 | if (ecmd->tx_max_coalesced_frames >= TX_RING_SIZE-1) |