]> git.ipfire.org Git - thirdparty/openwrt.git/blob
d7342daa0ba8f3248cb36c4819c571c2dcd85478
[thirdparty/openwrt.git] /
1 From 99379f587278c818777cb4778e2c79c6c1440c65 Mon Sep 17 00:00:00 2001
2 From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
3 Date: Tue, 10 Dec 2024 14:18:21 +0000
4 Subject: [PATCH] net: dsa: provide implementation of .support_eee()
5
6 Provide a trivial implementation for the .support_eee() method which
7 switch drivers can use to simply indicate that they support EEE on
8 all their user ports.
9
10 Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
11 Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
12 Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
13 Link: https://patch.msgid.link/E1tL149-006cZJ-JJ@rmk-PC.armlinux.org.uk
14 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
15 ---
16 include/net/dsa.h | 1 +
17 net/dsa/port.c | 16 ++++++++++++++++
18 2 files changed, 17 insertions(+)
19
20 --- a/include/net/dsa.h
21 +++ b/include/net/dsa.h
22 @@ -1399,5 +1399,6 @@ static inline bool dsa_user_dev_check(co
23
24 netdev_tx_t dsa_enqueue_skb(struct sk_buff *skb, struct net_device *dev);
25 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);
26 +bool dsa_supports_eee(struct dsa_switch *ds, int port);
27
28 #endif
29 --- a/net/dsa/port.c
30 +++ b/net/dsa/port.c
31 @@ -1589,6 +1589,22 @@ dsa_port_phylink_mac_select_pcs(struct p
32 return pcs;
33 }
34
35 +/* dsa_supports_eee - indicate that EEE is supported
36 + * @ds: pointer to &struct dsa_switch
37 + * @port: port index
38 + *
39 + * A default implementation for the .support_eee() DSA operations member,
40 + * which drivers can use to indicate that they support EEE on all of their
41 + * user ports.
42 + *
43 + * Returns: true
44 + */
45 +bool dsa_supports_eee(struct dsa_switch *ds, int port)
46 +{
47 + return true;
48 +}
49 +EXPORT_SYMBOL_GPL(dsa_supports_eee);
50 +
51 static void dsa_port_phylink_mac_config(struct phylink_config *config,
52 unsigned int mode,
53 const struct phylink_link_state *state)