summaryrefslogtreecommitdiff
path: root/include/linux/linkmode.h
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-12-09 23:13:51 +0000
committerRussell King <rmk+kernel@armlinux.org.uk>2020-02-17 16:30:02 +0000
commit6fdc64ef7abea4b39ace5c25564ee50a49e7e403 (patch)
treebc858ad6395301ca05efb884f8f47ce4cdf4d00e /include/linux/linkmode.h
parentaccc3c7e052d974e121f652bedba6919565aed1a (diff)
net: add helpers to resolve negotiated flow control
Add a couple of helpers to resolve negotiated flow control. Two helpers are provided: - linkmode_resolve_pause() which takes the link partner and local advertisements, and decodes whether we should enable TX or RX pause at the MAC. This is useful outside of phylib, e.g. in phylink. - phy_get_pause(), which returns the TX/RX enablement status for the current negotiation results of the PHY. This allows us to centralise the flow control resolution, rather than spreading it around. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'include/linux/linkmode.h')
-rw-r--r--include/linux/linkmode.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/linkmode.h b/include/linux/linkmode.h
index 8e5b352e44f2..9ec210f31d06 100644
--- a/include/linux/linkmode.h
+++ b/include/linux/linkmode.h
@@ -88,4 +88,8 @@ static inline int linkmode_subset(const unsigned long *src1,
return bitmap_subset(src1, src2, __ETHTOOL_LINK_MODE_MASK_NBITS);
}
+void linkmode_resolve_pause(const unsigned long *local_adv,
+ const unsigned long *partner_adv,
+ bool *tx_pause, bool *rx_pause);
+
#endif /* __LINKMODE_H */