netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: netdev@vger.kernel.org,
	Russell King - ARM Linux admin <linux@armlinux.org.uk>,
	davem@davemloft.net, kuba@kernel.org
Cc: pavana.sharma@digi.com, vivien.didelot@gmail.com,
	f.fainelli@gmail.com, lkp@intel.com, ashkan.boldaji@digi.com,
	andrew@lunn.ch,
	"Chris Packham" <chris.packham@alliedtelesis.co.nz>,
	olteanv@gmail.com, "Marek Behún" <kabel@kernel.org>
Subject: [PATCH net-next 4/4] sfp: add support for 5gbase-t SFPs
Date: Tue, 16 Feb 2021 20:20:55 +0100	[thread overview]
Message-ID: <20210216192055.7078-5-kabel@kernel.org> (raw)
In-Reply-To: <20210216192055.7078-1-kabel@kernel.org>

The sfp_parse_support() function is setting 5000baseT_Full in some cases.
Now that we have PHY_INTERFACE_MODE_5GBASER interface mode available,
change sfp_select_interface() to return PHY_INTERFACE_MODE_5GBASER if
5000baseT_Full is set in the link mode mask.

Signed-off-by: Marek Behún <kabel@kernel.org>
---
 drivers/net/phy/sfp-bus.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index 3cfd773ae5f4..2e11176c6b94 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -400,6 +400,9 @@ phy_interface_t sfp_select_interface(struct sfp_bus *bus,
 	    phylink_test(link_modes, 10000baseT_Full))
 		return PHY_INTERFACE_MODE_10GBASER;
 
+	if (phylink_test(link_modes, 5000baseT_Full))
+		return PHY_INTERFACE_MODE_5GBASER;
+
 	if (phylink_test(link_modes, 2500baseX_Full))
 		return PHY_INTERFACE_MODE_2500BASEX;
 
-- 
2.26.2


  parent reply	other threads:[~2021-02-16 19:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 19:20 [PATCH net-next 0/4] Add 5gbase-r PHY interface mode Marek Behún
2021-02-16 19:20 ` [PATCH net-next 1/4] dt-bindings: net: Add 5GBASER phy interface Marek Behún
2021-02-16 19:20 ` [PATCH net-next 2/4] net: phy: Add 5GBASER interface mode Marek Behún
2021-02-16 19:20 ` [PATCH net-next 3/4] net: phylink: Add 5gbase-r support Marek Behún
2021-02-16 19:20 ` Marek Behún [this message]
2021-02-16 22:20 ` [PATCH net-next 0/4] Add 5gbase-r PHY interface mode patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210216192055.7078-5-kabel@kernel.org \
    --to=kabel@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=ashkan.boldaji@digi.com \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lkp@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pavana.sharma@digi.com \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).