Skip to content

Commit 55f1331

Browse files
Dan Murphydavem330
Dan Murphy
authored andcommitted
ethtool: Add 100base-FX link mode entries
Add entries for the 100base-FX full and half duplex supported modes. $ ethtool eth0 Supported ports: [ FIBRE ] Supported link modes: 100baseFX/Half 100baseFX/Full Supported pause frame use: Symmetric Receive-only Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: 100baseFX/Half 100baseFX/Full Advertised pause frame use: No Advertised auto-negotiation: No Advertised FEC modes: Not reported Speed: 100Mb/s Duplex: Full Auto-negotiation: off Port: MII PHYAD: 1 Transceiver: external Supports Wake-on: gs Wake-on: d SecureOn password: 00:00:00:00:00:00 Current message level: 0x00000000 (0) Link detected: yes Signed-off-by: Dan Murphy <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0959972 commit 55f1331

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

drivers/net/phy/phy-core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
const char *phy_speed_to_str(int speed)
1010
{
11-
BUILD_BUG_ON_MSG(__ETHTOOL_LINK_MODE_MASK_NBITS != 90,
11+
BUILD_BUG_ON_MSG(__ETHTOOL_LINK_MODE_MASK_NBITS != 92,
1212
"Enum ethtool_link_mode_bit_indices and phylib are out of sync. "
1313
"If a speed or mode has been added please update phy_speed_to_str "
1414
"and the PHY settings array.\n");
@@ -160,6 +160,8 @@ static const struct phy_setting settings[] = {
160160
PHY_SETTING( 100, FULL, 100baseT_Full ),
161161
PHY_SETTING( 100, FULL, 100baseT1_Full ),
162162
PHY_SETTING( 100, HALF, 100baseT_Half ),
163+
PHY_SETTING( 100, HALF, 100baseFX_Half ),
164+
PHY_SETTING( 100, FULL, 100baseFX_Full ),
163165
/* 10M */
164166
PHY_SETTING( 10, FULL, 10baseT_Full ),
165167
PHY_SETTING( 10, HALF, 10baseT_Half ),

include/uapi/linux/ethtool.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,6 +1617,8 @@ enum ethtool_link_mode_bit_indices {
16171617
ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT = 87,
16181618
ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT = 88,
16191619
ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 89,
1620+
ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 90,
1621+
ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 91,
16201622
/* must be last entry */
16211623
__ETHTOOL_LINK_MODE_MASK_NBITS
16221624
};

net/ethtool/common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ const char link_mode_names[][ETH_GSTRING_LEN] = {
192192
__DEFINE_LINK_MODE_NAME(400000, LR4_ER4_FR4, Full),
193193
__DEFINE_LINK_MODE_NAME(400000, DR4, Full),
194194
__DEFINE_LINK_MODE_NAME(400000, CR4, Full),
195+
__DEFINE_LINK_MODE_NAME(100, FX, Half),
196+
__DEFINE_LINK_MODE_NAME(100, FX, Full),
195197
};
196198
static_assert(ARRAY_SIZE(link_mode_names) == __ETHTOOL_LINK_MODE_MASK_NBITS);
197199

net/ethtool/linkmodes.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ static const struct link_mode_info link_mode_params[] = {
272272
__DEFINE_LINK_MODE_PARAMS(400000, LR4_ER4_FR4, Full),
273273
__DEFINE_LINK_MODE_PARAMS(400000, DR4, Full),
274274
__DEFINE_LINK_MODE_PARAMS(400000, CR4, Full),
275+
__DEFINE_LINK_MODE_PARAMS(100, FX, Half),
276+
__DEFINE_LINK_MODE_PARAMS(100, FX, Full),
275277
};
276278

277279
static const struct nla_policy

0 commit comments

Comments
 (0)