summaryrefslogtreecommitdiff
path: root/drivers/s390/net/qeth_ethtool.c
diff options
context:
space:
mode:
authorJulian Wiedmann <jwi@linux.ibm.com>2020-11-17 17:15:17 +0100
committerJakub Kicinski <kuba@kernel.org>2020-11-18 17:34:19 -0800
commitbaf7998d5f2116ab991236ac0d67f7021dc2ae55 (patch)
tree5766f49f6a90e370fe3c49e35f68d50a9bc9b06c /drivers/s390/net/qeth_ethtool.c
parent4139b2b138dd44ca215976a06846839774ca7cd4 (diff)
s390/qeth: set static link info during initialization
Hard-code the minimal link info at initialization time, after we obtained the link_type. qeth_get_link_ksettings() can still override this with more accurate data from QUERY CARD INFO later on. Don't set arbitrary defaults for unknown OSA link types, they certainly won't match any future type. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/s390/net/qeth_ethtool.c')
-rw-r--r--drivers/s390/net/qeth_ethtool.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/drivers/s390/net/qeth_ethtool.c b/drivers/s390/net/qeth_ethtool.c
index a6455819f403..b8e74018b44f 100644
--- a/drivers/s390/net/qeth_ethtool.c
+++ b/drivers/s390/net/qeth_ethtool.c
@@ -410,44 +410,16 @@ static int qeth_get_link_ksettings(struct net_device *netdev,
{
struct qeth_card *card = netdev->ml_priv;
struct qeth_link_info link_info;
- enum qeth_link_types link_type;
- if (IS_IQD(card) || IS_VM_NIC(card))
- link_type = QETH_LINK_TYPE_10GBIT_ETH;
- else
- link_type = card->info.link_type;
-
- cmd->base.duplex = DUPLEX_FULL;
+ cmd->base.speed = card->info.link_info.speed;
+ cmd->base.duplex = card->info.link_info.duplex;
+ cmd->base.port = card->info.link_info.port;
cmd->base.autoneg = AUTONEG_ENABLE;
cmd->base.phy_address = 0;
cmd->base.mdio_support = 0;
cmd->base.eth_tp_mdix = ETH_TP_MDI_INVALID;
cmd->base.eth_tp_mdix_ctrl = ETH_TP_MDI_INVALID;
- switch (link_type) {
- case QETH_LINK_TYPE_FAST_ETH:
- case QETH_LINK_TYPE_LANE_ETH100:
- cmd->base.speed = SPEED_100;
- cmd->base.port = PORT_TP;
- break;
- case QETH_LINK_TYPE_GBIT_ETH:
- case QETH_LINK_TYPE_LANE_ETH1000:
- cmd->base.speed = SPEED_1000;
- cmd->base.port = PORT_FIBRE;
- break;
- case QETH_LINK_TYPE_10GBIT_ETH:
- cmd->base.speed = SPEED_10000;
- cmd->base.port = PORT_FIBRE;
- break;
- case QETH_LINK_TYPE_25GBIT_ETH:
- cmd->base.speed = SPEED_25000;
- cmd->base.port = PORT_FIBRE;
- break;
- default:
- cmd->base.speed = SPEED_10;
- cmd->base.port = PORT_TP;
- }
-
/* Check if we can obtain more accurate information. */
if (!qeth_query_card_info(card, &link_info)) {
if (link_info.speed != SPEED_UNKNOWN)