diff options
author | Sarveshwar Bandi <sarveshwarb@serverengines.com> | 2009-10-28 07:15:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-28 07:15:20 -0400 |
commit | 0388f251a33ea60937564ad1f27cf77243409f06 (patch) | |
tree | 1e70648214ae726e4741f2a8bbe848912ae0e0bf /drivers/net/benet/be_ethtool.c | |
parent | 7e15b0c9991dfe0bf05a2f8fab9154bb7827622e (diff) |
be2net: Changes to update ethtool get_settings function to return appropriate values.
Update ethtool get_settings function to:
- get current link speed settings from controller
- get port transceiver type from controller
- fill appropriate values for supported, phy_address
Signed-off-by: Sarveshwar Bandi <sarveshwarb@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_ethtool.c')
-rw-r--r-- | drivers/net/benet/be_ethtool.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c index 280471e18695..edebce994906 100644 --- a/drivers/net/benet/be_ethtool.c +++ b/drivers/net/benet/be_ethtool.c | |||
@@ -293,9 +293,43 @@ static int be_get_sset_count(struct net_device *netdev, int stringset) | |||
293 | 293 | ||
294 | static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | 294 | static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) |
295 | { | 295 | { |
296 | ecmd->speed = SPEED_10000; | 296 | struct be_adapter *adapter = netdev_priv(netdev); |
297 | u8 mac_speed = 0, connector = 0; | ||
298 | u16 link_speed = 0; | ||
299 | bool link_up = false; | ||
300 | |||
301 | be_cmd_link_status_query(adapter, &link_up, &mac_speed, &link_speed); | ||
302 | |||
303 | /* link_speed is in units of 10 Mbps */ | ||
304 | if (link_speed) { | ||
305 | ecmd->speed = link_speed*10; | ||
306 | } else { | ||
307 | switch (mac_speed) { | ||
308 | case PHY_LINK_SPEED_1GBPS: | ||
309 | ecmd->speed = SPEED_1000; | ||
310 | break; | ||
311 | case PHY_LINK_SPEED_10GBPS: | ||
312 | ecmd->speed = SPEED_10000; | ||
313 | break; | ||
314 | } | ||
315 | } | ||
297 | ecmd->duplex = DUPLEX_FULL; | 316 | ecmd->duplex = DUPLEX_FULL; |
298 | ecmd->autoneg = AUTONEG_DISABLE; | 317 | ecmd->autoneg = AUTONEG_DISABLE; |
318 | ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_TP); | ||
319 | |||
320 | be_cmd_read_port_type(adapter, adapter->port_num, &connector); | ||
321 | switch (connector) { | ||
322 | case 7: | ||
323 | ecmd->port = PORT_FIBRE; | ||
324 | break; | ||
325 | default: | ||
326 | ecmd->port = PORT_TP; | ||
327 | break; | ||
328 | } | ||
329 | |||
330 | ecmd->phy_address = adapter->port_num; | ||
331 | ecmd->transceiver = XCVR_INTERNAL; | ||
332 | |||
299 | return 0; | 333 | return 0; |
300 | } | 334 | } |
301 | 335 | ||