Add 100BaseT1 and 1000BaseT1
Subsystems (2)
v2 cover Add 100BaseT1 and 1000BaseT1
Import the latest ethtool.h and add two new links modes.
v2:
Move the new speeds to the end of the all_advertised_modes_bits[]. Remove the same_line bit for the new moved
Add the new modes to the man page.
Andrew Lunn (2):
ethtool: sync ethtool-copy.h with linux-next from 30/05/2019
ethtool: Add 100BaseT1 and 1000BaseT1 link modes
ethtool-copy.h | 7 ++++++- ethtool.8.in | 2 ++ ethtool.c | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-)
Signature · 1 line
2.20.1
PATCH v2 2/2 ethtool: Add 100BaseT1 and 1000BaseT1 link modes
The kernel can now indicate if the PHY supports operating over a single pair at 100Mbps or 1000Mbps.
--- ethtool.8.in | 2 ++ ethtool.c | 6 ++++++ 2 files changed, 8 insertions(+)
ethtool.8.in +2 -0
@@ -639,8 +639,10 @@ lB l lB. 0x002 10baseT Full 0x004 100baseT Half 0x008 100baseT Full +0x80000000000000000 100baseT1 Full 0x010 1000baseT Half (not supported by IEEE standards) 0x020 1000baseT Full +0x100000000000000000 1000baseT1 Full 0x20000 1000baseKX Full 0x20000000000 1000baseX Full 0x800000000000 2500baseT Full
ethtool.c +6 -0
@@ -545,6 +545,8 @@ static void init_global_link_mode_masks(void) ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT, ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT, ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT, + ETHTOOL_LINK_MODE_100baseT1_Full_BIT, + ETHTOOL_LINK_MODE_1000baseT1_Full_BIT, };static const enum ethtool_link_mode_bit_indices additional_advertised_flags_bits[] = {
@@ -634,10 +636,14 @@ static void dump_link_caps(const char *prefix, const char *an_prefix, "100baseT/Half" }, {1 , ETHTOOL_LINK_MODE_100baseT_Full_BIT, "100baseT/Full" }, + { 0, ETHTOOL_LINK_MODE_100baseT1_Full_BIT, + "100baseT1/Full" }, { 0, ETHTOOL_LINK_MODE_1000baseT_Half_BIT, "1000baseT/Half" }, { 1, ETHTOOL_LINK_MODE_1000baseT_Full_BIT, "1000baseT/Full" }, + { 0, ETHTOOL_LINK_MODE_1000baseT1_Full_BIT, + "1000baseT1/Full" }, { 0, ETHTOOL_LINK_MODE_1000baseKX_Full_BIT, "1000baseKX/Full" }, { 0, ETHTOOL_LINK_MODE_2500baseX_Full_BIT,
Signature · 1 line
2.20.1
PATCH v2 1/2 ethtool: sync ethtool-copy.h with linux-next from 30/05/2019
In reply to Andrew LunnSync ethtool-copy.h with linux-next from 22/05/2019. This provides access to the new link modes for 100BaseT1 and 1000BaseT1.
--- ethtool-copy.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
ethtool-copy.h +6 -1
@@ -1481,6 +1481,8 @@ enum ethtool_link_mode_bit_indices { ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT =64 , ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT =65 , ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT =66 , + ETHTOOL_LINK_MODE_100baseT1_Full_BIT =67 , + ETHTOOL_LINK_MODE_1000baseT1_Full_BIT =68 ,/* must be last entry */ __ETHTOOL_LINK_MODE_MASK_NBITS
@@ -1597,7 +1599,7 @@ enum ethtool_link_mode_bit_indices {static __inline__int ethtool_validate_speed (__u32 speed) { -return speed <=INT_MAX || speed ==SPEED_UNKNOWN ; +return speed <=INT_MAX || speed == (__u32 )SPEED_UNKNOWN ; }/* Duplex, half or full. */
@@ -1710,6 +1712,9 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)#define ETH_MODULE_SFF_8436 0x4#define ETH_MODULE_SFF_8436_LEN 256 +#define ETH_MODULE_SFF_8636_MAX_LEN 640 +#define ETH_MODULE_SFF_8436_MAX_LEN 640 +/* Reset flags */ /* The reset() operation must clear the flags for the components which * were actually reset. On successful return, the flags indicate the
Signature · 1 line
2.20.1
Re: [PATCH v2 2/2] ethtool: Add 100BaseT1 and 1000BaseT1 link modes
In reply to Andrew LunnQuoted 5 lines · Andrew Lunn
The kernel can now indicate if the PHY supports operating over a single pair at 100Mbps or 1000Mbps.
Signed-off-by Andrew Lunn <[email protected]>---
Quoted 9 lines
ethtool.8.in | 2 ++ ethtool.c | 6 ++++++ 2 files changed, 8 insertions(+)ethtool.8.in +0
-0
ethtool.8.in lB l lB. · line 648
Quoted 10 lines
ethtool.8.in +2
-0@@ -639,8 +639,10 @@ lB l lB. 0x002 10baseT Full 0x004 100baseT Half 0x008 100baseT Full +0x80000000000000000 100baseT1 Full 0x010 1000baseT Half (not supported by IEEE standards) 0x020 1000baseT Full +0x100000000000000000 1000baseT1 Full 0x20000 1000baseKX Full 0x20000000000 1000baseX Full 0x800000000000 2500baseT Full
This reminds me the earlier discussion about which syntax extension would be more useful:
ethtool -s <dev> advertise 100baseT1/Full 1000baseT1/Full
(listing modes to be advertised) or
ethtool -s <dev> advertise 100baseT1/Full off 1000baseT1/Full on
(enabling/disabling selected modes). But maybe we could support both; after all, it's unlikely there would ever be a link mode named "on" or "off".
Michal
Re: [PATCH v2 1/2] ethtool: sync ethtool-copy.h with linux-next from 30/05/2019
In reply to Andrew LunnQuoted 5 lines · Andrew Lunn
Sync
ethtool-copy.hwith linux-next from 22/05/2019. This provides access to the new link modes for 100BaseT1 and 1000BaseT1.Signed-off-by Andrew Lunn <[email protected]>---
BtW, this differs from the file "make headers_install" produces in net-next but only in white space so that it doesn't really matter and it gets sorted in a future sync.
Quoted 38 lines
ethtool-copy.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)ethtool-copy.h +6
-1@@ -1481,6 +1481,8 @@ enum ethtool_link_mode_bit_indices { ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT =64 , ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT =65 , ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT =66 , + ETHTOOL_LINK_MODE_100baseT1_Full_BIT =67 , + ETHTOOL_LINK_MODE_1000baseT1_Full_BIT =68 ,/* must be last entry */ __ETHTOOL_LINK_MODE_MASK_NBITS@@ -1597,7 +1599,7 @@ enum ethtool_link_mode_bit_indices {static __inline__int ethtool_validate_speed (__u32 speed) { -return speed <=INT_MAX || speed ==SPEED_UNKNOWN ; +return speed <=INT_MAX || speed == (__u32 )SPEED_UNKNOWN ; }/* Duplex, half or full. */ @@ -1710,6 +1712,9 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)#define ETH_MODULE_SFF_8436 0x4#define ETH_MODULE_SFF_8436_LEN 256 +#define ETH_MODULE_SFF_8636_MAX_LEN 640 +#define ETH_MODULE_SFF_8436_MAX_LEN 640 +/* Reset flags */ /* The reset() operation must clear the flags for the components which * were actually reset. On successful return, the flags indicate the Signature · 1 line
2.20.1
Re: [PATCH v2 1/2] ethtool: sync ethtool-copy.h with linux-next from 30/05/2019
Quoted 5 lines
Reviewed-by Michal Kubecek <[email protected]>BtW, this differs from the file "make
headers_install" produces in net-next but only in white space so that it doesn't really matter and it gets sorted in a future sync.
Yes, there is something odd going on. It looks like two tabs have been converted to spaces in the ethtool copy. I left them alone, since i did not add them.
Andrew
Quoted 7 lines · Andrew Lunn
Import the latest
ethtool.hand add two new links modes.v2:
Move the new speeds to the end of the all_advertised_modes_bits[]. Remove thesame_linebit for the new moved
Add the new modes to the man page.
Quoted 8 lines
Andrew Lunn (2):
ethtool: syncethtool-copy.hwith linux-next from 30/05/2019
ethtool: Add 100BaseT1 and 1000BaseT1 link modesethtool-copy.h | 7 ++++++- ethtool.8.in | 2 ++ ethtool.c | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-)
Thanks for the patches! Queued for next release...
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.