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>
This commit is contained in:
parent
2d2cf34681
commit
a4b751d872
|
@ -385,25 +385,18 @@ netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
|
||||||
static u32 netxen_nic_test_link(struct net_device *dev)
|
static u32 netxen_nic_test_link(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct netxen_adapter *adapter = netdev_priv(dev);
|
struct netxen_adapter *adapter = netdev_priv(dev);
|
||||||
__u32 status;
|
u32 val, port;
|
||||||
int val;
|
|
||||||
|
|
||||||
/* read which mode */
|
port = adapter->physical_port;
|
||||||
if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
|
if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
|
||||||
if (adapter->phy_read &&
|
val = NXRD32(adapter, CRB_XG_STATE_P3);
|
||||||
adapter->phy_read(adapter,
|
val = XG_LINK_STATE_P3(adapter->ahw.pci_func, val);
|
||||||
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
|
return (val == XG_LINK_UP_P3) ? 0 : 1;
|
||||||
&status) != 0)
|
} else {
|
||||||
return -EIO;
|
|
||||||
else {
|
|
||||||
val = netxen_get_phy_link(status);
|
|
||||||
return !val;
|
|
||||||
}
|
|
||||||
} else if (adapter->ahw.port_type == NETXEN_NIC_XGBE) {
|
|
||||||
val = NXRD32(adapter, CRB_XG_STATE);
|
val = NXRD32(adapter, CRB_XG_STATE);
|
||||||
|
val = (val >> port*8) & 0xff;
|
||||||
return (val == XG_LINK_UP) ? 0 : 1;
|
return (val == XG_LINK_UP) ? 0 : 1;
|
||||||
}
|
}
|
||||||
return -EIO;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -1898,12 +1898,8 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter)
|
||||||
linkup = (val == XG_LINK_UP_P3);
|
linkup = (val == XG_LINK_UP_P3);
|
||||||
} else {
|
} else {
|
||||||
val = NXRD32(adapter, CRB_XG_STATE);
|
val = NXRD32(adapter, CRB_XG_STATE);
|
||||||
if (adapter->ahw.port_type == NETXEN_NIC_GBE)
|
val = (val >> port*8) & 0xff;
|
||||||
linkup = (val >> port) & 1;
|
linkup = (val == XG_LINK_UP);
|
||||||
else {
|
|
||||||
val = (val >> port*8) & 0xff;
|
|
||||||
linkup = (val == XG_LINK_UP);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
netxen_advert_link_change(adapter, linkup);
|
netxen_advert_link_change(adapter, linkup);
|
||||||
|
|
Loading…
Reference in New Issue