Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179089
b: refs/heads/master
c: a4b751d
h: refs/heads/master
i:
  179087: f72f57d
v: v3
  • Loading branch information
Sucheta Chakraborty authored and David S. Miller committed Jan 4, 2010
1 parent 18f858f commit 5e99658
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2d2cf34681e65a2495946ebc90b407ba4088e8d0
refs/heads/master: a4b751d87241c1b49ce43f819428223bfc22dc27
23 changes: 8 additions & 15 deletions trunk/drivers/net/netxen/netxen_nic_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
struct netxen_adapter *adapter = netdev_priv(dev);
__u32 status;
int val;
u32 val, port;

/* read which mode */
if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
if (adapter->phy_read &&
adapter->phy_read(adapter,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
&status) != 0)
return -EIO;
else {
val = netxen_get_phy_link(status);
return !val;
}
} else if (adapter->ahw.port_type == NETXEN_NIC_XGBE) {
port = adapter->physical_port;
if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
val = NXRD32(adapter, CRB_XG_STATE_P3);
val = XG_LINK_STATE_P3(adapter->ahw.pci_func, val);
return (val == XG_LINK_UP_P3) ? 0 : 1;
} else {
val = NXRD32(adapter, CRB_XG_STATE);
val = (val >> port*8) & 0xff;
return (val == XG_LINK_UP) ? 0 : 1;
}
return -EIO;
}

static int
Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/net/netxen/netxen_nic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1898,12 +1898,8 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter)
linkup = (val == XG_LINK_UP_P3);
} else {
val = NXRD32(adapter, CRB_XG_STATE);
if (adapter->ahw.port_type == NETXEN_NIC_GBE)
linkup = (val >> port) & 1;
else {
val = (val >> port*8) & 0xff;
linkup = (val == XG_LINK_UP);
}
val = (val >> port*8) & 0xff;
linkup = (val == XG_LINK_UP);
}

netxen_advert_link_change(adapter, linkup);
Expand Down

0 comments on commit 5e99658

Please sign in to comment.