aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-09-05 03:41:44 -0400
committerDavid S. Miller <davem@davemloft.net>2011-09-16 16:50:36 -0400
commitb548f97684412b0969dc148e1706eb047151e356 (patch)
tree94c26c7d961b2d7f0dc9a3c539cf334cdb12628d
parent9f85ee9c49319a5843de66271af9e9eea02becfc (diff)
sfc: Use consistent types for interrupt coalescing parameters
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/sfc/efx.c10
-rw-r--r--drivers/net/ethernet/sfc/efx.h4
-rw-r--r--drivers/net/ethernet/sfc/ethtool.c3
3 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index b6b0e71f7fc8..097ed8b4a79a 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1556,18 +1556,18 @@ static void efx_remove_all(struct efx_nic *efx)
1556 * 1556 *
1557 **************************************************************************/ 1557 **************************************************************************/
1558 1558
1559static unsigned irq_mod_ticks(int usecs, int resolution) 1559static unsigned int irq_mod_ticks(unsigned int usecs, unsigned int resolution)
1560{ 1560{
1561 if (usecs <= 0) 1561 if (usecs == 0)
1562 return 0; /* cannot receive interrupts ahead of time :-) */ 1562 return 0;
1563 if (usecs < resolution) 1563 if (usecs < resolution)
1564 return 1; /* never round down to 0 */ 1564 return 1; /* never round down to 0 */
1565 return usecs / resolution; 1565 return usecs / resolution;
1566} 1566}
1567 1567
1568/* Set interrupt moderation parameters */ 1568/* Set interrupt moderation parameters */
1569void efx_init_irq_moderation(struct efx_nic *efx, int tx_usecs, int rx_usecs, 1569void efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs,
1570 bool rx_adaptive) 1570 unsigned int rx_usecs, bool rx_adaptive)
1571{ 1571{
1572 struct efx_channel *channel; 1572 struct efx_channel *channel;
1573 unsigned tx_ticks = irq_mod_ticks(tx_usecs, EFX_IRQ_MOD_RESOLUTION); 1573 unsigned tx_ticks = irq_mod_ticks(tx_usecs, EFX_IRQ_MOD_RESOLUTION);
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
index b0d1209ea18d..8f5acae431b9 100644
--- a/drivers/net/ethernet/sfc/efx.h
+++ b/drivers/net/ethernet/sfc/efx.h
@@ -111,8 +111,8 @@ extern int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok);
111 111
112/* Global */ 112/* Global */
113extern void efx_schedule_reset(struct efx_nic *efx, enum reset_type type); 113extern void efx_schedule_reset(struct efx_nic *efx, enum reset_type type);
114extern void efx_init_irq_moderation(struct efx_nic *efx, int tx_usecs, 114extern void efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs,
115 int rx_usecs, bool rx_adaptive); 115 unsigned int rx_usecs, bool rx_adaptive);
116 116
117/* Dummy PHY ops for PHY drivers */ 117/* Dummy PHY ops for PHY drivers */
118extern int efx_port_dummy_op_int(struct efx_nic *efx); 118extern int efx_port_dummy_op_int(struct efx_nic *efx);
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
index 6de2715dae18..dedaa2c97e3c 100644
--- a/drivers/net/ethernet/sfc/ethtool.c
+++ b/drivers/net/ethernet/sfc/ethtool.c
@@ -625,7 +625,8 @@ static int efx_ethtool_set_coalesce(struct net_device *net_dev,
625{ 625{
626 struct efx_nic *efx = netdev_priv(net_dev); 626 struct efx_nic *efx = netdev_priv(net_dev);
627 struct efx_channel *channel; 627 struct efx_channel *channel;
628 unsigned tx_usecs, rx_usecs, adaptive; 628 unsigned int tx_usecs, rx_usecs;
629 bool adaptive;
629 630
630 if (coalesce->use_adaptive_tx_coalesce) 631 if (coalesce->use_adaptive_tx_coalesce)
631 return -EINVAL; 632 return -EINVAL;