All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Adding 100base FX support
@ 2020-09-14 17:06 Dan Murphy
  2020-09-14 17:06 ` [PATCH 1/1] ethtool: Add 100BaseFX half and full duplex link modes Dan Murphy
  2020-09-14 23:17 ` [PATCH 0/1] Adding 100base FX support Michal Kubecek
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Murphy @ 2020-09-14 17:06 UTC (permalink / raw)
  To: mkubecek; +Cc: netdev, Dan Murphy

Hello

I am adding the 100base Fx support for the ethtool.  There are a few PHYs that
support the Fiber connection and the ethtool should be able to properly display
that the PHY supports the 100base-FX Full and Half Duplex modes.

I am adding this support in the ethtool first and then submit the fiber bits
into the kernel.

If the kernel needs to be updated first then I can prepare those patches and
reference them.

Dan

Dan Murphy (1):
  ethtool: Add 100BaseFX half and full duplex link modes

 ethtool.c            | 6 ++++++
 netlink/settings.c   | 2 ++
 uapi/linux/ethtool.h | 2 ++
 3 files changed, 10 insertions(+)

-- 
2.28.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] ethtool: Add 100BaseFX half and full duplex link modes
  2020-09-14 17:06 [PATCH 0/1] Adding 100base FX support Dan Murphy
@ 2020-09-14 17:06 ` Dan Murphy
  2020-09-14 23:17 ` [PATCH 0/1] Adding 100base FX support Michal Kubecek
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Murphy @ 2020-09-14 17:06 UTC (permalink / raw)
  To: mkubecek; +Cc: netdev, Dan Murphy

The kernel can now indicate if the PHY supports operating over a
fiber cable at 100Mbps either Full or Half duplex.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 ethtool.c            | 6 ++++++
 netlink/settings.c   | 2 ++
 uapi/linux/ethtool.h | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/ethtool.c b/ethtool.c
index 606af3e6b48f..84ad21467206 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -443,6 +443,8 @@ static void init_global_link_mode_masks(void)
 		ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT,
 		ETHTOOL_LINK_MODE_100baseT1_Full_BIT,
 		ETHTOOL_LINK_MODE_1000baseT1_Full_BIT,
+		ETHTOOL_LINK_MODE_100baseFX_Half_BIT,
+		ETHTOOL_LINK_MODE_100baseFX_Full_BIT,
 	};
 	static const enum ethtool_link_mode_bit_indices
 		additional_advertised_flags_bits[] = {
@@ -639,6 +641,10 @@ static void dump_link_caps(const char *prefix, const char *an_prefix,
 		  "200000baseDR4/Full" },
 		{ 0, ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT,
 		  "200000baseCR4/Full" },
+		{ 0, ETHTOOL_LINK_MODE_100baseFX_Half_BIT,
+		  "100baseFx/Half" },
+		{ 1, ETHTOOL_LINK_MODE_100baseFX_Full_BIT,
+		  "100baseFx/Full" },
 	};
 	int indent;
 	int did1, new_line_pend;
diff --git a/netlink/settings.c b/netlink/settings.c
index 935724e799da..a11c85756ca6 100644
--- a/netlink/settings.c
+++ b/netlink/settings.c
@@ -147,6 +147,8 @@ static const struct link_mode_info link_modes[] = {
 	[ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT]	= __REAL(400000),
 	[ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT]	= __REAL(400000),
 	[ETHTOOL_LINK_MODE_FEC_LLRS_BIT]		= __SPECIAL(FEC),
+	[ETHTOOL_LINK_MODE_100baseFX_Half_BIT]		= __HALF_DUPLEX(100),
+	[ETHTOOL_LINK_MODE_100baseFX_Full_BIT]		= __REAL(100),
 };
 const unsigned int link_modes_count = ARRAY_SIZE(link_modes);
 
diff --git a/uapi/linux/ethtool.h b/uapi/linux/ethtool.h
index a1cfbe2ef40f..5c58555fecb4 100644
--- a/uapi/linux/ethtool.h
+++ b/uapi/linux/ethtool.h
@@ -1598,6 +1598,8 @@ enum ethtool_link_mode_bit_indices {
 	ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT	 = 72,
 	ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT	 = 73,
 	ETHTOOL_LINK_MODE_FEC_LLRS_BIT			 = 74,
+	ETHTOOL_LINK_MODE_100baseFX_Half_BIT		 = 90,
+	ETHTOOL_LINK_MODE_100baseFX_Full_BIT		 = 91,
 	/* must be last entry */
 	__ETHTOOL_LINK_MODE_MASK_NBITS
 };
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/1] Adding 100base FX support
  2020-09-14 17:06 [PATCH 0/1] Adding 100base FX support Dan Murphy
  2020-09-14 17:06 ` [PATCH 1/1] ethtool: Add 100BaseFX half and full duplex link modes Dan Murphy
@ 2020-09-14 23:17 ` Michal Kubecek
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Kubecek @ 2020-09-14 23:17 UTC (permalink / raw)
  To: Dan Murphy; +Cc: netdev

On Mon, Sep 14, 2020 at 12:06:37PM -0500, Dan Murphy wrote:
> Hello
> 
> I am adding the 100base Fx support for the ethtool.  There are a few PHYs that
> support the Fiber connection and the ethtool should be able to properly display
> that the PHY supports the 100base-FX Full and Half Duplex modes.
> 
> I am adding this support in the ethtool first and then submit the fiber bits
> into the kernel.
> 
> If the kernel needs to be updated first then I can prepare those patches and
> reference them.

Please add the support to kernel first. Otherwise the kernel-userspace
API may change (e.g. if someone adds another mode before yours so that
the constants would be different from your current submission). You
don't have to wait until the change reaches mainline but it should be
accepted at least to the net-next kernel tree.

Some technical notes:

  - please use "[PATCH ethtool]" subject prefix rather than "ethtool: "
    for ethtool utility patches to distinguish them from patches
    targeting kernel ethtool code
  - please update the header file copies in uapi/ directory in
    a separate patch and update all of them to a specific kernel commit
    as requested in
    https://mirrors.edge.kernel.org/pub/software/network/ethtool/devel.html

Michal

> 
> Dan
> 
> Dan Murphy (1):
>   ethtool: Add 100BaseFX half and full duplex link modes
> 
>  ethtool.c            | 6 ++++++
>  netlink/settings.c   | 2 ++
>  uapi/linux/ethtool.h | 2 ++
>  3 files changed, 10 insertions(+)
> 
> -- 
> 2.28.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-14 23:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14 17:06 [PATCH 0/1] Adding 100base FX support Dan Murphy
2020-09-14 17:06 ` [PATCH 1/1] ethtool: Add 100BaseFX half and full duplex link modes Dan Murphy
2020-09-14 23:17 ` [PATCH 0/1] Adding 100base FX support Michal Kubecek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.