summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-02-22 11:44:59 -0800
committerFrancois Romieu <romieu@fr.zoreil.com>2006-02-23 01:23:40 +0100
commitff81fbbe321c3a468b6225c673ca57efa501fbed (patch)
treeae715c27debaee2ef0bc1f36faccc7ef8bac2b09
parent977bdf06ca8dd7ed081fab8d30249d9e6b1c24d3 (diff)
downloadlinux-next-ff81fbbe321c3a468b6225c673ca57efa501fbed.tar.gz
[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>
-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,
(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)