aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_ethtool.c
diff options
context:
space:
mode:
authorSucheta Chakraborty <sucheta.chakraborty@qlogic.com>2010-01-01 22:25:19 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-04 01:06:16 -0500
commita4b751d87241c1b49ce43f819428223bfc22dc27 (patch)
tree53c92cf7799c68a8cb810aa3c4803a910f3da7e8 /drivers/net/netxen/netxen_nic_ethtool.c
parent2d2cf34681e65a2495946ebc90b407ba4088e8d0 (diff)
netxen: fix ethtool link test
o Fix ethtool link test for NX3031 chip. o Remove unused code from phy interrupt callback Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_ethtool.c')
-rw-r--r--drivers/net/netxen/netxen_nic_ethtool.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index 72ced0047edf..542f408333ff 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -385,25 +385,18 @@ netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
385static u32 netxen_nic_test_link(struct net_device *dev) 385static u32 netxen_nic_test_link(struct net_device *dev)
386{ 386{
387 struct netxen_adapter *adapter = netdev_priv(dev); 387 struct netxen_adapter *adapter = netdev_priv(dev);
388 __u32 status; 388 u32 val, port;
389 int val;
390 389
391 /* read which mode */ 390 port = adapter->physical_port;
392 if (adapter->ahw.port_type == NETXEN_NIC_GBE) { 391 if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
393 if (adapter->phy_read && 392 val = NXRD32(adapter, CRB_XG_STATE_P3);
394 adapter->phy_read(adapter, 393 val = XG_LINK_STATE_P3(adapter->ahw.pci_func, val);
395 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, 394 return (val == XG_LINK_UP_P3) ? 0 : 1;
396 &status) != 0) 395 } else {
397 return -EIO;
398 else {
399 val = netxen_get_phy_link(status);
400 return !val;
401 }
402 } else if (adapter->ahw.port_type == NETXEN_NIC_XGBE) {
403 val = NXRD32(adapter, CRB_XG_STATE); 396 val = NXRD32(adapter, CRB_XG_STATE);
397 val = (val >> port*8) & 0xff;
404 return (val == XG_LINK_UP) ? 0 : 1; 398 return (val == XG_LINK_UP) ? 0 : 1;
405 } 399 }
406 return -EIO;
407} 400}
408 401
409static int 402static int