aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen
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
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')
-rw-r--r--drivers/net/netxen/netxen_nic_ethtool.c23
-rw-r--r--drivers/net/netxen/netxen_nic_main.c8
2 files changed, 10 insertions, 21 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
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 6cae26a5bd67..880fcd0663e6 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -1898,12 +1898,8 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter)
1898 linkup = (val == XG_LINK_UP_P3); 1898 linkup = (val == XG_LINK_UP_P3);
1899 } else { 1899 } else {
1900 val = NXRD32(adapter, CRB_XG_STATE); 1900 val = NXRD32(adapter, CRB_XG_STATE);
1901 if (adapter->ahw.port_type == NETXEN_NIC_GBE) 1901 val = (val >> port*8) & 0xff;
1902 linkup = (val >> port) & 1; 1902 linkup = (val == XG_LINK_UP);
1903 else {
1904 val = (val >> port*8) & 0xff;
1905 linkup = (val == XG_LINK_UP);
1906 }
1907 } 1903 }
1908 1904
1909 netxen_advert_link_change(adapter, linkup); 1905 netxen_advert_link_change(adapter, linkup);