diff options
author | Jim Lewis <jim@jklewis.com> | 2006-08-15 02:00:23 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-08-19 17:44:30 -0400 |
commit | b68a60e598c0d1e738c807c47cb181e8cc52a0d8 (patch) | |
tree | cc06e0cd5a74c4ebdc5e5fecd2ab7a47d28f8130 /drivers | |
parent | 7e29f8bf39de372e3903a0b12f34285d30a8a244 (diff) |
[PATCH] Add ethtool -g support to Spidernet network driver
Add ethtool -g (show ring sizes) support to the Spidernet network driver.
Signed-off-by: James K Lewis <jklewis@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/spider_net.c | 12 | ||||
-rw-r--r-- | drivers/net/spider_net.h | 3 | ||||
-rw-r--r-- | drivers/net/spider_net_ethtool.c | 13 |
3 files changed, 23 insertions, 5 deletions
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 647f62e9707d..88907218457a 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -1611,13 +1611,12 @@ spider_net_open(struct net_device *netdev) | |||
1611 | int result; | 1611 | int result; |
1612 | 1612 | ||
1613 | result = -ENOMEM; | 1613 | result = -ENOMEM; |
1614 | if (spider_net_init_chain(card, &card->tx_chain, | 1614 | if (spider_net_init_chain(card, &card->tx_chain, card->descr, |
1615 | card->descr, | 1615 | PCI_DMA_TODEVICE, card->tx_desc)) |
1616 | PCI_DMA_TODEVICE, tx_descriptors)) | ||
1617 | goto alloc_tx_failed; | 1616 | goto alloc_tx_failed; |
1618 | if (spider_net_init_chain(card, &card->rx_chain, | 1617 | if (spider_net_init_chain(card, &card->rx_chain, |
1619 | card->descr + tx_descriptors, | 1618 | card->descr + card->rx_desc, |
1620 | PCI_DMA_FROMDEVICE, rx_descriptors)) | 1619 | PCI_DMA_FROMDEVICE, card->rx_desc)) |
1621 | goto alloc_rx_failed; | 1620 | goto alloc_rx_failed; |
1622 | 1621 | ||
1623 | /* allocate rx skbs */ | 1622 | /* allocate rx skbs */ |
@@ -2005,6 +2004,9 @@ spider_net_setup_netdev(struct spider_net_card *card) | |||
2005 | 2004 | ||
2006 | card->options.rx_csum = SPIDER_NET_RX_CSUM_DEFAULT; | 2005 | card->options.rx_csum = SPIDER_NET_RX_CSUM_DEFAULT; |
2007 | 2006 | ||
2007 | card->tx_desc = tx_descriptors; | ||
2008 | card->rx_desc = rx_descriptors; | ||
2009 | |||
2008 | spider_net_setup_netdev_ops(netdev); | 2010 | spider_net_setup_netdev_ops(netdev); |
2009 | 2011 | ||
2010 | netdev->features = NETIF_F_HW_CSUM | NETIF_F_LLTX; | 2012 | netdev->features = NETIF_F_HW_CSUM | NETIF_F_LLTX; |
diff --git a/drivers/net/spider_net.h b/drivers/net/spider_net.h index f6dcf180ae3d..30407cdf0892 100644 --- a/drivers/net/spider_net.h +++ b/drivers/net/spider_net.h | |||
@@ -440,6 +440,9 @@ struct spider_net_card { | |||
440 | /* for ethtool */ | 440 | /* for ethtool */ |
441 | int msg_enable; | 441 | int msg_enable; |
442 | 442 | ||
443 | int rx_desc; | ||
444 | int tx_desc; | ||
445 | |||
443 | struct spider_net_descr descr[0]; | 446 | struct spider_net_descr descr[0]; |
444 | }; | 447 | }; |
445 | 448 | ||
diff --git a/drivers/net/spider_net_ethtool.c b/drivers/net/spider_net_ethtool.c index a5bb0b7633af..02209222b8c9 100644 --- a/drivers/net/spider_net_ethtool.c +++ b/drivers/net/spider_net_ethtool.c | |||
@@ -130,6 +130,18 @@ spider_net_ethtool_set_tx_csum(struct net_device *netdev, uint32_t data) | |||
130 | return 0; | 130 | return 0; |
131 | } | 131 | } |
132 | 132 | ||
133 | static void | ||
134 | spider_net_ethtool_get_ringparam(struct net_device *netdev, | ||
135 | struct ethtool_ringparam *ering) | ||
136 | { | ||
137 | struct spider_net_card *card = netdev->priv; | ||
138 | |||
139 | ering->tx_max_pending = SPIDER_NET_TX_DESCRIPTORS_MAX; | ||
140 | ering->tx_pending = card->tx_desc; | ||
141 | ering->rx_max_pending = SPIDER_NET_RX_DESCRIPTORS_MAX; | ||
142 | ering->rx_pending = card->rx_desc; | ||
143 | } | ||
144 | |||
133 | struct ethtool_ops spider_net_ethtool_ops = { | 145 | struct ethtool_ops spider_net_ethtool_ops = { |
134 | .get_settings = spider_net_ethtool_get_settings, | 146 | .get_settings = spider_net_ethtool_get_settings, |
135 | .get_drvinfo = spider_net_ethtool_get_drvinfo, | 147 | .get_drvinfo = spider_net_ethtool_get_drvinfo, |
@@ -141,5 +153,6 @@ struct ethtool_ops spider_net_ethtool_ops = { | |||
141 | .set_rx_csum = spider_net_ethtool_set_rx_csum, | 153 | .set_rx_csum = spider_net_ethtool_set_rx_csum, |
142 | .get_tx_csum = spider_net_ethtool_get_tx_csum, | 154 | .get_tx_csum = spider_net_ethtool_get_tx_csum, |
143 | .set_tx_csum = spider_net_ethtool_set_tx_csum, | 155 | .set_tx_csum = spider_net_ethtool_set_tx_csum, |
156 | .get_ringparam = spider_net_ethtool_get_ringparam, | ||
144 | }; | 157 | }; |
145 | 158 | ||