Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0cec35ebf341726e2490a4b01296a6dc132d1127
Commit:     0cec35ebf341726e2490a4b01296a6dc132d1127
Parent:     0a3fd051c7036ef71b58863f8e5da7c3dabd9d3f
Author:     Sreenivasa Honnur <[EMAIL PROTECTED]>
AuthorDate: Thu May 10 04:06:28 2007 -0400
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Fri May 11 17:53:05 2007 -0400

    S2IO: getringparam ethtool option
    
    Adding get_ringparam ethtool option.
    
    Signed-off-by: Sreenivasa Honnur <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/s2io.c |   35 +++++++++++++++++++++++++++++++++++
 drivers/net/s2io.h |    5 +++++
 2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 290e1c1..ac50c19 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)
        return 0;
 }
 
+static void s2io_ethtool_gringparam(struct net_device *dev,
+                                    struct ethtool_ringparam *ering)
+{
+       struct s2io_nic *sp = dev->priv;
+       int i,tx_desc_count=0,rx_desc_count=0;
+
+       if (sp->rxd_mode == RXD_MODE_1)
+               ering->rx_max_pending = MAX_RX_DESC_1;
+       else if (sp->rxd_mode == RXD_MODE_3B)
+               ering->rx_max_pending = MAX_RX_DESC_2;
+       else if (sp->rxd_mode == RXD_MODE_3A)
+               ering->rx_max_pending = MAX_RX_DESC_3;
+
+       ering->tx_max_pending = MAX_TX_DESC;
+       for (i = 0 ; i < sp->config.tx_fifo_num ; i++) {
+               tx_desc_count += sp->config.tx_cfg[i].fifo_len;
+       }
+       DBG_PRINT(INFO_DBG,"\nmax txds : %d\n",sp->config.max_txds);
+       ering->tx_pending = tx_desc_count;
+       rx_desc_count = 0;
+       for (i = 0 ; i < sp->config.rx_ring_num ; i++) {
+               rx_desc_count += sp->config.rx_cfg[i].num_rxd;
+       }
+       ering->rx_pending = rx_desc_count;
+
+       ering->rx_mini_max_pending = 0;
+       ering->rx_mini_pending = 0;
+       if(sp->rxd_mode == RXD_MODE_1)
+               ering->rx_jumbo_max_pending = MAX_RX_DESC_1;
+       else if (sp->rxd_mode == RXD_MODE_3B)
+               ering->rx_jumbo_max_pending = MAX_RX_DESC_2;
+       ering->rx_jumbo_pending = rx_desc_count;
+}
+
 /**
  * s2io_ethtool_getpause_data -Pause frame frame generation and reception.
  * @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 = {
        .get_eeprom_len = s2io_get_eeprom_len,
        .get_eeprom = s2io_ethtool_geeprom,
        .set_eeprom = s2io_ethtool_seeprom,
+       .get_ringparam = s2io_ethtool_gringparam,
        .get_pauseparam = s2io_ethtool_getpause_data,
        .set_pauseparam = s2io_ethtool_setpause_data,
        .get_rx_csum = s2io_ethtool_get_rx_csum,
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
index a656d18..8d9cd60 100644
--- a/drivers/net/s2io.h
+++ b/drivers/net/s2io.h
@@ -308,6 +308,11 @@ struct stat_block {
 #define MAX_TX_FIFOS 8
 #define MAX_RX_RINGS 8
 
+#define MAX_RX_DESC_1  (MAX_RX_RINGS * MAX_RX_BLOCKS_PER_RING * 127 )
+#define MAX_RX_DESC_2  (MAX_RX_RINGS * MAX_RX_BLOCKS_PER_RING * 85 )
+#define MAX_RX_DESC_3  (MAX_RX_RINGS * MAX_RX_BLOCKS_PER_RING * 85 )
+#define MAX_TX_DESC    (MAX_AVAILABLE_TXDS)
+
 /* FIFO mappings for all possible number of fifos configured */
 static int fifo_map[][MAX_TX_FIFOS] = {
        {0, 0, 0, 0, 0, 0, 0, 0},
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to