aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-02-22 14:44:59 -0500
committerFrancois Romieu <romieu@fr.zoreil.com>2006-02-22 19:23:40 -0500
commitff81fbbe321c3a468b6225c673ca57efa501fbed (patch)
treeae715c27debaee2ef0bc1f36faccc7ef8bac2b09 /drivers/net/sky2.c
parent977bdf06ca8dd7ed081fab8d30249d9e6b1c24d3 (diff)
[PATCH] sky2: limit coalescing values to ring size
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>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r--drivers/net/sky2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index ce135b84a54c..cf7fd28d6776 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -2884,11 +2884,11 @@ static int sky2_set_coalesce(struct net_device *dev,
2884 (ecmd->rx_coalesce_usecs_irq < tmin || ecmd->rx_coalesce_usecs_irq > tmax)) 2884 (ecmd->rx_coalesce_usecs_irq < tmin || ecmd->rx_coalesce_usecs_irq > tmax))
2885 return -EINVAL; 2885 return -EINVAL;
2886 2886
2887 if (ecmd->tx_max_coalesced_frames > 0xffff) 2887 if (ecmd->tx_max_coalesced_frames >= TX_RING_SIZE-1)
2888 return -EINVAL; 2888 return -EINVAL;
2889 if (ecmd->rx_max_coalesced_frames > 0xff) 2889 if (ecmd->rx_max_coalesced_frames > RX_MAX_PENDING)
2890 return -EINVAL; 2890 return -EINVAL;
2891 if (ecmd->rx_max_coalesced_frames_irq > 0xff) 2891 if (ecmd->rx_max_coalesced_frames_irq >RX_MAX_PENDING)
2892 return -EINVAL; 2892 return -EINVAL;
2893 2893
2894 if (ecmd->tx_coalesce_usecs == 0) 2894 if (ecmd->tx_coalesce_usecs == 0)