diff options
author | Sarveshwar Bandi <sarveshwarb@serverengines.com> | 2009-12-22 23:42:51 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-23 23:58:14 -0500 |
commit | 16c02145902d8597841a25e8443cfb082898a2d7 (patch) | |
tree | 2dcc01a8ed5383c599520f5c11b15f4a40c8e0ca /drivers/net/benet | |
parent | fced9999ed7f6975fbb2350a73048918ba60a773 (diff) |
be2net: Bug fix to return correct values in ethtool get_settings.
Changes to return correct values for transceiver and supported in
ethtool get_settings function.
Signed-off-by: Sarveshwar Bandi <sarveshwarb@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r-- | drivers/net/benet/be.h | 1 | ||||
-rw-r--r-- | drivers/net/benet/be_ethtool.c | 40 |
2 files changed, 32 insertions, 9 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index 9e56014d27ed..9fd8e5ecd5d7 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -275,6 +275,7 @@ struct be_adapter { | |||
275 | u32 tx_fc; /* Tx flow control */ | 275 | u32 tx_fc; /* Tx flow control */ |
276 | int link_speed; | 276 | int link_speed; |
277 | u8 port_type; | 277 | u8 port_type; |
278 | u8 transceiver; | ||
278 | }; | 279 | }; |
279 | 280 | ||
280 | extern const struct ethtool_ops be_ethtool_ops; | 281 | extern const struct ethtool_ops be_ethtool_ops; |
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c index da66d15e2223..5d001c4deac1 100644 --- a/drivers/net/benet/be_ethtool.c +++ b/drivers/net/benet/be_ethtool.c | |||
@@ -340,28 +340,50 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
340 | 340 | ||
341 | status = be_cmd_read_port_type(adapter, adapter->port_num, | 341 | status = be_cmd_read_port_type(adapter, adapter->port_num, |
342 | &connector); | 342 | &connector); |
343 | switch (connector) { | 343 | if (!status) { |
344 | case 7: | 344 | switch (connector) { |
345 | ecmd->port = PORT_FIBRE; | 345 | case 7: |
346 | break; | 346 | ecmd->port = PORT_FIBRE; |
347 | default: | 347 | ecmd->transceiver = XCVR_EXTERNAL; |
348 | ecmd->port = PORT_TP; | 348 | break; |
349 | break; | 349 | case 0: |
350 | ecmd->port = PORT_TP; | ||
351 | ecmd->transceiver = XCVR_EXTERNAL; | ||
352 | break; | ||
353 | default: | ||
354 | ecmd->port = PORT_TP; | ||
355 | ecmd->transceiver = XCVR_INTERNAL; | ||
356 | break; | ||
357 | } | ||
358 | } else { | ||
359 | ecmd->port = PORT_AUI; | ||
360 | ecmd->transceiver = XCVR_INTERNAL; | ||
350 | } | 361 | } |
351 | 362 | ||
352 | /* Save for future use */ | 363 | /* Save for future use */ |
353 | adapter->link_speed = ecmd->speed; | 364 | adapter->link_speed = ecmd->speed; |
354 | adapter->port_type = ecmd->port; | 365 | adapter->port_type = ecmd->port; |
366 | adapter->transceiver = ecmd->transceiver; | ||
355 | } else { | 367 | } else { |
356 | ecmd->speed = adapter->link_speed; | 368 | ecmd->speed = adapter->link_speed; |
357 | ecmd->port = adapter->port_type; | 369 | ecmd->port = adapter->port_type; |
370 | ecmd->transceiver = adapter->transceiver; | ||
358 | } | 371 | } |
359 | 372 | ||
360 | ecmd->duplex = DUPLEX_FULL; | 373 | ecmd->duplex = DUPLEX_FULL; |
361 | ecmd->autoneg = AUTONEG_DISABLE; | 374 | ecmd->autoneg = AUTONEG_DISABLE; |
362 | ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_TP); | ||
363 | ecmd->phy_address = adapter->port_num; | 375 | ecmd->phy_address = adapter->port_num; |
364 | ecmd->transceiver = XCVR_INTERNAL; | 376 | switch (ecmd->port) { |
377 | case PORT_FIBRE: | ||
378 | ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE); | ||
379 | break; | ||
380 | case PORT_TP: | ||
381 | ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_TP); | ||
382 | break; | ||
383 | case PORT_AUI: | ||
384 | ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_AUI); | ||
385 | break; | ||
386 | } | ||
365 | 387 | ||
366 | return 0; | 388 | return 0; |
367 | } | 389 | } |