Commit 54e049c2 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: report 25Gbit link speed

This adds the various identifiers for 25Gbit cards, and wires them up
into sysfs and ethtool.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 125d7d30
...@@ -167,6 +167,8 @@ const char *qeth_get_cardname_short(struct qeth_card *card) ...@@ -167,6 +167,8 @@ const char *qeth_get_cardname_short(struct qeth_card *card)
return "OSD_1000"; return "OSD_1000";
case QETH_LINK_TYPE_10GBIT_ETH: case QETH_LINK_TYPE_10GBIT_ETH:
return "OSD_10GIG"; return "OSD_10GIG";
case QETH_LINK_TYPE_25GBIT_ETH:
return "OSD_25GIG";
case QETH_LINK_TYPE_LANE_ETH100: case QETH_LINK_TYPE_LANE_ETH100:
return "OSD_FE_LANE"; return "OSD_FE_LANE";
case QETH_LINK_TYPE_LANE_TR: case QETH_LINK_TYPE_LANE_TR:
...@@ -4432,7 +4434,8 @@ static int qeth_mdio_read(struct net_device *dev, int phy_id, int regnum) ...@@ -4432,7 +4434,8 @@ static int qeth_mdio_read(struct net_device *dev, int phy_id, int regnum)
rc = BMCR_FULLDPLX; rc = BMCR_FULLDPLX;
if ((card->info.link_type != QETH_LINK_TYPE_GBIT_ETH) && if ((card->info.link_type != QETH_LINK_TYPE_GBIT_ETH) &&
(card->info.link_type != QETH_LINK_TYPE_OSN) && (card->info.link_type != QETH_LINK_TYPE_OSN) &&
(card->info.link_type != QETH_LINK_TYPE_10GBIT_ETH)) (card->info.link_type != QETH_LINK_TYPE_10GBIT_ETH) &&
(card->info.link_type != QETH_LINK_TYPE_25GBIT_ETH))
rc |= BMCR_SPEED100; rc |= BMCR_SPEED100;
break; break;
case MII_BMSR: /* Basic mode status register */ case MII_BMSR: /* Basic mode status register */
...@@ -6166,8 +6169,14 @@ static void qeth_set_cmd_adv_sup(struct ethtool_link_ksettings *cmd, ...@@ -6166,8 +6169,14 @@ static void qeth_set_cmd_adv_sup(struct ethtool_link_ksettings *cmd,
WARN_ON_ONCE(1); WARN_ON_ONCE(1);
} }
/* fallthrough from high to low, to select all legal speeds: */ /* partially does fall through, to also select lower speeds */
switch (maxspeed) { switch (maxspeed) {
case SPEED_25000:
ethtool_link_ksettings_add_link_mode(cmd, supported,
25000baseSR_Full);
ethtool_link_ksettings_add_link_mode(cmd, advertising,
25000baseSR_Full);
break;
case SPEED_10000: case SPEED_10000:
ethtool_link_ksettings_add_link_mode(cmd, supported, ethtool_link_ksettings_add_link_mode(cmd, supported,
10000baseT_Full); 10000baseT_Full);
...@@ -6250,6 +6259,10 @@ int qeth_core_ethtool_get_link_ksettings(struct net_device *netdev, ...@@ -6250,6 +6259,10 @@ int qeth_core_ethtool_get_link_ksettings(struct net_device *netdev,
cmd->base.speed = SPEED_10000; cmd->base.speed = SPEED_10000;
cmd->base.port = PORT_FIBRE; cmd->base.port = PORT_FIBRE;
break; break;
case QETH_LINK_TYPE_25GBIT_ETH:
cmd->base.speed = SPEED_25000;
cmd->base.port = PORT_FIBRE;
break;
default: default:
cmd->base.speed = SPEED_10; cmd->base.speed = SPEED_10;
cmd->base.port = PORT_TP; cmd->base.port = PORT_TP;
...@@ -6316,6 +6329,9 @@ int qeth_core_ethtool_get_link_ksettings(struct net_device *netdev, ...@@ -6316,6 +6329,9 @@ int qeth_core_ethtool_get_link_ksettings(struct net_device *netdev,
case CARD_INFO_PORTS_10G: case CARD_INFO_PORTS_10G:
cmd->base.speed = SPEED_10000; cmd->base.speed = SPEED_10000;
break; break;
case CARD_INFO_PORTS_25G:
cmd->base.speed = SPEED_25000;
break;
} }
return 0; return 0;
......
...@@ -90,6 +90,7 @@ enum qeth_link_types { ...@@ -90,6 +90,7 @@ enum qeth_link_types {
QETH_LINK_TYPE_GBIT_ETH = 0x03, QETH_LINK_TYPE_GBIT_ETH = 0x03,
QETH_LINK_TYPE_OSN = 0x04, QETH_LINK_TYPE_OSN = 0x04,
QETH_LINK_TYPE_10GBIT_ETH = 0x10, QETH_LINK_TYPE_10GBIT_ETH = 0x10,
QETH_LINK_TYPE_25GBIT_ETH = 0x12,
QETH_LINK_TYPE_LANE_ETH100 = 0x81, QETH_LINK_TYPE_LANE_ETH100 = 0x81,
QETH_LINK_TYPE_LANE_TR = 0x82, QETH_LINK_TYPE_LANE_TR = 0x82,
QETH_LINK_TYPE_LANE_ETH1000 = 0x83, QETH_LINK_TYPE_LANE_ETH1000 = 0x83,
...@@ -347,6 +348,7 @@ enum qeth_card_info_port_speed { ...@@ -347,6 +348,7 @@ enum qeth_card_info_port_speed {
CARD_INFO_PORTS_100M = 0x00000006, CARD_INFO_PORTS_100M = 0x00000006,
CARD_INFO_PORTS_1G = 0x00000007, CARD_INFO_PORTS_1G = 0x00000007,
CARD_INFO_PORTS_10G = 0x00000008, CARD_INFO_PORTS_10G = 0x00000008,
CARD_INFO_PORTS_25G = 0x0000000A,
}; };
/* (SET)DELIP(M) IPA stuff ***************************************************/ /* (SET)DELIP(M) IPA stuff ***************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment