]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: dsa: provide implementation of .support_eee()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 10 Dec 2024 14:18:21 +0000 (14:18 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Sep 2025 16:58:19 +0000 (18:58 +0200)
commit 99379f587278c818777cb4778e2c79c6c1440c65 upstream.

Provide a trivial implementation for the .support_eee() method which
switch drivers can use to simply indicate that they support EEE on
all their user ports.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://patch.msgid.link/E1tL149-006cZJ-JJ@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Harshit: Resolve contextual conflicts due to missing commit:
  539770616521 ("net: dsa: remove obsolete phylink dsa_switch operations")
  and commit: ecb595ebba0e ("net: dsa: remove
  dsa_port_phylink_mac_select_pcs()") in 6.12.y ]
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/dsa.h
net/dsa/port.c

index fa99fc5249e995906ea09452a01f8807485c712c..877f9b270cf6fe1428361cf9272209ebe3cf8755 100644 (file)
@@ -1399,5 +1399,6 @@ static inline bool dsa_user_dev_check(const struct net_device *dev)
 
 netdev_tx_t dsa_enqueue_skb(struct sk_buff *skb, struct net_device *dev);
 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);
+bool dsa_supports_eee(struct dsa_switch *ds, int port);
 
 #endif
index 25258b33e59e015db7c4be9a7d403e318b21af71..9c77c80e8fe97532df4b366bcb08d24cbddcfb14 100644 (file)
@@ -1589,6 +1589,22 @@ dsa_port_phylink_mac_select_pcs(struct phylink_config *config,
        return pcs;
 }
 
+/* dsa_supports_eee - indicate that EEE is supported
+ * @ds: pointer to &struct dsa_switch
+ * @port: port index
+ *
+ * A default implementation for the .support_eee() DSA operations member,
+ * which drivers can use to indicate that they support EEE on all of their
+ * user ports.
+ *
+ * Returns: true
+ */
+bool dsa_supports_eee(struct dsa_switch *ds, int port)
+{
+       return true;
+}
+EXPORT_SYMBOL_GPL(dsa_supports_eee);
+
 static void dsa_port_phylink_mac_config(struct phylink_config *config,
                                        unsigned int mode,
                                        const struct phylink_link_state *state)