]> err.no Git - linux-2.6/commitdiff
[PATCH] sky2: limit coalescing values to ring size
authorStephen Hemminger <shemminger@osdl.org>
Wed, 22 Feb 2006 19:44:59 +0000 (11:44 -0800)
committerFrancois Romieu <romieu@fr.zoreil.com>
Thu, 23 Feb 2006 00:23:40 +0000 (01:23 +0100)
Don't allow coalescing values to be bigger than the transmit ring.
Since if you set them that big, the interrupt never happens and driver
livelocks.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
drivers/net/sky2.c

index ce135b84a54c8640cfe7a48e8513934a9e3a8e4e..cf7fd28d67767e0325e09bb5861d521499189799 100644 (file)
@@ -2884,11 +2884,11 @@ static int sky2_set_coalesce(struct net_device *dev,
            (ecmd->rx_coalesce_usecs_irq < tmin || ecmd->rx_coalesce_usecs_irq > tmax))
                return -EINVAL;
 
-       if (ecmd->tx_max_coalesced_frames > 0xffff)
+       if (ecmd->tx_max_coalesced_frames >= TX_RING_SIZE-1)
                return -EINVAL;
-       if (ecmd->rx_max_coalesced_frames > 0xff)
+       if (ecmd->rx_max_coalesced_frames > RX_MAX_PENDING)
                return -EINVAL;
-       if (ecmd->rx_max_coalesced_frames_irq > 0xff)
+       if (ecmd->rx_max_coalesced_frames_irq >RX_MAX_PENDING)
                return -EINVAL;
 
        if (ecmd->tx_coalesce_usecs == 0)