92e3b63c92371f50c47c9b0ead395e89be144dfe
[openwrt/staging/stintel.git] / target / linux / layerscape / patches-6.1 / 704-net-phylink-treat-PHY_INTERFACE_MODE_2500SGMII-in-ph.patch
1 From eb57941154e2ad142c07d47e874a221328467349 Mon Sep 17 00:00:00 2001
2 From: Ioana Ciornei <ioana.ciornei@nxp.com>
3 Date: Thu, 2 Jun 2022 12:11:11 +0300
4 Subject: [PATCH] net: phylink: treat PHY_INTERFACE_MODE_2500SGMII in
5 phylink_get_linkmodes
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 There is a downstream patch which adds a new interface type -
11 PHY_INTERFACE_MODE_2500SGMII (which is really the same one as
12 PHY_INTERFACE_MODE_2500BASEX).
13
14 We backported from upstream the following phylink patch which, of
15 course, does not treat the PHY_INTERFACE_MODE_2500SGMII interface mode
16 in a switch case statement.
17 34ae2c09d46a ("net: phylink: add generic validate implementation")
18
19 Because of this, we get the following build warning.
20
21 drivers/net/phy/phylink.c: In function ‘phylink_get_linkmodes’:
22 drivers/net/phy/phylink.c:322:2: warning: enumeration value ‘PHY_INTERFACE_MODE_2500SGMII’ not handled in switch [-Wswitch]
23 322 | switch (interface) {
24 | ^~~~~~
25
26 Fix it by treating the new interface mode in the switch-case statement.
27
28 Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
29 ---
30 drivers/net/phy/phylink.c | 1 +
31 1 file changed, 1 insertion(+)
32
33 diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
34 index 2805b04d6402..a1e34b127401 100644
35 --- a/drivers/net/phy/phylink.c
36 +++ b/drivers/net/phy/phylink.c
37 @@ -485,6 +485,7 @@ unsigned long phylink_get_capabilities(phy_interface_t interface,
38 break;
39
40 case PHY_INTERFACE_MODE_2500BASEX:
41 + case PHY_INTERFACE_MODE_2500SGMII:
42 caps |= MAC_2500FD;
43 break;
44
45 --
46 2.25.1
47