diff options
author | Frank Blaschka <frank.blaschka@de.ibm.com> | 2008-04-24 04:15:23 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-29 01:56:31 -0400 |
commit | 3f9975aa4d5b3c614eef8785ec63da13fbd55b51 (patch) | |
tree | a9c7fa28d5dc83b5911b6d4b86285c3b7558dd4d /drivers | |
parent | 213298f862d10ade909bdb7d833493d4bdad683d (diff) |
qeth: provide get ethtool settings
Load balancing bonding queries the speed of the slave interfaces.
To support a bond consisting of different slave speeds we have to
report the speed by ethtool settings.
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/net/qeth_core.h | 1 | ||||
-rw-r--r-- | drivers/s390/net/qeth_core_main.c | 90 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l2_main.c | 1 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 1 |
4 files changed, 93 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index b7bb0ff87c14..8dd83d920981 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h | |||
@@ -880,6 +880,7 @@ void qeth_core_get_ethtool_stats(struct net_device *, | |||
880 | void qeth_core_get_strings(struct net_device *, u32, u8 *); | 880 | void qeth_core_get_strings(struct net_device *, u32, u8 *); |
881 | void qeth_core_get_drvinfo(struct net_device *, struct ethtool_drvinfo *); | 881 | void qeth_core_get_drvinfo(struct net_device *, struct ethtool_drvinfo *); |
882 | void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *text, ...); | 882 | void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *text, ...); |
883 | int qeth_core_ethtool_get_settings(struct net_device *, struct ethtool_cmd *); | ||
883 | 884 | ||
884 | /* exports for OSN */ | 885 | /* exports for OSN */ |
885 | int qeth_osn_assist(struct net_device *, void *, int); | 886 | int qeth_osn_assist(struct net_device *, void *, int); |
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 18323250a339..23a46340ffaa 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -4423,6 +4423,96 @@ void qeth_core_get_drvinfo(struct net_device *dev, | |||
4423 | } | 4423 | } |
4424 | EXPORT_SYMBOL_GPL(qeth_core_get_drvinfo); | 4424 | EXPORT_SYMBOL_GPL(qeth_core_get_drvinfo); |
4425 | 4425 | ||
4426 | int qeth_core_ethtool_get_settings(struct net_device *netdev, | ||
4427 | struct ethtool_cmd *ecmd) | ||
4428 | { | ||
4429 | struct qeth_card *card = netdev_priv(netdev); | ||
4430 | enum qeth_link_types link_type; | ||
4431 | |||
4432 | if ((card->info.type == QETH_CARD_TYPE_IQD) || (card->info.guestlan)) | ||
4433 | link_type = QETH_LINK_TYPE_10GBIT_ETH; | ||
4434 | else | ||
4435 | link_type = card->info.link_type; | ||
4436 | |||
4437 | ecmd->transceiver = XCVR_INTERNAL; | ||
4438 | ecmd->supported = SUPPORTED_Autoneg; | ||
4439 | ecmd->advertising = ADVERTISED_Autoneg; | ||
4440 | ecmd->duplex = DUPLEX_FULL; | ||
4441 | ecmd->autoneg = AUTONEG_ENABLE; | ||
4442 | |||
4443 | switch (link_type) { | ||
4444 | case QETH_LINK_TYPE_FAST_ETH: | ||
4445 | case QETH_LINK_TYPE_LANE_ETH100: | ||
4446 | ecmd->supported |= SUPPORTED_10baseT_Half | | ||
4447 | SUPPORTED_10baseT_Full | | ||
4448 | SUPPORTED_100baseT_Half | | ||
4449 | SUPPORTED_100baseT_Full | | ||
4450 | SUPPORTED_TP; | ||
4451 | ecmd->advertising |= ADVERTISED_10baseT_Half | | ||
4452 | ADVERTISED_10baseT_Full | | ||
4453 | ADVERTISED_100baseT_Half | | ||
4454 | ADVERTISED_100baseT_Full | | ||
4455 | ADVERTISED_TP; | ||
4456 | ecmd->speed = SPEED_100; | ||
4457 | ecmd->port = PORT_TP; | ||
4458 | break; | ||
4459 | |||
4460 | case QETH_LINK_TYPE_GBIT_ETH: | ||
4461 | case QETH_LINK_TYPE_LANE_ETH1000: | ||
4462 | ecmd->supported |= SUPPORTED_10baseT_Half | | ||
4463 | SUPPORTED_10baseT_Full | | ||
4464 | SUPPORTED_100baseT_Half | | ||
4465 | SUPPORTED_100baseT_Full | | ||
4466 | SUPPORTED_1000baseT_Half | | ||
4467 | SUPPORTED_1000baseT_Full | | ||
4468 | SUPPORTED_FIBRE; | ||
4469 | ecmd->advertising |= ADVERTISED_10baseT_Half | | ||
4470 | ADVERTISED_10baseT_Full | | ||
4471 | ADVERTISED_100baseT_Half | | ||
4472 | ADVERTISED_100baseT_Full | | ||
4473 | ADVERTISED_1000baseT_Half | | ||
4474 | ADVERTISED_1000baseT_Full | | ||
4475 | ADVERTISED_FIBRE; | ||
4476 | ecmd->speed = SPEED_1000; | ||
4477 | ecmd->port = PORT_FIBRE; | ||
4478 | break; | ||
4479 | |||
4480 | case QETH_LINK_TYPE_10GBIT_ETH: | ||
4481 | ecmd->supported |= SUPPORTED_10baseT_Half | | ||
4482 | SUPPORTED_10baseT_Full | | ||
4483 | SUPPORTED_100baseT_Half | | ||
4484 | SUPPORTED_100baseT_Full | | ||
4485 | SUPPORTED_1000baseT_Half | | ||
4486 | SUPPORTED_1000baseT_Full | | ||
4487 | SUPPORTED_10000baseT_Full | | ||
4488 | SUPPORTED_FIBRE; | ||
4489 | ecmd->advertising |= ADVERTISED_10baseT_Half | | ||
4490 | ADVERTISED_10baseT_Full | | ||
4491 | ADVERTISED_100baseT_Half | | ||
4492 | ADVERTISED_100baseT_Full | | ||
4493 | ADVERTISED_1000baseT_Half | | ||
4494 | ADVERTISED_1000baseT_Full | | ||
4495 | ADVERTISED_10000baseT_Full | | ||
4496 | ADVERTISED_FIBRE; | ||
4497 | ecmd->speed = SPEED_10000; | ||
4498 | ecmd->port = PORT_FIBRE; | ||
4499 | break; | ||
4500 | |||
4501 | default: | ||
4502 | ecmd->supported |= SUPPORTED_10baseT_Half | | ||
4503 | SUPPORTED_10baseT_Full | | ||
4504 | SUPPORTED_TP; | ||
4505 | ecmd->advertising |= ADVERTISED_10baseT_Half | | ||
4506 | ADVERTISED_10baseT_Full | | ||
4507 | ADVERTISED_TP; | ||
4508 | ecmd->speed = SPEED_10; | ||
4509 | ecmd->port = PORT_TP; | ||
4510 | } | ||
4511 | |||
4512 | return 0; | ||
4513 | } | ||
4514 | EXPORT_SYMBOL_GPL(qeth_core_ethtool_get_settings); | ||
4515 | |||
4426 | static int __init qeth_core_init(void) | 4516 | static int __init qeth_core_init(void) |
4427 | { | 4517 | { |
4428 | int rc; | 4518 | int rc; |
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 7e8f63965098..e6092829a5a9 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -861,6 +861,7 @@ static struct ethtool_ops qeth_l2_ethtool_ops = { | |||
861 | .get_ethtool_stats = qeth_core_get_ethtool_stats, | 861 | .get_ethtool_stats = qeth_core_get_ethtool_stats, |
862 | .get_stats_count = qeth_core_get_stats_count, | 862 | .get_stats_count = qeth_core_get_stats_count, |
863 | .get_drvinfo = qeth_core_get_drvinfo, | 863 | .get_drvinfo = qeth_core_get_drvinfo, |
864 | .get_settings = qeth_core_ethtool_get_settings, | ||
864 | }; | 865 | }; |
865 | 866 | ||
866 | static struct ethtool_ops qeth_l2_osn_ops = { | 867 | static struct ethtool_ops qeth_l2_osn_ops = { |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index f385e93d757a..ce23169587e4 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -2889,6 +2889,7 @@ static struct ethtool_ops qeth_l3_ethtool_ops = { | |||
2889 | .get_ethtool_stats = qeth_core_get_ethtool_stats, | 2889 | .get_ethtool_stats = qeth_core_get_ethtool_stats, |
2890 | .get_stats_count = qeth_core_get_stats_count, | 2890 | .get_stats_count = qeth_core_get_stats_count, |
2891 | .get_drvinfo = qeth_core_get_drvinfo, | 2891 | .get_drvinfo = qeth_core_get_drvinfo, |
2892 | .get_settings = qeth_core_ethtool_get_settings, | ||
2892 | }; | 2893 | }; |
2893 | 2894 | ||
2894 | /* | 2895 | /* |