aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/s2io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r--drivers/net/s2io.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 290e1c1f30c6..ac50c1992e11 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -4775,6 +4775,40 @@ static int s2io_ethtool_idnic(struct net_device *dev, u32 data)
4775 return 0; 4775 return 0;
4776} 4776}
4777 4777
4778static void s2io_ethtool_gringparam(struct net_device *dev,
4779 struct ethtool_ringparam *ering)
4780{
4781 struct s2io_nic *sp = dev->priv;
4782 int i,tx_desc_count=0,rx_desc_count=0;
4783
4784 if (sp->rxd_mode == RXD_MODE_1)
4785 ering->rx_max_pending = MAX_RX_DESC_1;
4786 else if (sp->rxd_mode == RXD_MODE_3B)
4787 ering->rx_max_pending = MAX_RX_DESC_2;
4788 else if (sp->rxd_mode == RXD_MODE_3A)
4789 ering->rx_max_pending = MAX_RX_DESC_3;
4790
4791 ering->tx_max_pending = MAX_TX_DESC;
4792 for (i = 0 ; i < sp->config.tx_fifo_num ; i++) {
4793 tx_desc_count += sp->config.tx_cfg[i].fifo_len;
4794 }
4795 DBG_PRINT(INFO_DBG,"\nmax txds : %d\n",sp->config.max_txds);
4796 ering->tx_pending = tx_desc_count;
4797 rx_desc_count = 0;
4798 for (i = 0 ; i < sp->config.rx_ring_num ; i++) {
4799 rx_desc_count += sp->config.rx_cfg[i].num_rxd;
4800 }
4801 ering->rx_pending = rx_desc_count;
4802
4803 ering->rx_mini_max_pending = 0;
4804 ering->rx_mini_pending = 0;
4805 if(sp->rxd_mode == RXD_MODE_1)
4806 ering->rx_jumbo_max_pending = MAX_RX_DESC_1;
4807 else if (sp->rxd_mode == RXD_MODE_3B)
4808 ering->rx_jumbo_max_pending = MAX_RX_DESC_2;
4809 ering->rx_jumbo_pending = rx_desc_count;
4810}
4811
4778/** 4812/**
4779 * s2io_ethtool_getpause_data -Pause frame frame generation and reception. 4813 * s2io_ethtool_getpause_data -Pause frame frame generation and reception.
4780 * @sp : private member of the device structure, which is a pointer to the 4814 * @sp : private member of the device structure, which is a pointer to the
@@ -5854,6 +5888,7 @@ static const struct ethtool_ops netdev_ethtool_ops = {
5854 .get_eeprom_len = s2io_get_eeprom_len, 5888 .get_eeprom_len = s2io_get_eeprom_len,
5855 .get_eeprom = s2io_ethtool_geeprom, 5889 .get_eeprom = s2io_ethtool_geeprom,
5856 .set_eeprom = s2io_ethtool_seeprom, 5890 .set_eeprom = s2io_ethtool_seeprom,
5891 .get_ringparam = s2io_ethtool_gringparam,
5857 .get_pauseparam = s2io_ethtool_getpause_data, 5892 .get_pauseparam = s2io_ethtool_getpause_data,
5858 .set_pauseparam = s2io_ethtool_setpause_data, 5893 .set_pauseparam = s2io_ethtool_setpause_data,
5859 .get_rx_csum = s2io_ethtool_get_rx_csum, 5894 .get_rx_csum = s2io_ethtool_get_rx_csum,