diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2008-08-01 03:14:55 -0700 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-08-07 02:11:07 -0400 |
commit | 24a7a45511f89959b4f1dc60a66260d09777901a (patch) | |
tree | ef48a3f9c6f65ba98f047b38937f71baef4a95ed /drivers/net/netxen/netxen_nic_ethtool.c | |
parent | 4ad7a018cf4ac3cbad661c28c0f783ee0a6e3bf6 (diff) | |
download | kernel_samsung_espresso10-24a7a45511f89959b4f1dc60a66260d09777901a.zip kernel_samsung_espresso10-24a7a45511f89959b4f1dc60a66260d09777901a.tar.gz kernel_samsung_espresso10-24a7a45511f89959b4f1dc60a66260d09777901a.tar.bz2 |
netxen: fix link status, link speed
For NX3031, the phy is managed by firmware, so driver should avoid
setting any phy registers.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_ethtool.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_ethtool.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index 48ee06b..f9b933e 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c @@ -140,18 +140,33 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) if (netif_running(dev)) { ecmd->speed = adapter->link_speed; ecmd->duplex = adapter->link_duplex; - } else - return -EIO; /* link absent */ + ecmd->autoneg = adapter->link_autoneg; + } + } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { - ecmd->supported = (SUPPORTED_TP | - SUPPORTED_1000baseT_Full | - SUPPORTED_10000baseT_Full); - ecmd->advertising = (ADVERTISED_TP | - ADVERTISED_1000baseT_Full | - ADVERTISED_10000baseT_Full); + u32 val; + + adapter->hw_read_wx(adapter, NETXEN_PORT_MODE_ADDR, &val, 4); + if (val == NETXEN_PORT_MODE_802_3_AP) { + ecmd->supported = SUPPORTED_1000baseT_Full; + ecmd->advertising = ADVERTISED_1000baseT_Full; + } else { + ecmd->supported = SUPPORTED_10000baseT_Full; + ecmd->advertising = ADVERTISED_10000baseT_Full; + } + ecmd->port = PORT_TP; - ecmd->speed = SPEED_10000; + if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { + u16 pcifn = adapter->ahw.pci_func; + + adapter->hw_read_wx(adapter, + P3_LINK_SPEED_REG(pcifn), &val, 4); + ecmd->speed = P3_LINK_SPEED_MHZ * + P3_LINK_SPEED_VAL(pcifn, val); + } else + ecmd->speed = SPEED_10000; + ecmd->duplex = DUPLEX_FULL; ecmd->autoneg = AUTONEG_DISABLE; } else |