mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-21 14:37:57 +00:00
0085dd6cb5
Removed upstreamed: pending-5.10/850-0003-PCI-aardvark-Fix-support-for-MSI-interrupts.patch apm821xx/patches-5.10/150-ata-sata_dwc_460ex-Fix-crash-due-to-OOB-write.patch All other patches automatically rebased. Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 Signed-off-by: John Audia <graysky@archlinux.us>
41 lines
1.5 KiB
Diff
41 lines
1.5 KiB
Diff
From 6e12f35cef6b8a458d7ecf507ae330e0bffaad8c Mon Sep 17 00:00:00 2001
|
|
From: Bjarni Jonasson <bjarni.jonasson@microchip.com>
|
|
Date: Wed, 13 Jan 2021 12:56:26 +0100
|
|
Subject: [PATCH] sfp: add support for 100 base-x SFPs
|
|
|
|
Add support for 100Base-FX, 100Base-LX, 100Base-PX and 100Base-BX10 modules
|
|
This is needed for Sparx-5 switch.
|
|
|
|
Signed-off-by: Bjarni Jonasson <bjarni.jonasson@microchip.com>
|
|
Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
---
|
|
drivers/net/phy/sfp-bus.c | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
--- a/drivers/net/phy/sfp-bus.c
|
|
+++ b/drivers/net/phy/sfp-bus.c
|
|
@@ -286,6 +286,12 @@ void sfp_parse_support(struct sfp_bus *b
|
|
br_min <= 1300 && br_max >= 1200)
|
|
phylink_set(modes, 1000baseX_Full);
|
|
|
|
+ /* 100Base-FX, 100Base-LX, 100Base-PX, 100Base-BX10 */
|
|
+ if (id->base.e100_base_fx || id->base.e100_base_lx)
|
|
+ phylink_set(modes, 100baseFX_Full);
|
|
+ if ((id->base.e_base_px || id->base.e_base_bx10) && br_nom == 100)
|
|
+ phylink_set(modes, 100baseFX_Full);
|
|
+
|
|
/* For active or passive cables, select the link modes
|
|
* based on the bit rates and the cable compliance bytes.
|
|
*/
|
|
@@ -405,6 +411,9 @@ phy_interface_t sfp_select_interface(str
|
|
if (phylink_test(link_modes, 1000baseX_Full))
|
|
return PHY_INTERFACE_MODE_1000BASEX;
|
|
|
|
+ if (phylink_test(link_modes, 100baseFX_Full))
|
|
+ return PHY_INTERFACE_MODE_100BASEX;
|
|
+
|
|
dev_warn(bus->sfp_dev, "Unable to ascertain link mode\n");
|
|
|
|
return PHY_INTERFACE_MODE_NA;
|