aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/netxen/netxen_nic_ethtool.c')
-rw-r--r--drivers/net/netxen/netxen_nic_ethtool.c65
1 files changed, 33 insertions, 32 deletions
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index 9a914aeba5bc..2ab4885cc950 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -1,25 +1,25 @@
1/* 1/*
2 * Copyright (C) 2003 - 2006 NetXen, Inc. 2 * Copyright (C) 2003 - 2006 NetXen, Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License 6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2 7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version. 8 * of the License, or (at your option) any later version.
9 * 9 *
10 * This program is distributed in the hope that it will be useful, but 10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of 11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18 * MA 02111-1307, USA. 18 * MA 02111-1307, USA.
19 * 19 *
20 * The full GNU General Public License is included in this distribution 20 * The full GNU General Public License is included in this distribution
21 * in the file called LICENSE. 21 * in the file called LICENSE.
22 * 22 *
23 * Contact Information: 23 * Contact Information:
24 * info@netxen.com 24 * info@netxen.com
25 * NetXen, 25 * NetXen,
@@ -118,7 +118,7 @@ netxen_nic_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo)
118 u32 fw_minor = 0; 118 u32 fw_minor = 0;
119 u32 fw_build = 0; 119 u32 fw_build = 0;
120 120
121 strncpy(drvinfo->driver, "netxen_nic", 32); 121 strncpy(drvinfo->driver, netxen_nic_driver_name, 32);
122 strncpy(drvinfo->version, NETXEN_NIC_LINUX_VERSIONID, 32); 122 strncpy(drvinfo->version, NETXEN_NIC_LINUX_VERSIONID, 32);
123 fw_major = readl(NETXEN_CRB_NORMALIZE(adapter, 123 fw_major = readl(NETXEN_CRB_NORMALIZE(adapter,
124 NETXEN_FW_VERSION_MAJOR)); 124 NETXEN_FW_VERSION_MAJOR));
@@ -210,7 +210,6 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
210 printk(KERN_ERR "netxen-nic: Unsupported board model %d\n", 210 printk(KERN_ERR "netxen-nic: Unsupported board model %d\n",
211 (netxen_brdtype_t) boardinfo->board_type); 211 (netxen_brdtype_t) boardinfo->board_type);
212 return -EIO; 212 return -EIO;
213
214 } 213 }
215 214
216 return 0; 215 return 0;
@@ -226,18 +225,18 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
226 /* read which mode */ 225 /* read which mode */
227 if (adapter->ahw.board_type == NETXEN_NIC_GBE) { 226 if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
228 /* autonegotiation */ 227 /* autonegotiation */
229 if (adapter->ops->phy_write 228 if (adapter->phy_write
230 && adapter->ops->phy_write(adapter, port->portnum, 229 && adapter->phy_write(adapter, port->portnum,
231 NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, 230 NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
232 (__le32) ecmd->autoneg) != 0) 231 (__le32) ecmd->autoneg) != 0)
233 return -EIO; 232 return -EIO;
234 else 233 else
235 port->link_autoneg = ecmd->autoneg; 234 port->link_autoneg = ecmd->autoneg;
236 235
237 if (adapter->ops->phy_read 236 if (adapter->phy_read
238 && adapter->ops->phy_read(adapter, port->portnum, 237 && adapter->phy_read(adapter, port->portnum,
239 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, 238 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
240 &status) != 0) 239 &status) != 0)
241 return -EIO; 240 return -EIO;
242 241
243 /* speed */ 242 /* speed */
@@ -257,10 +256,10 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
257 netxen_clear_phy_duplex(status); 256 netxen_clear_phy_duplex(status);
258 if (ecmd->duplex == DUPLEX_FULL) 257 if (ecmd->duplex == DUPLEX_FULL)
259 netxen_set_phy_duplex(status); 258 netxen_set_phy_duplex(status);
260 if (adapter->ops->phy_write 259 if (adapter->phy_write
261 && adapter->ops->phy_write(adapter, port->portnum, 260 && adapter->phy_write(adapter, port->portnum,
262 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, 261 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
263 *((int *)&status)) != 0) 262 *((int *)&status)) != 0)
264 return -EIO; 263 return -EIO;
265 else { 264 else {
266 port->link_speed = ecmd->speed; 265 port->link_speed = ecmd->speed;
@@ -422,10 +421,10 @@ static u32 netxen_nic_get_link(struct net_device *dev)
422 421
423 /* read which mode */ 422 /* read which mode */
424 if (adapter->ahw.board_type == NETXEN_NIC_GBE) { 423 if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
425 if (adapter->ops->phy_read 424 if (adapter->phy_read
426 && adapter->ops->phy_read(adapter, port->portnum, 425 && adapter->phy_read(adapter, port->portnum,
427 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, 426 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
428 &status) != 0) 427 &status) != 0)
429 return -EIO; 428 return -EIO;
430 else 429 else
431 return (netxen_get_phy_link(status)); 430 return (netxen_get_phy_link(status));
@@ -460,20 +459,22 @@ netxen_nic_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring)
460{ 459{
461 struct netxen_port *port = netdev_priv(dev); 460 struct netxen_port *port = netdev_priv(dev);
462 struct netxen_adapter *adapter = port->adapter; 461 struct netxen_adapter *adapter = port->adapter;
463 int i, j; 462 int i;
464 463
465 ring->rx_pending = 0; 464 ring->rx_pending = 0;
465 ring->rx_jumbo_pending = 0;
466 for (i = 0; i < MAX_RCV_CTX; ++i) { 466 for (i = 0; i < MAX_RCV_CTX; ++i) {
467 for (j = 0; j < NUM_RCV_DESC_RINGS; j++) 467 ring->rx_pending += adapter->recv_ctx[i].
468 ring->rx_pending += 468 rcv_desc[RCV_DESC_NORMAL_CTXID].rcv_pending;
469 adapter->recv_ctx[i].rcv_desc[j].rcv_pending; 469 ring->rx_jumbo_pending += adapter->recv_ctx[i].
470 rcv_desc[RCV_DESC_JUMBO_CTXID].rcv_pending;
470 } 471 }
471 472
472 ring->rx_max_pending = adapter->max_rx_desc_count; 473 ring->rx_max_pending = adapter->max_rx_desc_count;
473 ring->tx_max_pending = adapter->max_tx_desc_count; 474 ring->tx_max_pending = adapter->max_tx_desc_count;
475 ring->rx_jumbo_max_pending = adapter->max_jumbo_rx_desc_count;
474 ring->rx_mini_max_pending = 0; 476 ring->rx_mini_max_pending = 0;
475 ring->rx_mini_pending = 0; 477 ring->rx_mini_pending = 0;
476 ring->rx_jumbo_max_pending = 0;
477 ring->rx_jumbo_pending = 0; 478 ring->rx_jumbo_pending = 0;
478} 479}
479 480
@@ -526,10 +527,10 @@ netxen_nic_set_pauseparam(struct net_device *dev,
526 *(u32 *) (&val)); 527 *(u32 *) (&val));
527 /* set autoneg */ 528 /* set autoneg */
528 autoneg = pause->autoneg; 529 autoneg = pause->autoneg;
529 if (adapter->ops->phy_write 530 if (adapter->phy_write
530 && adapter->ops->phy_write(adapter, port->portnum, 531 && adapter->phy_write(adapter, port->portnum,
531 NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, 532 NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
532 (__le32) autoneg) != 0) 533 (__le32) autoneg) != 0)
533 return -EIO; 534 return -EIO;
534 else { 535 else {
535 port->link_autoneg = pause->autoneg; 536 port->link_autoneg = pause->autoneg;