]> www.infradead.org Git - users/dwmw2/linux.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)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 Dec 2024 04:29:38 +0000 (20:29 -0800)
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>
include/net/dsa.h
net/dsa/port.c

index aaa75bbaa0eac6a6ed045dbe2340ce0a75c62b86..4aeedb296d67e7c6272a9ca929621b012cb960a6 100644 (file)
@@ -1384,5 +1384,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 ee0aaec4c8e0967c4c2a08e97a8d3270abd7525b..5c9d1798e830a0dd2ff863ed6506b819c994c146 100644 (file)
@@ -1575,6 +1575,22 @@ void dsa_port_set_tag_protocol(struct dsa_port *cpu_dp,
        cpu_dp->tag_ops = tag_ops;
 }
 
+/* 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)